inmemorydb

package
v0.0.0-...-6883eea Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 8 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
}

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) 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) DeleteGroupMembership

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

func (*InMemoryRepository) DeleteRoomMembership

func (r *InMemoryRepository) DeleteRoomMembership(ctx context.Context, attendeeID uint) 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 uint) (*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 uint) (*entity.RoomMember, error)

func (*InMemoryRepository) GetRooms

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

func (*InMemoryRepository) Migrate

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

func (*InMemoryRepository) NewEmptyGroupMembership

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

func (*InMemoryRepository) NewEmptyRoomMembership

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

func (*InMemoryRepository) Open

func (*InMemoryRepository) RecordHistory

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

func (*InMemoryRepository) SoftDeleteGroupByID

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

func (*InMemoryRepository) SoftDeleteRoomByID

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

func (*InMemoryRepository) UndeleteGroupByID

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

func (*InMemoryRepository) UndeleteRoomByID

func (r *InMemoryRepository) UndeleteRoomByID(ctx context.Context, id string) 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