store

package
v0.0.0-...-99157af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package store defines a key storage interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyFactory

type KeyFactory[T common.IKey[M], M common.IMetadata] struct{}

KeyFactory generic struct to select the correct FromTurnkeyPrivateKey function.

func (KeyFactory[T, M]) FromTurnkeyPrivateKey

func (kf KeyFactory[T, M]) FromTurnkeyPrivateKey(data string) (T, error)

FromTurnkeyPrivateKey converts a Turnkey-encoded private key string to a key.

type Store

type Store[T common.IKey[M], M common.IMetadata] interface {
	// Load pulls a key from the store.
	Load(name string) (T, error)

	// Store saves the key to the store.
	Store(name string, key common.IKey[M]) error
}

Store provides an interface in which API or Encryption keys may be stored and retrieved.

Directories

Path Synopsis
Package local provides a keystore based on a local directory.
Package local provides a keystore based on a local directory.
Package ram defines a RAM-based apikey store.
Package ram defines a RAM-based apikey store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL