Documentation
¶
Index ¶
- Constants
- Variables
- func FormatError(err error) error
- func GetExecutablePath() string
- func GetFromKeyring(key string) (string, error)
- func Handle(err error) error
- func Hexify(s string) string
- func LookupAddress(address string) string
- func NewGUID() string
- func RebuildStringSliceFlag(flags []string, delimiter rune) ([]string, error)
- func RemoveFromKeyRing(key string) error
- func SetToKeyring(key, value string) error
- func SkipOAT(t testing.TB)
- func TimeAfter1601(offset int64) time.Time
- func TimeSince1601() time.Duration
- func ToTitleNoLower(in string) string
- func Unhexify(s string) string
- func Validate() *validator.Validate
- type ValidatorInterface
Constants ¶
const ( KEYCTL_PERM_VIEW = uint32(1 << iota) KEYCTL_PERM_READ KEYCTL_PERM_WRITE KEYCTL_PERM_SEARCH KEYCTL_PERM_LINK KEYCTL_PERM_SETATTR KEYCTL_PERM_ALL = uint32((1 << iota) - 1) )
forked KEYCTL_PERM modes from github.com/99designs/keyring to make the config platform independent
const ( KEYCTL_PERM_OTHERS uint32 = iota * 8 KEYCTL_PERM_GROUP KEYCTL_PERM_USER KEYCTL_PERM_PROCESS )
Variables ¶
var Config = keyring.Config{ AllowedBackends: keyring.AvailableBackends(), FileDir: "~/.config/ldap-cli", FilePasswordFunc: passwordFunc, KeyCtlScope: "user", KeyCtlPerm: (KEYCTL_PERM_ALL << KEYCTL_PERM_USER) | (KEYCTL_PERM_ALL << KEYCTL_PERM_PROCESS), KeychainAccessibleWhenUnlocked: true, KeychainName: "ldap-cli", KeychainPasswordFunc: passwordFunc, KeychainSynchronizable: false, KeychainTrustApplication: true, KWalletAppID: "ldap-cli", KWalletFolder: "ldap-cli", LibSecretCollectionName: "ldap-cli", PassCmd: "pass", PassDir: "~/.password-store", PassPrefix: "ldap-cli.", ServiceName: "ldap-cli", WinCredPrefix: "ldap-cli.", }
Config is the configuration for the keyring
var ErrAuthenticationFailed = errors.New("authentication failed")
var ErrInvalidFilter = errors.New("invalid filter syntax")
var ErrNetworkFailure = errors.New("network error")
var ErrNothingReturned = errors.New("nothing returned")
var ErrOperationFailed = errors.New("query failed")
var ErrQuotaExceeded = errors.New("quota limit exceed")
var ErrUbiquitousResults = errors.New("ubiquitous response")
Epoch start date: 1601-01-01 00:00:00 UTC
Functions ¶
func GetExecutablePath ¶
func GetExecutablePath() string
Get path of the executable that started current gr process.
func GetFromKeyring ¶ added in v1.2.3
GetFromKeyring retrieves a value from the keyring
func LookupAddress ¶
Resolve Internet Protocol address to domain name
func RebuildStringSliceFlag ¶
Parse string slice or string array flags by using custom csv reader
func RemoveFromKeyRing ¶ added in v1.2.3
RemoveFromKeyRing removes a value from the keyring
func SetToKeyring ¶ added in v1.2.3
SetToKeyring sets a value to the keyring
func TimeAfter1601 ¶
Retrieve date by applying offset. It should be in 0.1 µs
func TimeSince1601 ¶
Retrieve current time since 1601-01-01 00:00:00 UTC
func ToTitleNoLower ¶
Convert English words to title case (prevent lowercasing)
Types ¶
type ValidatorInterface ¶
type ValidatorInterface interface {
IsValid() bool
}
ValidatorInterface is an interface for validating structs