Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout = errors.New("timeout")
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) // 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.
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.