sql

package
v0.0.0-...-e3cadf0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("not found")
	ErrUserNotCreator = errors.New("the user is not a group creator")
	ErrAlreadyCopied  = errors.New("deck already copied")
	ErrAlreadyShared  = errors.New("deck already shared")
)

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Conn *db.PSQLDatabase
}

func (*Storage) AcceptInvite

func (d *Storage) AcceptInvite(ctx context.Context, id models.UserId, groupId models.GroupId) error

func (*Storage) ChangeGroupName

func (d *Storage) ChangeGroupName(ctx context.Context, creatorId models.UserId, groupId models.GroupId, name string) error

func (*Storage) CheckIfCopied

func (d *Storage) CheckIfCopied(ctx context.Context, copier models.UserId, deckId models.DeckId) (bool, error)

func (*Storage) CheckIfSharedFollowers

func (d *Storage) CheckIfSharedFollowers(ctx context.Context, userId models.UserId, deckId models.DeckId) (bool, error)

func (*Storage) CreateGroup

func (d *Storage) CreateGroup(ctx context.Context, id models.UserId, name string) (models.GroupId, error)

func (*Storage) DeepCopyDeck

func (d *Storage) DeepCopyDeck(ctx context.Context, copier models.UserId, deckId models.DeckId) (models.DeckId, error)

func (*Storage) DeleteDeckFromGroup

func (d *Storage) DeleteDeckFromGroup(ctx context.Context, owner models.UserId, groupId models.GroupId, deckId models.DeckId) error

func (*Storage) DeleteGroup

func (d *Storage) DeleteGroup(ctx context.Context, id models.UserId, groupId models.GroupId) error

func (*Storage) Feed

func (d *Storage) Feed(ctx context.Context, userId models.UserId, page int) (data []models.Post, err error)

func (*Storage) Follow

func (d *Storage) Follow(ctx context.Context, follower models.UserId, author models.UserId) error

func (*Storage) GetCreatedGroupsByUserId

func (d *Storage) GetCreatedGroupsByUserId(ctx context.Context, id models.UserId) ([]models.GroupConfig, error)

func (*Storage) GetDecksByGroupId

func (d *Storage) GetDecksByGroupId(ctx context.Context, id models.GroupId) ([]cardmodels.DeckConfig, error)

func (*Storage) GetFollowersByUserId

func (d *Storage) GetFollowersByUserId(ctx context.Context, id models.UserId) ([]usermodels.UserInfo, error)

func (*Storage) GetFollowersNotJoinedGroup

func (d *Storage) GetFollowersNotJoinedGroup(ctx context.Context, userId models.UserId, groupId models.GroupId) ([]models.GroupsFollowed, error)

func (*Storage) GetFollowingsByUserId

func (d *Storage) GetFollowingsByUserId(ctx context.Context, id models.UserId) ([]usermodels.UserInfo, error)

func (*Storage) GetGroupByGroupId

func (d *Storage) GetGroupByGroupId(ctx context.Context, id models.GroupId) (models.GroupConfig, error)

func (*Storage) GetGroupsByName

func (d *Storage) GetGroupsByName(ctx context.Context, name string) ([]models.GroupConfig, error)

func (*Storage) GetGroupsByUserId

func (d *Storage) GetGroupsByUserId(ctx context.Context, id models.UserId) ([]models.GroupConfig, error)

func (*Storage) GetGroupsDeckShared

func (d *Storage) GetGroupsDeckShared(ctx context.Context, userId models.UserId, deckId models.DeckId) ([]models.GroupsShared, error)

func (*Storage) GetInvitesByGroupId

func (d *Storage) GetInvitesByGroupId(ctx context.Context, id models.GroupId) (map[models.UserId]models.InviteInfo, error)

func (*Storage) GetInvitesByUserId

func (d *Storage) GetInvitesByUserId(ctx context.Context, id models.UserId) (map[models.GroupId]models.InviteInfo, error)

func (*Storage) GetParticipantsByGroupId

func (d *Storage) GetParticipantsByGroupId(ctx context.Context, id models.GroupId) ([]models.UserInfo, error)

func (*Storage) GetUsersByGroupId

func (d *Storage) GetUsersByGroupId(ctx context.Context, id models.GroupId) (models.Members, error)

func (*Storage) GetUsersByName

func (d *Storage) GetUsersByName(ctx context.Context, name string) ([]usermodels.UserInfo, error)

func (*Storage) QuitGroup

func (d *Storage) QuitGroup(ctx context.Context, userId models.UserId, groupId models.GroupId) error

func (*Storage) SendInvite

func (d *Storage) SendInvite(ctx context.Context, creatorId models.UserId, inviteeId models.UserId, groupId models.GroupId) error

func (*Storage) ShareDeckGroup

func (d *Storage) ShareDeckGroup(ctx context.Context, owner models.UserId, groupId models.GroupId, deckId models.DeckId) error

func (*Storage) ShareWithFollowers

func (d *Storage) ShareWithFollowers(ctx context.Context, userId models.UserId, deckId models.DeckId) error

func (*Storage) Unfollow

func (d *Storage) Unfollow(ctx context.Context, follower models.UserId, author models.UserId) error

Jump to

Keyboard shortcuts

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