Documentation ¶
Overview ¶
Package fs implements a secret key store that stores secret keys as files on the file system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyStore ¶
type KeyStore struct { // Dir is the directory where secret key files // are located. The key store will read / write // secrets from / to files in this directory. Dir string // CacheExpireAfter is the duration after which // cache entries expire such that they have to // be loaded from the backend storage again. CacheExpireAfter time.Duration // CacheExpireUnusedAfter is the duration after // which not recently used cache entries expire // such that they have to be loaded from the // backend storage again. // Not recently is defined as: CacheExpireUnusedAfter / 2 CacheExpireUnusedAfter time.Duration // ErrorLog specifies an optional logger for errors // when files cannot be opened, deleted or contain // invalid content. // If nil, logging is done via the log package's // standard logger. ErrorLog *log.Logger // contains filtered or unexported fields }
KeyStore is a file system secret key store that stores secret keys as files in a directory.
func (*KeyStore) Create ¶
Create adds the given secret key to the store if and only if no entry for name exists. If an entry already exists it returns kes.ErrKeyExists.
In particular, Create creates a new file in KeyStore.Dir and writes the secret key to it.
Click to show internal directories.
Click to hide internal directories.