Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SCIONEnvironment ¶
type SCIONEnvironment struct {
// contains filtered or unexported fields
}
SCIONEnvironment can be used to access the common SCION configuration values, like the SCION daemon address, the dispatcher socket address and the local IP as well as the local ISD-AS.
func (*SCIONEnvironment) Daemon ¶
func (e *SCIONEnvironment) Daemon() string
Daemon returns the path to the SCION daemon. The value is loaded from one of the following sources with the precedence as listed:
- Command line flag
- Environment variable
- Environment configuration file
- Default value.
func (*SCIONEnvironment) Dispatcher ¶
func (e *SCIONEnvironment) Dispatcher() string
Dispatcher returns the path to the SCION dispatcher socket. The value is loaded from one of the following sources with the precedence as listed:
- Command line flag
- Environment variable
- Environment configuration file
- Default value.
func (*SCIONEnvironment) LoadExternalVars ¶
func (e *SCIONEnvironment) LoadExternalVars() error
LoadExternalVar loads variables from the SCION environment file and from the OS environment variables. Parsing errors will be reported with an error. A missing file or environment variable is not reported.
func (*SCIONEnvironment) Local ¶
func (e *SCIONEnvironment) Local() netaddr.IP
Local returns the loca IP to listen on. The value is loaded from one of the following sources with the precedence as listed:
- Command line flag
- Environment variable
- Default value.
func (*SCIONEnvironment) Register ¶
func (e *SCIONEnvironment) Register(flagSet *pflag.FlagSet)
Register registers the command line flags. This should be called when command line flags are set up, before any command that accesses the values is called. It is safe to not call this at all, which means command line flag values are not considered.
type TCPAddr ¶
TCPAddr implements pflags.Value.
func (*TCPAddr) MarshalText ¶
func (*TCPAddr) UnmarshalText ¶
type Time ¶
type Time struct { // Time indicates the time after the flag is parsed. Time time.Time // Current indicates the current time for relative time duration. Current time.Time // Default is a custom default string. Default string }
Time implements pflags.Value.
The flag value can be one of the following: - RFC3339 timestamp - unix timestamp - relative time duration
For relative time duration, the same formats as util.ParseDuration are supported.
The default value returned by the String() method is calculated as Time.Sub(Current), unless Default is set. If Default is set, that is returned as the default value.
Either Time or Default must be set. If neither is set, this flag panics when constructing the default value.
func (*Time) MarshalText ¶
func (*Time) UnmarshalText ¶
type UDPAddr ¶
UDPAddr implements pflags.Value.