Documentation ¶
Index ¶
- type EtcdStore
- func (e *EtcdStore) AllCtx(ctx context.Context) (map[string][]byte, error)
- func (e *EtcdStore) Commit(token string, b []byte, expiry time.Time) error
- func (e *EtcdStore) CommitCtx(ctx context.Context, token string, b []byte, expiry time.Time) error
- func (e *EtcdStore) Delete(token string) error
- func (e *EtcdStore) DeleteCtx(ctx context.Context, token string) error
- func (e *EtcdStore) Find(token string) ([]byte, bool, error)
- func (e *EtcdStore) FindCtx(ctx context.Context, token string) (b []byte, exists bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdStore ¶
type EtcdStore struct {
// contains filtered or unexported fields
}
EtcdStore represents the session store.
func New ¶
New returns a new EtcdStore instance. The client parameter should be a pointer to a etcd client instance.
func NewWithPrefix ¶
NewWithPrefix returns a new EtcdStore instance. The client parameter should be a pointer to a etcd client instance. The prefix parameter controls the etcd key prefix, which can be used to avoid naming clashes if necessary.
func (*EtcdStore) AllCtx ¶
AllCtx returns a map containing the token and data for all active (i.e. not expired) sessions in the EtcdStore instance.
func (*EtcdStore) CommitCtx ¶
CommitCtx adds a session token and data to the EtcdStore instance with the given expiry time. If the session token already exists then the data and expiry time are updated.
func (*EtcdStore) DeleteCtx ¶
DeleteCtx removes a session token and corresponding data from the EtcdStore instance.