Documentation ¶
Index ¶
- func EnsurePath(path string, dir bool) error
- func GetPrivateIP() (net.IP, error)
- func GetPublicIPv6() (net.IP, error)
- type ListOpts
- func (opts *ListOpts) Delete(key string)
- func (opts *ListOpts) Get(key string) bool
- func (opts *ListOpts) GetAll() []string
- func (opts *ListOpts) GetAllOrEmpty() []string
- func (opts *ListOpts) GetMap() map[string]struct{}
- func (opts *ListOpts) Len() int
- func (opts *ListOpts) Set(value string) error
- func (opts *ListOpts) String() string
- func (opts *ListOpts) Type() string
- func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts
- type ValidatorFctType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsurePath ¶
EnsurePath is used to make sure a path exists
func GetPrivateIP ¶
GetPrivateIP is used to return the first private IP address associated with an interface on the machine
func GetPublicIPv6 ¶
GetPublicIPv6 is used to return the first public IP address associated with an interface on the machine
Types ¶
type ListOpts ¶
type ListOpts struct {
// contains filtered or unexported fields
}
ListOpts holds a list of values and a validation function.
func NewListOpts ¶
func NewListOpts(validator ValidatorFctType) ListOpts
NewListOpts creates a new ListOpts with the specified validator.
func NewListOptsRef ¶
func NewListOptsRef(values *[]string, validator ValidatorFctType) *ListOpts
NewListOptsRef creates a new ListOpts with the specified values and validator.
func (*ListOpts) GetAllOrEmpty ¶
GetAllOrEmpty returns the values of the slice or an empty slice when there are no values.
func (*ListOpts) GetMap ¶
GetMap returns the content of values in a map in order to avoid duplicates.
func (*ListOpts) WithValidator ¶
func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts
WithValidator returns the ListOpts with validator set.
type ValidatorFctType ¶
ValidatorFctType defines a validator function that returns a validated string and/or an error.