Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DischargeTokenStore ¶
type DischargeTokenStore struct {
// contains filtered or unexported fields
}
DischargeTokenStore is a store for discharge tokens. It wraps a KeyValueStore.
func NewDischargeTokenStore ¶
func NewDischargeTokenStore(store simplekv.Store) *DischargeTokenStore
NewDischargeTokenStore creates a new DischargeTokenStore using the given KeyValueStore for backing storage.
func (*DischargeTokenStore) Get ¶
func (s *DischargeTokenStore) Get(ctx context.Context, key string) (*httpbakery.DischargeToken, error)
Get retrieves the DischargeToken with the given key from the store. If there is no such token, or the token has expired, then the returned error will have a cause of store.ErrNotFound.
func (*DischargeTokenStore) Put ¶
func (s *DischargeTokenStore) Put(ctx context.Context, dt *httpbakery.DischargeToken, expire time.Time) (string, error)
Put adds the given DischargeToken to the store, returning the key that should be used to later retrieve the token. The DischargeToken will only be available in the store until the given expire time.
Click to show internal directories.
Click to hide internal directories.