gconfigexample

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UsageExample

func UsageExample() error

Types

type SomeConfigurableStruct

type SomeConfigurableStruct struct {
	// contains filtered or unexported fields
}

Define your struct using the Value types from gconfig, choosing the appropriate type for the data sensitivity. passwords, access tokens, credentials ect should always use SecretStringValue

non sensitive values like IDs etc may use StringValue or OptionalStringValue, though there is little harm in using SecretStringValue for these too if you think it suits the use case better

StringValue SecretStringValue OptionalStringValue

func (*SomeConfigurableStruct) Config

Implement the Configer Interface for your struct. This returns a Config which defines the field types and enables loading and usage of the values

func (*SomeConfigurableStruct) Init

Implement the Initer Interface if you have anything that needs to be initialised after the config is loaded for example a client or db connection

Jump to

Keyboard shortcuts

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