Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSecret = errs.Class("no apikey error")
ErrNoSecret represents errors from the apikey database.
View Source
var ( // ErrService defines secret service error. ErrService = errs.Class("secret service error") )
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 TokenSecretFromBase64 ¶
TokenSecretFromBase64 creates new apikey token from base64 string.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service responsible for operations with storagenode's uniq secret.
architecture: Service
Click to show internal directories.
Click to hide internal directories.