Documentation ¶
Overview ¶
Package loader defines an abstraction to store a private, or a public, key in a storage.
When the key does not exist, it will generate a new one using a generator implemented by the caller and stores it for the next time.
Documentation Last Review: 06.10.2020
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader interface { // LoadOrCreate tries to load the key and returns it if found, otherwise it // generates a new one using the generator and stores it. LoadOrCreate(Generator) ([]byte, error) // Load loads the key and returns an error if it doesn't find it. Load() ([]byte, error) }
Loader is an abstraction to load a key from a storage. It allows for instance to load a private key from the disk, or generate it if it doesn't exist.
func NewFileLoader ¶
NewFileLoader creates a new loader that is using the file given in parameter.
Click to show internal directories.
Click to hide internal directories.