Documentation ¶
Index ¶
Constants ¶
const DefaultLongDescriptionFormat = `` /* 355-byte string literal not displayed */
const DefaultShortDescription = "login as user and save authentication data"
const DefaultTokenFileLocation = ".knox_user_auth"
const DefaultUsageLine = "login [username]"
Variables ¶
var ErrTimeout = errors.New("timeout waiting on lock to become available")
ErrTimeout is returned when we cannot obtain an exclusive lock on the key file.
var Version string = "devel"
Version represents the compiled version of the client binary. It can be overridden at compile time with: `go build -ldflags "-X github.com/pinterest/knox/client.Version=1.2.3" github.com/pinterest/knox/cmd/dev_client` In the above example, knox version would give you `1.2.3`. By default, the version is `devel`.
Functions ¶
Types ¶
type Command ¶
type Command struct { // Run runs the command. // The args are the arguments after the command name. Run func(cmd *Command, args []string) *ErrorStatus // UsageLine is the one-line usage message. // The first word in the line is taken to be the command name. UsageLine string // Short is the short description shown in the 'go help' output. Short string // Long is the long message shown in the 'go help <this-command>' output. Long string // Flag is a set of flags specific to this command. Flag flag.FlagSet // CustomFlags indicates that the command will do its own // flag parsing. CustomFlags bool }
A Command is an implementation of a go command like go build or go fix.
func NewLoginCommand ¶
type ErrorStatus ¶
type ErrorStatus struct {
// contains filtered or unexported fields
}
ErrorStatus wraps the error status of knox client command execution
type Keys ¶
type Keys interface { Get() ([]string, error) Add([]string) error Overwrite([]string) error Remove([]string) error Lock() error Unlock() error }
Keys are an interface for storing a list of key ids (for use with the register file to provide locks)
func NewKeysFile ¶
NewKeysFile takes in a filename and outputs an implementation of the Keys interface
type KeysFile ¶
type KeysFile struct {
// contains filtered or unexported fields
}
KeysFile is an implementation of Keys based on the file system for the register file.
func (*KeysFile) Lock ¶
Lock performs the nonblocking syscall lock and retries until the global timeout is met.
func (*KeysFile) Overwrite ¶
Overwrite deletes all existing values in the key list and writes the input. It expects Lock to have been called.
type VisibilityParams ¶
type VisibilityParams struct { Logf func(string, ...interface{}) Errorf func(string, ...interface{}) SummaryMetrics func(map[string]uint64) InvokeMetrics func(map[string]string) GetKeyMetrics func(map[string]string) }
VisibilityParams exposes functions for the knox client to provide information