mirror of
https://github.com/Luzifer/ots.git
synced 2024-12-23 14:19:36 -05:00
22 lines
574 B
Go
22 lines
574 B
Go
|
// Package storage describes the requirements a storage provider
|
||
|
// has to fulfill ot be usable in OTS
|
||
|
package storage
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type (
|
||
|
// Storage is the interface to implement in each storage provider
|
||
|
Storage interface {
|
||
|
Count() (int64, error)
|
||
|
Create(secret string, expireIn time.Duration) (string, error)
|
||
|
ReadAndDestroy(id string) (string, error)
|
||
|
}
|
||
|
)
|
||
|
|
||
|
// ErrSecretNotFound is a generic error to be returned when a secret
|
||
|
// does not exist in the backend. It will then be handled by API.
|
||
|
var ErrSecretNotFound = errors.New("secret not found")
|