controller

package
v0.0.0-...-2a6e696 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: AGPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meeting

type Meeting interface {
	// TakeWithError Get the information of the specified meeting. If the meetingID is not found, it will also return an error
	TakeWithError(ctx context.Context, meetingID string) (meeting *model.MeetingInfo, err error) //1
	// Create Insert multiple external guarantees that the meetingID is not repeated and does not exist in the storage
	Create(ctx context.Context, meetings []*model.MeetingInfo) (err error) //1
	Update(ctx context.Context, meetingID string, updateData map[string]any) (err error)
	Delete(ctx context.Context, meetingID string) (err error)
	FindByStatus(ctx context.Context, status []string, userID string) ([]*model.MeetingInfo, error)
	GenerateMeetingID(ctx context.Context) (string, error)
}

func NewMeeting

func NewMeeting(meetingDB database.Meeting, cache cache.Meeting, tx tx.Tx) Meeting

type MeetingStorageManager

type MeetingStorageManager struct {
	// contains filtered or unexported fields
}

func (*MeetingStorageManager) Create

func (u *MeetingStorageManager) Create(ctx context.Context, meetings []*model.MeetingInfo) (err error)

Create Insert multiple external guarantees that the userID is not repeated and does not exist in the storage.

func (*MeetingStorageManager) Delete

func (u *MeetingStorageManager) Delete(ctx context.Context, meetingID string) (err error)

func (*MeetingStorageManager) FindByStatus

func (u *MeetingStorageManager) FindByStatus(ctx context.Context, status []string, userID string) ([]*model.MeetingInfo, error)

func (*MeetingStorageManager) GenerateMeetingID

func (u *MeetingStorageManager) GenerateMeetingID(ctx context.Context) (string, error)

func (*MeetingStorageManager) TakeWithError

func (u *MeetingStorageManager) TakeWithError(ctx context.Context, meetingID string) (meeting *model.MeetingInfo, err error)

TakeWithError Get the information of the specified user and return an error if the userID is not found.

func (*MeetingStorageManager) Update

func (u *MeetingStorageManager) Update(ctx context.Context, meetingID string, updateData map[string]any) (err error)

type User

type User interface {
	// FindWithError Get the information of the specified user. If the userID is not found, it will also return an error
	FindWithError(ctx context.Context, userIDs []string) (users []*model.User, err error) //1
	// Create Insert multiple external guarantees that the userID is not repeated and does not exist in the storage
	Create(ctx context.Context, users []*model.User) (err error) //1
	// GetByAccount Get user by account
	GetByAccount(ctx context.Context, account string) (*model.User, error)

	// StoreToken cache in storage
	StoreToken(ctx context.Context, userID, userToken string) error

	// GetToken get cache from storage
	GetToken(ctx context.Context, userID string) (string, error)

	// ClearUserToken clear cache from storage
	ClearUserToken(ctx context.Context, userID string) error

	// GenerateUserID generate a unique user id
	GenerateUserID(ctx context.Context) (string, error)
}

func NewUser

func NewUser(userDB database.User, cache cache.User, tx tx.Tx) User

type UserStorageManager

type UserStorageManager struct {
	// contains filtered or unexported fields
}

func (*UserStorageManager) ClearUserToken

func (u *UserStorageManager) ClearUserToken(ctx context.Context, userID string) error

func (*UserStorageManager) Create

func (u *UserStorageManager) Create(ctx context.Context, users []*model.User) (err error)

Create Insert multiple external guarantees that the userID is not repeated and does not exist in the storage.

func (*UserStorageManager) FindWithError

func (u *UserStorageManager) FindWithError(ctx context.Context, userIDs []string) (users []*model.User, err error)

FindWithError Get the information of the specified user and return an error if the userID is not found.

func (*UserStorageManager) GenerateUserID

func (u *UserStorageManager) GenerateUserID(ctx context.Context) (string, error)

func (*UserStorageManager) GetByAccount

func (u *UserStorageManager) GetByAccount(ctx context.Context, account string) (user *model.User, err error)

func (*UserStorageManager) GetToken

func (u *UserStorageManager) GetToken(ctx context.Context, userID string) (string, error)

func (*UserStorageManager) StoreToken

func (u *UserStorageManager) StoreToken(ctx context.Context, userID, userToken string) error

Jump to

Keyboard shortcuts

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