operatortest

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package operatortest holds test doubles for the operator domain.

Index

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 NewMemStore

func NewMemStore() *MemStore

NewMemStore returns an empty store.

func (*MemStore) CreateOperatorToken

func (m *MemStore) CreateOperatorToken(_ context.Context, t operator.Token) error

CreateOperatorToken implements operator.Store.

func (*MemStore) CreateSession

func (m *MemStore) CreateSession(_ context.Context, s operator.Session) error

CreateSession implements operator.Store.

func (*MemStore) DeleteExpiredSessions

func (m *MemStore) DeleteExpiredSessions(_ context.Context, now time.Time) (int64, error)

DeleteExpiredSessions implements operator.Store.

func (*MemStore) DeleteSession

func (m *MemStore) DeleteSession(_ context.Context, idHash []byte) error

DeleteSession implements operator.Store.

func (*MemStore) FindOperatorTokenByHash

func (m *MemStore) FindOperatorTokenByHash(_ context.Context, hash []byte) (*operator.Token, error)

FindOperatorTokenByHash implements operator.Store.

func (*MemStore) GetOperator

func (m *MemStore) GetOperator(context.Context) (*operator.Operator, error)

GetOperator implements operator.Store.

func (*MemStore) GetSession

func (m *MemStore) GetSession(_ context.Context, idHash []byte) (*operator.Session, error)

GetSession implements operator.Store.

func (*MemStore) ListOperatorTokens

func (m *MemStore) ListOperatorTokens(context.Context) ([]operator.Token, error)

ListOperatorTokens implements operator.Store.

func (*MemStore) RecordOperatorTokenUse

func (m *MemStore) RecordOperatorTokenUse(_ context.Context, id uuid.UUID, now time.Time) error

RecordOperatorTokenUse implements operator.Store.

func (*MemStore) RevokeOperatorToken

func (m *MemStore) RevokeOperatorToken(_ context.Context, id uuid.UUID, now time.Time) error

RevokeOperatorToken implements operator.Store.

func (*MemStore) SessionCount

func (m *MemStore) SessionCount() int

SessionCount reports how many sessions are stored.

func (*MemStore) SetOperator

func (m *MemStore) SetOperator(_ context.Context, op operator.Operator) error

SetOperator implements operator.Store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL