inmemorydb

package
v0.0.0-...-df8c4e2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() database.Repository

Types

type IMGroup

type IMGroup struct {
	Group   entity.Group              // intentionally not a pointer so assignment makes a copy
	Members []entity.GroupMember      // intentionally not pointers so assignment makes a copy
	Bans    map[int64]entity.GroupBan // intentionally not pointers so assignment makes a copy
}

type IMRoom

type IMRoom struct {
	Room    entity.Room         // intentionally not a pointer so assignment makes a copy
	Members []entity.RoomMember // intentionally not pointers so assignment makes a copy
}

type InMemoryRepository

type InMemoryRepository struct {
	Now func() time.Time
	// contains filtered or unexported fields
}

func (*InMemoryRepository) AddGroup

func (r *InMemoryRepository) AddGroup(_ context.Context, group *entity.Group) (string, error)

func (*InMemoryRepository) AddGroupBan

func (r *InMemoryRepository) AddGroupBan(ctx context.Context, groupID string, attendeeID int64, comments string) error

func (*InMemoryRepository) AddGroupMembership

func (r *InMemoryRepository) AddGroupMembership(ctx context.Context, gm *entity.GroupMember) error

func (*InMemoryRepository) AddRoom

func (r *InMemoryRepository) AddRoom(ctx context.Context, room *entity.Room) (string, error)

func (*InMemoryRepository) AddRoomMembership

func (r *InMemoryRepository) AddRoomMembership(ctx context.Context, rm *entity.RoomMember) error

func (*InMemoryRepository) Close

func (r *InMemoryRepository) Close(_ context.Context)

func (*InMemoryRepository) DeleteGroupByID

func (r *InMemoryRepository) DeleteGroupByID(_ context.Context, id string) error

func (*InMemoryRepository) DeleteGroupMembership

func (r *InMemoryRepository) DeleteGroupMembership(ctx context.Context, attendeeID int64) error

func (*InMemoryRepository) DeleteRoomByID

func (r *InMemoryRepository) DeleteRoomByID(ctx context.Context, id string) error

func (*InMemoryRepository) DeleteRoomMembership

func (r *InMemoryRepository) DeleteRoomMembership(ctx context.Context, attendeeID int64) error

func (*InMemoryRepository) FindGroups

func (r *InMemoryRepository) FindGroups(_ context.Context, name string, minOccupancy uint, maxOccupancy int, anyOfMemberID []int64) ([]string, error)

func (*InMemoryRepository) FindRooms

func (r *InMemoryRepository) FindRooms(ctx context.Context, name string, minOccupancy uint, maxOccupancy int, minSize uint, maxSize uint, anyOfMemberID []int64) ([]string, error)

func (*InMemoryRepository) GetGroupByID

func (r *InMemoryRepository) GetGroupByID(_ context.Context, id string) (*entity.Group, error)

func (*InMemoryRepository) GetGroupMembersByGroupID

func (r *InMemoryRepository) GetGroupMembersByGroupID(_ context.Context, groupID string) ([]*entity.GroupMember, error)

func (*InMemoryRepository) GetGroupMembershipByAttendeeID

func (r *InMemoryRepository) GetGroupMembershipByAttendeeID(_ context.Context, attendeeID int64) (*entity.GroupMember, error)

func (*InMemoryRepository) GetGroups

func (r *InMemoryRepository) GetGroups(_ context.Context) ([]*entity.Group, error)

func (*InMemoryRepository) GetHistoryByID

func (r *InMemoryRepository) GetHistoryByID(_ context.Context, id uint) (*entity.History, error)

GetHistoryByID is only offered for testing, and only on the in memory db.

func (*InMemoryRepository) GetRoomByID

func (r *InMemoryRepository) GetRoomByID(ctx context.Context, id string) (*entity.Room, error)

func (*InMemoryRepository) GetRoomMembersByRoomID

func (r *InMemoryRepository) GetRoomMembersByRoomID(ctx context.Context, roomID string) ([]*entity.RoomMember, error)

func (*InMemoryRepository) GetRoomMembershipByAttendeeID

func (r *InMemoryRepository) GetRoomMembershipByAttendeeID(_ context.Context, attendeeID int64) (*entity.RoomMember, error)

func (*InMemoryRepository) GetRooms

func (r *InMemoryRepository) GetRooms(ctx context.Context) ([]*entity.Room, error)

func (*InMemoryRepository) HasGroupBan

func (r *InMemoryRepository) HasGroupBan(_ context.Context, groupID string, attendeeID int64) (bool, error)

func (*InMemoryRepository) Migrate

func (r *InMemoryRepository) Migrate(_ context.Context) error

func (*InMemoryRepository) NewEmptyGroupMembership

func (r *InMemoryRepository) NewEmptyGroupMembership(_ context.Context, groupID string, attendeeID int64, nickname string) *entity.GroupMember

func (*InMemoryRepository) NewEmptyRoomMembership

func (r *InMemoryRepository) NewEmptyRoomMembership(_ context.Context, roomID string, attendeeID int64) *entity.RoomMember

func (*InMemoryRepository) Open

func (*InMemoryRepository) RecordHistory

func (r *InMemoryRepository) RecordHistory(_ context.Context, h *entity.History) error

func (*InMemoryRepository) RemoveGroupBan

func (r *InMemoryRepository) RemoveGroupBan(ctx context.Context, groupID string, attendeeID int64) error

func (*InMemoryRepository) UpdateGroup

func (r *InMemoryRepository) UpdateGroup(_ context.Context, group *entity.Group) error

func (*InMemoryRepository) UpdateGroupMembership

func (r *InMemoryRepository) UpdateGroupMembership(ctx context.Context, gm *entity.GroupMember) error

func (*InMemoryRepository) UpdateRoom

func (r *InMemoryRepository) UpdateRoom(ctx context.Context, room *entity.Room) error

func (*InMemoryRepository) UpdateRoomMembership

func (r *InMemoryRepository) UpdateRoomMembership(ctx context.Context, rm *entity.RoomMember) error

Jump to

Keyboard shortcuts

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