Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTokenNotFound = errors.New("The passed token has either expired or never existed")
)
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { // Commission creates a single use token that expires after the given timeout. Commission(ctx context.Context, t time.Duration, k string, v interface{}) (string, error) // Peek gets the data the token references without changing its lifetime. Peek(ctx context.Context, token string, v interface{}) error // Extend sets the new duration before an existing token times out. Note that it doesn't // take into account how long the old token had to expire, as it uses the new duration // entirely. Extend(ctx context.Context, token string, t time.Duration, v interface{}) error // Reset changes the contents of the token without changing it's TTL Reset(ctx context.Context, k string, v interface{}) error // Decommission loads the value referenced by the token and dispenses of the token, // making it unvailable for further use. Decommission(ctx context.Context, token string, v interface{}) error // Revoke renders the token generated for the given key useless. Revoke(ctx context.Context, key string) error }
Click to show internal directories.
Click to hide internal directories.