Documentation
¶
Index ¶
- Variables
- type Assignment
- type AssignmentRepoData
- func (asr *AssignmentRepoData) AddAssignment(ctx context.Context, as Assignment) error
- func (asr AssignmentRepoData) Close(ctx context.Context) error
- func (asr *AssignmentRepoData) DeleteAssignment(ctx context.Context, uid uuid.UUID) error
- func (asr AssignmentRepoData) GetAllChats(ctx context.Context) ([]int64, error)
- func (asr *AssignmentRepoData) GetAssignmentByDate(ctx context.Context, date time.Time, chatID int64) (Assignment, error)
- func (asr *AssignmentRepoData) GetAssignmentSchedule(ctx context.Context, due time.Time, chatID int64) ([]Assignment, error)
- func (asr *AssignmentRepoData) GetAssignmentScheduleAllChats(ctx context.Context, due time.Time) ([]Assignment, error)
- func (asr *AssignmentRepoData) GetFreeSlots(ctx context.Context, due time.Time, chatID int64) ([]time.Time, error)
- type AssignmentRepoer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotInserted = errors.New("pgx CommandTag is not INSERT") ErrNotDeleted = errors.New("pgx CommandTag is not DELETE") )
errors
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type AssignmentRepoData ¶
type AssignmentRepoData struct {
// contains filtered or unexported fields
}
func (*AssignmentRepoData) AddAssignment ¶
func (asr *AssignmentRepoData) AddAssignment(ctx context.Context, as Assignment) error
func (*AssignmentRepoData) DeleteAssignment ¶
func (AssignmentRepoData) GetAllChats ¶
func (asr AssignmentRepoData) GetAllChats(ctx context.Context) ([]int64, error)
func (*AssignmentRepoData) GetAssignmentByDate ¶
func (asr *AssignmentRepoData) GetAssignmentByDate( ctx context.Context, date time.Time, chatID int64, ) (Assignment, error)
func (*AssignmentRepoData) GetAssignmentSchedule ¶
func (asr *AssignmentRepoData) GetAssignmentSchedule( ctx context.Context, due time.Time, chatID int64, ) ([]Assignment, error)
Return assignments due specified date and for specified chat
func (*AssignmentRepoData) GetAssignmentScheduleAllChats ¶
func (asr *AssignmentRepoData) GetAssignmentScheduleAllChats( ctx context.Context, due time.Time, ) ([]Assignment, error)
Get assignments for all chats due specified date
type AssignmentRepoer ¶
type AssignmentRepoer interface {
AddAssignment(ctx context.Context, as Assignment) error
DeleteAssignment(ctx context.Context, id uuid.UUID) error
GetAssignmentSchedule(ctx context.Context, due time.Time, chatID int64) ([]Assignment, error)
GetAssignmentScheduleAllChats(ctx context.Context, due time.Time) ([]Assignment, error)
GetAssignmentByDate(ctx context.Context, due time.Time, chatID int64) (Assignment, error)
GetFreeSlots(ctx context.Context, due time.Time, chatID int64) ([]time.Time, error)
GetAllChats(ctx context.Context) ([]int64, error)
Close(ctx context.Context) error
}
var AssignmentRepo AssignmentRepoer
func InitAssignmentRepo ¶
func InitAssignmentRepo(ctx context.Context, dsn string) (AssignmentRepoer, error)
Click to show internal directories.
Click to hide internal directories.