Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSecret = errs.Class("no apikey error")
ErrNoSecret represents errors from the apikey database.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct { // Secret is PK of the table and keeps unique value sno apikey token Secret Secret CreatedAt time.Time `json:"createdAt"` }
APIKey describing apikey model in the database.
type DB ¶
type DB interface { // Store stores apikey token into db. Store(ctx context.Context, secret APIKey) error // Check checks if unique apikey exists in db by token. Check(ctx context.Context, token Secret) error // Revoke removes token from db. Revoke(ctx context.Context, token Secret) error }
DB is interface for working with apikey tokens.
architecture: Database
type Secret ¶
type Secret [32]byte
Secret stores token of storagenode APIkey.
func NewSecretToken ¶
NewSecretToken creates new apikey token.
func TokenSecretFromBase64 ¶
TokenSecretFromBase64 creates new apikey token from base64 string.
Click to show internal directories.
Click to hide internal directories.