Categorygithub.com/iDigitalFlame/linker
modulepackage
1.1.0
Repository: https://github.com/idigitalflame/linker.git
Documentation: pkg.go.dev

# README

Linker: HTTP URL Shortener

Linker is a Golang based URL shortening service. This self-hosted binary provides fast and efficient HTTP redirection.

Linker is backed by a MySQL database to store name and URL mappings.

Config

Linker is configured using the following file in "/etc/linker.conf". This file path can be changed using the "-c" flag or by setting the "LINKER_CONFIG" environment variable.

Default Config

{
    "key": "",
    "cert": "",
    "listen": "0.0.0.0:80",
    "timeout": 5,
    "default": "https://duckduckgo.com",
    "db": {
        "name": "linker",
        "server": "tcp(localhost:3306)",
        "username": "linker_user",
        "password": "password"
    }
}

Command Line Options

Linker - HTTP Web URL Shortener v3
iDigitalFlame & PurpleSec 2020 - 2023 (idigitalflame.com)

Usage:
  -h              Print this help menu.
  -l              List the URL mapping and exit.
  -d              Dump the default configuration and exit.
  -a <name> <URL> Add the specified <name> to <URL> mapping.
  -r <name>       Delete the specified <name> to URL mapping.
  -c <file>       Configuration file path. The environment
                  variable "LINKER_CONFIG" can be used to
                  specify the file path instead.

# Packages

No description provided by the author

# Functions

New creates a new Linker instance and attempts to gather the initial configuration from a JSON formatted file.

# Constants

Defaults is a string representation of the default configuration for Linker.

# Structs

Linker is a struct that contains the web service and SQL queries that support the Linker URL shortener.