Documentation
¶
Overview ¶
Package conf provides means to load gonsot configuration on-disk
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod int
AuthMethod is the type of authenticate we'll try to perform
const ( AuthHeader AuthMethod = iota AuthToken )
func (AuthMethod) String ¶
func (i AuthMethod) String() string
func (*AuthMethod) UnmarshalText ¶
func (a *AuthMethod) UnmarshalText(text []byte) (err error)
UnmarshalText validates before assigning
type Config ¶
type Config struct { APIVersion string AuthHeader string AuthMethod AuthMethod DefaultDomain string DefaultSite int Email Email SecretKey string URL URL // Manually set Site to override DefaultSite or if you don't set // DefaultSite Site int }
Config represents settings needed to connect to an NSoT server
func (*Config) Load ¶
Load marshalls config files into the struct automatically
There are two locations for gonsot.toml ¶
* System level (Under /etc) * User level (Under $HOME as a dotfile)
User level configs will be preferred, merging if possible with system config. This allows "global" configuration but lets a user do overrides
If existing INI config from pynsot exists and no TOML found, will create TOML config with the same settings
type Email ¶
Email is the email address to use to login
func (*Email) MarshalText ¶
MarshalText converts back to string form
func (*Email) UnmarshalText ¶
UnmarshalText validates before assigning
type URL ¶
URL is the base URL for an NSoT instance
func (*URL) MarshalText ¶
MarshalText converts back to string form
func (*URL) UnmarshalText ¶
UnmarshalText validates before assigning