Documentation ¶
Index ¶
- func AuthClientConfig(port uint16) *clientcredentials.Config
- func AuthURL(port uint16) string
- func JWKSURL(port uint16) string
- func NewInMemoryStorage(t *testing.T, funcs ...func(s persistence.Storage)) (s persistence.Storage)
- func StartAuthenticationServer() (srv *oauth2.AuthorizationServer, port uint16, err error)
- func TokenURL(port uint16) string
- type ListRecvStreamerOf
- func (ListRecvStreamerOf[MsgType]) CloseSend() error
- func (ListRecvStreamerOf[MsgType]) Context() context.Context
- func (ListRecvStreamerOf[MsgType]) Header() (metadata.MD, error)
- func (l *ListRecvStreamerOf[MsgType]) Recv() (req MsgType, err error)
- func (ListRecvStreamerOf[MsgType]) RecvMsg(_ interface{}) error
- func (ListRecvStreamerOf[MsgType]) SendMsg(_ interface{}) error
- func (ListRecvStreamerOf[MsgType]) Trailer() metadata.MD
- type StorageWithError
- func (s *StorageWithError) Count(_ any, _ ...any) (int64, error)
- func (s *StorageWithError) Create(_ any) error
- func (s *StorageWithError) Delete(_ any, _ ...any) error
- func (s *StorageWithError) Get(_ any, _ ...any) error
- func (s *StorageWithError) List(_ any, _ string, _ bool, _ int, _ int, _ ...any) error
- func (s *StorageWithError) Raw(_ any, _ string, _ ...any) error
- func (s *StorageWithError) Save(_ any, _ ...any) error
- func (*StorageWithError) Update(_ any, _ ...any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthClientConfig ¶
func AuthClientConfig(port uint16) *clientcredentials.Config
func NewInMemoryStorage ¶
func NewInMemoryStorage(t *testing.T, funcs ...func(s persistence.Storage)) (s persistence.Storage)
NewInMemoryStorage uses the inmemory package to create a new in-memory storage that can be used for unit testing. The funcs varargs can be used to immediately execute storage operations on it.
func StartAuthenticationServer ¶
func StartAuthenticationServer() (srv *oauth2.AuthorizationServer, port uint16, err error)
StartAuthenticationServer starts an authentication server on a random port with users and clients specified in the TestAuthUser and TestAuthClientID constants.
Types ¶
type ListRecvStreamerOf ¶
ListRecvStreamerOf implements a grpc.ClientStream that mocks the reception of a list of messages and then EOFs.
func (ListRecvStreamerOf[MsgType]) CloseSend ¶
func (ListRecvStreamerOf[MsgType]) CloseSend() error
func (ListRecvStreamerOf[MsgType]) Context ¶
func (ListRecvStreamerOf[MsgType]) Context() context.Context
func (ListRecvStreamerOf[MsgType]) Header ¶
func (ListRecvStreamerOf[MsgType]) Header() (metadata.MD, error)
func (*ListRecvStreamerOf[MsgType]) Recv ¶
func (l *ListRecvStreamerOf[MsgType]) Recv() (req MsgType, err error)
func (ListRecvStreamerOf[MsgType]) RecvMsg ¶
func (ListRecvStreamerOf[MsgType]) RecvMsg(_ interface{}) error
func (ListRecvStreamerOf[MsgType]) SendMsg ¶
func (ListRecvStreamerOf[MsgType]) SendMsg(_ interface{}) error
func (ListRecvStreamerOf[MsgType]) Trailer ¶
func (ListRecvStreamerOf[MsgType]) Trailer() metadata.MD
type StorageWithError ¶
type StorageWithError struct { CreateErr error SaveErr error UpdateErr error GetErr error ListErr error RawErr error CountRes int64 CountErr error DeleteErr error }
StorageWithError can be used to introduce various errors in a storage operation during unit testing.
func (*StorageWithError) Create ¶
func (s *StorageWithError) Create(_ any) error
Directories ¶
Path | Synopsis |
---|---|
Package assert contains helpful assertion helpers.
|
Package assert contains helpful assertion helpers. |
Click to show internal directories.
Click to hide internal directories.