mocks

package
v0.0.0-...-98550de Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPProducerMock

type AMQPProducerMock struct {
	mock.Mock
}

func (*AMQPProducerMock) Produce

func (m *AMQPProducerMock) Produce(message *proto.MessageDelivery) error

type ContextMock

type ContextMock struct {
	mock.Mock
}

func (*ContextMock) Deadline

func (m *ContextMock) Deadline() (deadline time.Time, ok bool)

func (*ContextMock) Done

func (m *ContextMock) Done() <-chan struct{}

func (*ContextMock) Err

func (m *ContextMock) Err() error

func (*ContextMock) Value

func (m *ContextMock) Value(key any) any

type JWTManagerMock

type JWTManagerMock struct {
	mock.Mock
}

func (*JWTManagerMock) Generate

func (m *JWTManagerMock) Generate(user *model.User) (*model.TokenPair, error)

func (*JWTManagerMock) GetAndVerifyClaims

func (m *JWTManagerMock) GetAndVerifyClaims(ctx context.Context) (*model.UserClaims, error)

func (*JWTManagerMock) NewRefreshToken

func (m *JWTManagerMock) NewRefreshToken(userId uuid.UUID) *model.RefreshToken

func (*JWTManagerMock) Verify

func (m *JWTManagerMock) Verify(accessToken string) (*model.UserClaims, error)

type MessageStoreMock

type MessageStoreMock struct {
	mock.Mock
}

func (*MessageStoreMock) ListMessages

func (m *MessageStoreMock) ListMessages(ctx context.Context, id uuid.UUID, createdAt time.Time, pageSize int) ([]model.Message, error)

func (*MessageStoreMock) ListMessagesFirst

func (m *MessageStoreMock) ListMessagesFirst(ctx context.Context, id uuid.UUID, pageSize int) ([]model.Message, error)

func (*MessageStoreMock) SendMessage

func (m *MessageStoreMock) SendMessage(ctx context.Context, message *model.Message) error

type RefreshTokenStoreMock

type RefreshTokenStoreMock struct {
	mock.Mock
}

func (*RefreshTokenStoreMock) Add

func (*RefreshTokenStoreMock) Delete

func (m *RefreshTokenStoreMock) Delete(ctx context.Context, token uuid.UUID) error

func (*RefreshTokenStoreMock) Get

type RoomStoreMock

type RoomStoreMock struct {
	mock.Mock
}

func (*RoomStoreMock) Add

func (m *RoomStoreMock) Add(ctx context.Context, room *model.Room) error

func (*RoomStoreMock) AddAndSendMessage

func (m *RoomStoreMock) AddAndSendMessage(ctx context.Context, room *model.Room, message *model.Message) (*model.Room, error)

func (*RoomStoreMock) FindByIds

func (m *RoomStoreMock) FindByIds(ctx context.Context, userIds ...uuid.UUID) ([]model.User, error)

func (*RoomStoreMock) FindDialogRoom

func (m *RoomStoreMock) FindDialogRoom(ctx context.Context, userId1, userId2 uuid.UUID) (*model.Room, error)

func (*RoomStoreMock) Get

func (m *RoomStoreMock) Get(ctx context.Context, id uuid.UUID) (*model.Room, error)

func (*RoomStoreMock) ListRooms

func (m *RoomStoreMock) ListRooms(ctx context.Context, userId uuid.UUID, lastMessageDate time.Time, pageSize int) ([]model.Room, error)

func (*RoomStoreMock) ListRoomsFirst

func (m *RoomStoreMock) ListRoomsFirst(ctx context.Context, userId uuid.UUID, pageSize int) ([]model.Room, error)

func (*RoomStoreMock) UsersInRoom

func (m *RoomStoreMock) UsersInRoom(ctx context.Context, id uuid.UUID) ([]uuid.UUID, error)

type ServerStreamMock

type ServerStreamMock struct {
	mock.Mock
}

func (*ServerStreamMock) Context

func (m *ServerStreamMock) Context() context.Context

func (*ServerStreamMock) RecvMsg

func (m *ServerStreamMock) RecvMsg(message interface{}) error

func (*ServerStreamMock) SendHeader

func (m *ServerStreamMock) SendHeader(md metadata.MD) error

func (*ServerStreamMock) SendMsg

func (m *ServerStreamMock) SendMsg(message interface{}) error

func (*ServerStreamMock) SetHeader

func (m *ServerStreamMock) SetHeader(md metadata.MD) error

func (*ServerStreamMock) SetTrailer

func (m *ServerStreamMock) SetTrailer(md metadata.MD)

type UserStoreMock

type UserStoreMock struct {
	mock.Mock
}

func (*UserStoreMock) Find

func (m *UserStoreMock) Find(ctx context.Context, id uuid.UUID) (*model.User, error)

func (*UserStoreMock) FindByUsername

func (m *UserStoreMock) FindByUsername(ctx context.Context, username string) (*model.User, error)

func (*UserStoreMock) Save

func (m *UserStoreMock) Save(ctx context.Context, user *model.User) error

Jump to

Keyboard shortcuts

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