argv_from_environment

command
v0.0.0-...-60b6bad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Argv from Environment

Nearly the same as argv_from_source but environment variables may be used to override the compile-time config.

Environment Variables

The address and file may be set with environment variables, overriding compile-time settings, as follows

Default Variable Description
ALPT4ATS_ADDRESS TCP Server Address
ALPT4ATS_FILE File to send on the TCP connection

The variable names may be changed at compile-time, as below.

Compile-time Config

Compile time configuration is possible with the linker's -X (as in go build -ldflags '-X main.Foo=bar'). The variables are as follows

Variable Default Description
main.Address localhost:4444 TCP Server Address
main.AddressEnvVar ALPT4ATS_ADDRESS Environment variable which sets the TCP Server Address
main.File /etc/hosts File to send on the TCP connection
main.FileEnvVar ALPT4ATS_FILE Environment variable which sets the File to send on the TCP connection

When building with the Makefile these may be passed in with the LINKFLAGS environment variable, as in

LINKFLAGS="-X main.Address=example.com:8080" make

Documentation

Overview

Program argv_from_environment - argv_from_source with optional environment variables

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL