storage

package
v1.21.8 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

Jump to

Keyboard shortcuts

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