Documentation
¶
Overview ¶
Package authtest provides an in-memory implementation of auth.AuthStore for use in consumer tests. It is not intended for production use.
Index ¶
- type MemStore
- func (m *MemStore) AddAPIKey(k *auth.Key)
- func (m *MemStore) AddSession(s *auth.Session)
- func (m *MemStore) AddUser(u *auth.User)
- func (m *MemStore) CreateSession(_ context.Context, s *auth.Session) error
- func (m *MemStore) DeleteSession(_ context.Context, tokenHash string) error
- func (m *MemStore) DeleteUserSessions(_ context.Context, userID int64, exceptHash string) error
- func (m *MemStore) GetAPIKeyByHash(_ context.Context, hash string) (*auth.Key, error)
- func (m *MemStore) GetSessionByHash(_ context.Context, tokenHash string) (*auth.Session, error)
- func (m *MemStore) GetUserByID(_ context.Context, id int64) (*auth.User, error)
- func (m *MemStore) UpdateSessionActivity(_ context.Context, tokenHash string, now time.Time) 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 implementation of auth interfaces for testing.
func (*MemStore) AddSession ¶
AddSession adds a session to the store.
func (*MemStore) CreateSession ¶
func (*MemStore) DeleteSession ¶
func (*MemStore) DeleteUserSessions ¶
func (*MemStore) GetAPIKeyByHash ¶
func (*MemStore) GetSessionByHash ¶
func (*MemStore) GetUserByID ¶
Click to show internal directories.
Click to hide internal directories.