Documentation ¶
Index ¶
- Variables
- func ReadPrefixedOptions(conf Section, prefixName string, defaults map[string][]string) map[string][]string
- func ReadResellerOptions(conf Section, defaults map[string][]string) ([]string, map[string]map[string][]string)
- func UidFromConf(path string) (uint32, uint32, error)
- type Config
- func (f Config) Get(section string, key string) (string, bool)
- func (f Config) GetBool(section string, key string, dfl bool) bool
- func (f Config) GetDefault(section string, key string, dfl string) string
- func (f Config) GetFloat(section string, key string, dfl float64) float64
- func (f Config) GetInt(section string, key string, dfl int64) int64
- func (f Config) GetLimit(section string, key string, dfla int64, dflb int64) (int64, int64)
- func (f Config) GetSection(section string) Section
- func (f Config) HasSection(section string) bool
- type Policy
- type PolicyList
- type Section
- func (s Section) Get(key string) (string, bool)
- func (s Section) GetBool(key string, dfl bool) bool
- func (s Section) GetDefault(key string, dfl string) string
- func (s Section) GetFloat(key string, dfl float64) float64
- func (s Section) GetInt(key string, dfl int64) int64
- func (s Section) GetLimit(key string, dfla int64, dflb int64) (int64, int64)
- type SyncRealm
- type SyncRealmList
Constants ¶
This section is empty.
Variables ¶
var GetHashPrefixAndSuffix getHashPrefixAndSuffixFunc = normalGetHashPrefixAndSuffix
Functions ¶
func ReadPrefixedOptions ¶
func ReadResellerOptions ¶
Types ¶
type Config ¶
type Config struct{ ini.File }
Config represents an ini file.
func LoadConfig ¶
LoadConfig loads an ini from a path. The path should be a *.conf file or a *.conf.d directory.
func LoadConfigs ¶
LoadConfigs finds and loads any configs that exist for the given path. Multiple configs are supported for things like SAIO setups.
func StringConfig ¶
StringConfig returns an Config from a string, for use in tests.
func (Config) Get ¶
Get fetches a value from the Config, looking in the DEFAULT section if not found in the specific section. Also ignores "set " key prefixes, like paste.
func (Config) GetBool ¶
GetBool loads a true/false value from the config, with support for things like "yes", "true", "1", "t", etc.
func (Config) GetDefault ¶
GetDefault returns a value from the config, or returns the default setting if the entry doesn't exist.
func (Config) GetSection ¶
GetSection returns a Section struct.
func (Config) HasSection ¶
HasSection determines whether or not the section exists in the ini file.
type PolicyList ¶
func GetPolicies ¶
func GetPolicies() (PolicyList, error)
LoadPolicies loads policies, probably from /etc/swift/swift.conf
func (PolicyList) Default ¶
func (p PolicyList) Default() int
func (PolicyList) GetPolicyInfo ¶
func (p PolicyList) GetPolicyInfo() []map[string]interface{}
func (PolicyList) NameLookup ¶
func (p PolicyList) NameLookup(s string) *Policy
type SyncRealmList ¶
func GetSyncRealms ¶
func GetSyncRealms() (SyncRealmList, error)
func (SyncRealmList) ValidateSyncTo ¶
func (l SyncRealmList) ValidateSyncTo(syncHeader string) bool