Documentation
¶
Overview ¶
Package operatortest holds test doubles for the operator domain.
Index ¶
- type MemStore
- func (m *MemStore) CreateOperatorToken(_ context.Context, t operator.Token) error
- func (m *MemStore) CreateSession(_ context.Context, s operator.Session) error
- func (m *MemStore) DeleteExpiredSessions(_ context.Context, now time.Time) (int64, error)
- func (m *MemStore) DeleteSession(_ context.Context, idHash []byte) error
- func (m *MemStore) FindOperatorTokenByHash(_ context.Context, hash []byte) (*operator.Token, error)
- func (m *MemStore) GetOperator(context.Context) (*operator.Operator, error)
- func (m *MemStore) GetSession(_ context.Context, idHash []byte) (*operator.Session, error)
- func (m *MemStore) ListOperatorTokens(context.Context) ([]operator.Token, error)
- func (m *MemStore) RecordOperatorTokenUse(_ context.Context, id uuid.UUID, now time.Time) error
- func (m *MemStore) RevokeOperatorToken(_ context.Context, id uuid.UUID, now time.Time) error
- func (m *MemStore) SessionCount() int
- func (m *MemStore) SetOperator(_ context.Context, op operator.Operator) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is an in-memory operator.Store for exercising the domain and the surface without a database. The Postgres implementation is tested in internal/store.
func (*MemStore) CreateOperatorToken ¶
CreateOperatorToken implements operator.Store.
func (*MemStore) CreateSession ¶
CreateSession implements operator.Store.
func (*MemStore) DeleteExpiredSessions ¶
DeleteExpiredSessions implements operator.Store.
func (*MemStore) DeleteSession ¶
DeleteSession implements operator.Store.
func (*MemStore) FindOperatorTokenByHash ¶
FindOperatorTokenByHash implements operator.Store.
func (*MemStore) GetOperator ¶
GetOperator implements operator.Store.
func (*MemStore) GetSession ¶
GetSession implements operator.Store.
func (*MemStore) ListOperatorTokens ¶
ListOperatorTokens implements operator.Store.
func (*MemStore) RecordOperatorTokenUse ¶
RecordOperatorTokenUse implements operator.Store.
func (*MemStore) RevokeOperatorToken ¶
RevokeOperatorToken implements operator.Store.
func (*MemStore) SessionCount ¶
SessionCount reports how many sessions are stored.