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 ¶ added in v1.4.5
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 ¶ added in v1.4.5
ListRecvStreamerOf implements a grpc.ClientStream that mocks the reception of a list of messages and then EOFs.
func (ListRecvStreamerOf[MsgType]) CloseSend ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) CloseSend() error
func (ListRecvStreamerOf[MsgType]) Context ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) Context() context.Context
func (ListRecvStreamerOf[MsgType]) Header ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) Header() (metadata.MD, error)
func (*ListRecvStreamerOf[MsgType]) Recv ¶ added in v1.4.5
func (l *ListRecvStreamerOf[MsgType]) Recv() (req MsgType, err error)
func (ListRecvStreamerOf[MsgType]) RecvMsg ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) RecvMsg(_ interface{}) error
func (ListRecvStreamerOf[MsgType]) SendMsg ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) SendMsg(_ interface{}) error
func (ListRecvStreamerOf[MsgType]) Trailer ¶ added in v1.4.5
func (ListRecvStreamerOf[MsgType]) Trailer() metadata.MD
type StorageWithError ¶ added in v1.4.5
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) Count ¶ added in v1.4.5
func (s *StorageWithError) Count(_ any, _ ...any) (int64, error)
func (*StorageWithError) Create ¶ added in v1.4.5
func (s *StorageWithError) Create(_ any) error
func (*StorageWithError) Delete ¶ added in v1.4.5
func (s *StorageWithError) Delete(_ any, _ ...any) error
func (*StorageWithError) Get ¶ added in v1.4.5
func (s *StorageWithError) Get(_ any, _ ...any) error
func (*StorageWithError) Raw ¶ added in v1.7.4
func (s *StorageWithError) Raw(_ any, _ string, _ ...any) error
Click to show internal directories.
Click to hide internal directories.