Documentation
¶
Overview ¶
Package storage describes the requirements a storage provider has to fulfill ot be usable in OTS
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSecretNotFound = errors.New("secret not found")
ErrSecretNotFound is a generic error to be returned when a secret does not exist in the backend. It will then be handled by API.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage interface {
// Count returns the number of stored secrets
Count() (int64, error)
// Create inserts a new secret and returns its ID
Create(secret string, expireIn time.Duration) (string, error)
// ReadAndDestroy returns a secret and while reading removes it
// from the storage
ReadAndDestroy(id string) (string, error)
}
Storage is the interface to implement in each storage provider
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memory implements a pure in-memory store for secrets which is suitable for testing and should not be used for productive use
|
Package memory implements a pure in-memory store for secrets which is suitable for testing and should not be used for productive use |
|
Package redis implements a Redis backed storage for secrets
|
Package redis implements a Redis backed storage for secrets |