Documentation ¶
Overview ¶
Package models contains tools for working with solve objects stored in different databases like SQLite or Postgres.
Index ¶
- Constants
- Variables
- func GetAccountID(ctx context.Context) int64
- func GetBuiltInRoles() []string
- func GetNow(ctx context.Context) time.Time
- func WithAccountID(ctx context.Context, id int64) context.Context
- func WithNow(ctx context.Context, now time.Time) context.Context
- func WithSync(ctx context.Context) context.Context
- type Account
- type AccountEvent
- func (e AccountEvent) EventID() int64
- func (e AccountEvent) EventKind() EventKind
- func (e AccountEvent) EventTime() time.Time
- func (e AccountEvent) Object() Account
- func (o AccountEvent) ObjectID() int64
- func (e *AccountEvent) SetEventAccountID(accountID int64)
- func (e *AccountEvent) SetEventID(id int64)
- func (e *AccountEvent) SetEventKind(typ EventKind)
- func (e *AccountEvent) SetEventTime(t time.Time)
- func (e *AccountEvent) SetObject(o Account)
- func (o *AccountEvent) SetObjectID(id int64)
- type AccountKind
- type AccountRole
- type AccountRoleEvent
- func (e AccountRoleEvent) EventID() int64
- func (e AccountRoleEvent) EventKind() EventKind
- func (e AccountRoleEvent) EventTime() time.Time
- func (e AccountRoleEvent) Object() AccountRole
- func (o AccountRoleEvent) ObjectID() int64
- func (e *AccountRoleEvent) SetEventAccountID(accountID int64)
- func (e *AccountRoleEvent) SetEventID(id int64)
- func (e *AccountRoleEvent) SetEventKind(typ EventKind)
- func (e *AccountRoleEvent) SetEventTime(t time.Time)
- func (e *AccountRoleEvent) SetObject(o AccountRole)
- func (o *AccountRoleEvent) SetObjectID(id int64)
- type AccountRoleStore
- func (s *AccountRoleStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *AccountRoleStore) Create(ctx context.Context, object TPtr) error
- func (s *AccountRoleStore) DB() *gosql.DB
- func (s *AccountRoleStore) Delete(ctx context.Context, id int64) error
- func (s *AccountRoleStore) Events() db.EventROStore[E]
- func (s *AccountRoleStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *AccountRoleStore) FindByAccount(id int64) ([]AccountRole, error)
- func (s *AccountRoleStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *AccountRoleStore) Get(ctx context.Context, id int64) (T, error)
- func (s *AccountRoleStore) Init(ctx context.Context) error
- func (s *AccountRoleStore) Objects() db.ObjectROStore[T]
- func (s *AccountRoleStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *AccountRoleStore) Sync(ctx context.Context) error
- func (s *AccountRoleStore) TrySync(ctx context.Context) error
- func (s *AccountRoleStore) Update(ctx context.Context, object T) error
- type AccountStore
- func (s *AccountStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *AccountStore) Create(ctx context.Context, object TPtr) error
- func (s *AccountStore) DB() *gosql.DB
- func (s *AccountStore) Delete(ctx context.Context, id int64) error
- func (s *AccountStore) Events() db.EventROStore[E]
- func (s *AccountStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *AccountStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *AccountStore) Get(ctx context.Context, id int64) (T, error)
- func (s *AccountStore) Init(ctx context.Context) error
- func (s *AccountStore) Objects() db.ObjectROStore[T]
- func (s *AccountStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *AccountStore) Sync(ctx context.Context) error
- func (s *AccountStore) TrySync(ctx context.Context) error
- func (s *AccountStore) Update(ctx context.Context, object T) error
- type CachedStore
- type Cloner
- type Compiler
- type CompilerCommandConfig
- type CompilerConfig
- type CompilerEvent
- func (e CompilerEvent) EventID() int64
- func (e CompilerEvent) EventKind() EventKind
- func (e CompilerEvent) EventTime() time.Time
- func (e CompilerEvent) Object() Compiler
- func (o CompilerEvent) ObjectID() int64
- func (e *CompilerEvent) SetEventAccountID(accountID int64)
- func (e *CompilerEvent) SetEventID(id int64)
- func (e *CompilerEvent) SetEventKind(typ EventKind)
- func (e *CompilerEvent) SetEventTime(t time.Time)
- func (e *CompilerEvent) SetObject(o Compiler)
- func (o *CompilerEvent) SetObjectID(id int64)
- type CompilerStore
- func (s *CompilerStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *CompilerStore) Create(ctx context.Context, object TPtr) error
- func (s *CompilerStore) DB() *gosql.DB
- func (s *CompilerStore) Delete(ctx context.Context, id int64) error
- func (s *CompilerStore) Events() db.EventROStore[E]
- func (s *CompilerStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *CompilerStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *CompilerStore) Get(ctx context.Context, id int64) (T, error)
- func (s *CompilerStore) GetByName(name string) (Compiler, error)
- func (s *CompilerStore) Init(ctx context.Context) error
- func (s *CompilerStore) Objects() db.ObjectROStore[T]
- func (s *CompilerStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *CompilerStore) Sync(ctx context.Context) error
- func (s *CompilerStore) TrySync(ctx context.Context) error
- func (s *CompilerStore) Update(ctx context.Context, object T) error
- type ConfirmEmailTokenConfig
- type Contest
- type ContestConfig
- type ContestEvent
- func (e ContestEvent) EventID() int64
- func (e ContestEvent) EventKind() EventKind
- func (e ContestEvent) EventTime() time.Time
- func (e ContestEvent) Object() Contest
- func (o ContestEvent) ObjectID() int64
- func (e *ContestEvent) SetEventAccountID(accountID int64)
- func (e *ContestEvent) SetEventID(id int64)
- func (e *ContestEvent) SetEventKind(typ EventKind)
- func (e *ContestEvent) SetEventTime(t time.Time)
- func (e *ContestEvent) SetObject(o Contest)
- func (o *ContestEvent) SetObjectID(id int64)
- type ContestMessage
- type ContestMessageEvent
- func (e ContestMessageEvent) EventID() int64
- func (e ContestMessageEvent) EventKind() EventKind
- func (e ContestMessageEvent) EventTime() time.Time
- func (e ContestMessageEvent) Object() ContestMessage
- func (o ContestMessageEvent) ObjectID() int64
- func (e *ContestMessageEvent) SetEventAccountID(accountID int64)
- func (e *ContestMessageEvent) SetEventID(id int64)
- func (e *ContestMessageEvent) SetEventKind(typ EventKind)
- func (e *ContestMessageEvent) SetEventTime(t time.Time)
- func (e *ContestMessageEvent) SetObject(o ContestMessage)
- func (o *ContestMessageEvent) SetObjectID(id int64)
- type ContestMessageKind
- type ContestMessageStore
- type ContestParticipant
- type ContestParticipantEvent
- func (e ContestParticipantEvent) EventID() int64
- func (e ContestParticipantEvent) EventKind() EventKind
- func (e ContestParticipantEvent) EventTime() time.Time
- func (e ContestParticipantEvent) Object() ContestParticipant
- func (o ContestParticipantEvent) ObjectID() int64
- func (e *ContestParticipantEvent) SetEventAccountID(accountID int64)
- func (e *ContestParticipantEvent) SetEventID(id int64)
- func (e *ContestParticipantEvent) SetEventKind(typ EventKind)
- func (e *ContestParticipantEvent) SetEventTime(t time.Time)
- func (e *ContestParticipantEvent) SetObject(o ContestParticipant)
- func (o *ContestParticipantEvent) SetObjectID(id int64)
- type ContestParticipantStore
- func (s *ContestParticipantStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestParticipantStore) Create(ctx context.Context, object TPtr) error
- func (s *ContestParticipantStore) DB() *gosql.DB
- func (s *ContestParticipantStore) Delete(ctx context.Context, id int64) error
- func (s *ContestParticipantStore) Events() db.EventROStore[E]
- func (s *ContestParticipantStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ContestParticipantStore) FindByContest(id int64) ([]ContestParticipant, error)
- func (s *ContestParticipantStore) FindByContestAccount(contestID int64, accountID int64) ([]ContestParticipant, error)
- func (s *ContestParticipantStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ContestParticipantStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ContestParticipantStore) Init(ctx context.Context) error
- func (s *ContestParticipantStore) Objects() db.ObjectROStore[T]
- func (s *ContestParticipantStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestParticipantStore) Sync(ctx context.Context) error
- func (s *ContestParticipantStore) TrySync(ctx context.Context) error
- func (s *ContestParticipantStore) Update(ctx context.Context, object T) error
- type ContestProblem
- type ContestProblemConfig
- type ContestProblemEvent
- func (e ContestProblemEvent) EventID() int64
- func (e ContestProblemEvent) EventKind() EventKind
- func (e ContestProblemEvent) EventTime() time.Time
- func (e ContestProblemEvent) Object() ContestProblem
- func (o ContestProblemEvent) ObjectID() int64
- func (e *ContestProblemEvent) SetEventAccountID(accountID int64)
- func (e *ContestProblemEvent) SetEventID(id int64)
- func (e *ContestProblemEvent) SetEventKind(typ EventKind)
- func (e *ContestProblemEvent) SetEventTime(t time.Time)
- func (e *ContestProblemEvent) SetObject(o ContestProblem)
- func (o *ContestProblemEvent) SetObjectID(id int64)
- type ContestProblemStore
- func (s *ContestProblemStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestProblemStore) Create(ctx context.Context, object TPtr) error
- func (s *ContestProblemStore) DB() *gosql.DB
- func (s *ContestProblemStore) Delete(ctx context.Context, id int64) error
- func (s *ContestProblemStore) Events() db.EventROStore[E]
- func (s *ContestProblemStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ContestProblemStore) FindByContest(id int64) ([]ContestProblem, error)
- func (s *ContestProblemStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ContestProblemStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ContestProblemStore) Init(ctx context.Context) error
- func (s *ContestProblemStore) Objects() db.ObjectROStore[T]
- func (s *ContestProblemStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestProblemStore) Sync(ctx context.Context) error
- func (s *ContestProblemStore) TrySync(ctx context.Context) error
- func (s *ContestProblemStore) Update(ctx context.Context, object T) error
- type ContestSolution
- type ContestSolutionEvent
- func (e ContestSolutionEvent) EventID() int64
- func (e ContestSolutionEvent) EventKind() EventKind
- func (e ContestSolutionEvent) EventTime() time.Time
- func (e ContestSolutionEvent) Object() ContestSolution
- func (o ContestSolutionEvent) ObjectID() int64
- func (e *ContestSolutionEvent) SetEventAccountID(accountID int64)
- func (e *ContestSolutionEvent) SetEventID(id int64)
- func (e *ContestSolutionEvent) SetEventKind(typ EventKind)
- func (e *ContestSolutionEvent) SetEventTime(t time.Time)
- func (e *ContestSolutionEvent) SetObject(o ContestSolution)
- func (o *ContestSolutionEvent) SetObjectID(id int64)
- type ContestSolutionStore
- func (s *ContestSolutionStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestSolutionStore) Create(ctx context.Context, object TPtr) error
- func (s *ContestSolutionStore) DB() *gosql.DB
- func (s *ContestSolutionStore) Delete(ctx context.Context, id int64) error
- func (s *ContestSolutionStore) Events() db.EventROStore[E]
- func (s *ContestSolutionStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ContestSolutionStore) FindByContest(ctx context.Context, contestID ...int64) (db.Rows[ContestSolution], error)
- func (s *ContestSolutionStore) FindByParticipant(ctx context.Context, participantID ...int64) (db.Rows[ContestSolution], error)
- func (s *ContestSolutionStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ContestSolutionStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ContestSolutionStore) Init(ctx context.Context) error
- func (s *ContestSolutionStore) Objects() db.ObjectROStore[T]
- func (s *ContestSolutionStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestSolutionStore) Sync(ctx context.Context) error
- func (s *ContestSolutionStore) TrySync(ctx context.Context) error
- func (s *ContestSolutionStore) Update(ctx context.Context, object T) error
- type ContestStore
- func (s *ContestStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestStore) Create(ctx context.Context, object TPtr) error
- func (s *ContestStore) DB() *gosql.DB
- func (s *ContestStore) Delete(ctx context.Context, id int64) error
- func (s *ContestStore) Events() db.EventROStore[E]
- func (s *ContestStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ContestStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ContestStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ContestStore) Init(ctx context.Context) error
- func (s *ContestStore) Objects() db.ObjectROStore[T]
- func (s *ContestStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ContestStore) Sync(ctx context.Context) error
- func (s *ContestStore) TrySync(ctx context.Context) error
- func (s *ContestStore) Update(ctx context.Context, object T) error
- type EventKind
- type ExecuteReport
- type File
- type FileEvent
- func (e FileEvent) EventID() int64
- func (e FileEvent) EventKind() EventKind
- func (e FileEvent) EventTime() time.Time
- func (e FileEvent) Object() File
- func (o FileEvent) ObjectID() int64
- func (e *FileEvent) SetEventAccountID(accountID int64)
- func (e *FileEvent) SetEventID(id int64)
- func (e *FileEvent) SetEventKind(typ EventKind)
- func (e *FileEvent) SetEventTime(t time.Time)
- func (e *FileEvent) SetObject(o File)
- func (o *FileEvent) SetObjectID(id int64)
- type FileMeta
- type FileStatus
- type FileStore
- type JSON
- type JudgeSolutionTaskConfig
- type JudgeSolutionTaskState
- type Lock
- type LockGuard
- type LockStore
- type NInt64
- type NString
- type ObjectEventPtr
- type ObjectPtr
- type Option
- type ParticipantKind
- type Problem
- type ProblemConfig
- type ProblemEvent
- func (e ProblemEvent) EventID() int64
- func (e ProblemEvent) EventKind() EventKind
- func (e ProblemEvent) EventTime() time.Time
- func (e ProblemEvent) Object() Problem
- func (o ProblemEvent) ObjectID() int64
- func (e *ProblemEvent) SetEventAccountID(accountID int64)
- func (e *ProblemEvent) SetEventID(id int64)
- func (e *ProblemEvent) SetEventKind(typ EventKind)
- func (e *ProblemEvent) SetEventTime(t time.Time)
- func (e *ProblemEvent) SetObject(o Problem)
- func (o *ProblemEvent) SetObjectID(id int64)
- type ProblemResource
- type ProblemResourceConfig
- type ProblemResourceEvent
- func (e ProblemResourceEvent) EventID() int64
- func (e ProblemResourceEvent) EventKind() EventKind
- func (e ProblemResourceEvent) EventTime() time.Time
- func (e ProblemResourceEvent) Object() ProblemResource
- func (o ProblemResourceEvent) ObjectID() int64
- func (e *ProblemResourceEvent) SetEventAccountID(accountID int64)
- func (e *ProblemResourceEvent) SetEventID(id int64)
- func (e *ProblemResourceEvent) SetEventKind(typ EventKind)
- func (e *ProblemResourceEvent) SetEventTime(t time.Time)
- func (e *ProblemResourceEvent) SetObject(o ProblemResource)
- func (o *ProblemResourceEvent) SetObjectID(id int64)
- type ProblemResourceKind
- type ProblemResourceStore
- func (s *ProblemResourceStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ProblemResourceStore) Create(ctx context.Context, object TPtr) error
- func (s *ProblemResourceStore) DB() *gosql.DB
- func (s *ProblemResourceStore) Delete(ctx context.Context, id int64) error
- func (s *ProblemResourceStore) Events() db.EventROStore[E]
- func (s *ProblemResourceStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ProblemResourceStore) FindByProblem(ctx context.Context, id int64) ([]ProblemResource, error)
- func (s *ProblemResourceStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ProblemResourceStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ProblemResourceStore) Init(ctx context.Context) error
- func (s *ProblemResourceStore) Objects() db.ObjectROStore[T]
- func (s *ProblemResourceStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ProblemResourceStore) Sync(ctx context.Context) error
- func (s *ProblemResourceStore) TrySync(ctx context.Context) error
- func (s *ProblemResourceStore) Update(ctx context.Context, object T) error
- type ProblemStatementConfig
- type ProblemStatementResourceConfig
- type ProblemStatementSample
- type ProblemStore
- func (s *ProblemStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ProblemStore) Create(ctx context.Context, object TPtr) error
- func (s *ProblemStore) DB() *gosql.DB
- func (s *ProblemStore) Delete(ctx context.Context, id int64) error
- func (s *ProblemStore) Events() db.EventROStore[E]
- func (s *ProblemStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ProblemStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ProblemStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ProblemStore) Init(ctx context.Context) error
- func (s *ProblemStore) Objects() db.ObjectROStore[T]
- func (s *ProblemStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ProblemStore) Sync(ctx context.Context) error
- func (s *ProblemStore) TrySync(ctx context.Context) error
- func (s *ProblemStore) Update(ctx context.Context, object T) error
- type RegularParticipantConfig
- type Role
- type RoleEdge
- type RoleEdgeEvent
- func (e RoleEdgeEvent) EventID() int64
- func (e RoleEdgeEvent) EventKind() EventKind
- func (e RoleEdgeEvent) EventTime() time.Time
- func (e RoleEdgeEvent) Object() RoleEdge
- func (o RoleEdgeEvent) ObjectID() int64
- func (e *RoleEdgeEvent) SetEventAccountID(accountID int64)
- func (e *RoleEdgeEvent) SetEventID(id int64)
- func (e *RoleEdgeEvent) SetEventKind(typ EventKind)
- func (e *RoleEdgeEvent) SetEventTime(t time.Time)
- func (e *RoleEdgeEvent) SetObject(o RoleEdge)
- func (o *RoleEdgeEvent) SetObjectID(id int64)
- type RoleEdgeStore
- func (s *RoleEdgeStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *RoleEdgeStore) Create(ctx context.Context, object TPtr) error
- func (s *RoleEdgeStore) DB() *gosql.DB
- func (s *RoleEdgeStore) Delete(ctx context.Context, id int64) error
- func (s *RoleEdgeStore) Events() db.EventROStore[E]
- func (s *RoleEdgeStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *RoleEdgeStore) FindByRole(id int64) ([]RoleEdge, error)
- func (s *RoleEdgeStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *RoleEdgeStore) Get(ctx context.Context, id int64) (T, error)
- func (s *RoleEdgeStore) Init(ctx context.Context) error
- func (s *RoleEdgeStore) Objects() db.ObjectROStore[T]
- func (s *RoleEdgeStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *RoleEdgeStore) Sync(ctx context.Context) error
- func (s *RoleEdgeStore) TrySync(ctx context.Context) error
- func (s *RoleEdgeStore) Update(ctx context.Context, object T) error
- type RoleEvent
- func (e RoleEvent) EventID() int64
- func (e RoleEvent) EventKind() EventKind
- func (e RoleEvent) EventTime() time.Time
- func (e RoleEvent) Object() Role
- func (o RoleEvent) ObjectID() int64
- func (e *RoleEvent) SetEventAccountID(accountID int64)
- func (e *RoleEvent) SetEventID(id int64)
- func (e *RoleEvent) SetEventKind(typ EventKind)
- func (e *RoleEvent) SetEventTime(t time.Time)
- func (e *RoleEvent) SetObject(o Role)
- func (o *RoleEvent) SetObjectID(id int64)
- type RoleStore
- func (s *RoleStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *RoleStore) Create(ctx context.Context, object TPtr) error
- func (s *RoleStore) DB() *gosql.DB
- func (s *RoleStore) Delete(ctx context.Context, id int64) error
- func (s *RoleStore) Events() db.EventROStore[E]
- func (s *RoleStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *RoleStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *RoleStore) Get(ctx context.Context, id int64) (T, error)
- func (s *RoleStore) GetByName(name string) (Role, error)
- func (s *RoleStore) Init(ctx context.Context) error
- func (s *RoleStore) Objects() db.ObjectROStore[T]
- func (s *RoleStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *RoleStore) Sync(ctx context.Context) error
- func (s *RoleStore) TrySync(ctx context.Context) error
- func (s *RoleStore) Update(ctx context.Context, object T) error
- type Scope
- type ScopeEvent
- func (e ScopeEvent) EventID() int64
- func (e ScopeEvent) EventKind() EventKind
- func (e ScopeEvent) EventTime() time.Time
- func (e ScopeEvent) Object() Scope
- func (o ScopeEvent) ObjectID() int64
- func (e *ScopeEvent) SetEventAccountID(accountID int64)
- func (e *ScopeEvent) SetEventID(id int64)
- func (e *ScopeEvent) SetEventKind(typ EventKind)
- func (e *ScopeEvent) SetEventTime(t time.Time)
- func (e *ScopeEvent) SetObject(o Scope)
- func (o *ScopeEvent) SetObjectID(id int64)
- type ScopeStore
- func (s *ScopeStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ScopeStore) Create(ctx context.Context, object TPtr) error
- func (s *ScopeStore) DB() *gosql.DB
- func (s *ScopeStore) Delete(ctx context.Context, id int64) error
- func (s *ScopeStore) Events() db.EventROStore[E]
- func (s *ScopeStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ScopeStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ScopeStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ScopeStore) GetByAccount(id int64) (Scope, error)
- func (s *ScopeStore) Init(ctx context.Context) error
- func (s *ScopeStore) Objects() db.ObjectROStore[T]
- func (s *ScopeStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ScopeStore) Sync(ctx context.Context) error
- func (s *ScopeStore) TrySync(ctx context.Context) error
- func (s *ScopeStore) Update(ctx context.Context, object T) error
- type ScopeUser
- type ScopeUserEvent
- func (e ScopeUserEvent) EventID() int64
- func (e ScopeUserEvent) EventKind() EventKind
- func (e ScopeUserEvent) EventTime() time.Time
- func (e ScopeUserEvent) Object() ScopeUser
- func (o ScopeUserEvent) ObjectID() int64
- func (e *ScopeUserEvent) SetEventAccountID(accountID int64)
- func (e *ScopeUserEvent) SetEventID(id int64)
- func (e *ScopeUserEvent) SetEventKind(typ EventKind)
- func (e *ScopeUserEvent) SetEventTime(t time.Time)
- func (e *ScopeUserEvent) SetObject(o ScopeUser)
- func (o *ScopeUserEvent) SetObjectID(id int64)
- type ScopeUserStore
- func (s *ScopeUserStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ScopeUserStore) CheckPassword(user ScopeUser, password string) bool
- func (s *ScopeUserStore) Create(ctx context.Context, object TPtr) error
- func (s *ScopeUserStore) DB() *gosql.DB
- func (s *ScopeUserStore) Delete(ctx context.Context, id int64) error
- func (s *ScopeUserStore) Events() db.EventROStore[E]
- func (s *ScopeUserStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *ScopeUserStore) FindByScope(scope int64) ([]ScopeUser, error)
- func (s *ScopeUserStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *ScopeUserStore) Get(ctx context.Context, id int64) (T, error)
- func (s *ScopeUserStore) GetByAccount(id int64) (ScopeUser, error)
- func (s *ScopeUserStore) GetByScopeLogin(scope int64, login string) (ScopeUser, error)
- func (s *ScopeUserStore) Init(ctx context.Context) error
- func (s *ScopeUserStore) Objects() db.ObjectROStore[T]
- func (s *ScopeUserStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *ScopeUserStore) SetPassword(user *ScopeUser, password string) error
- func (s *ScopeUserStore) Sync(ctx context.Context) error
- func (s *ScopeUserStore) TrySync(ctx context.Context) error
- func (s *ScopeUserStore) Update(ctx context.Context, object T) error
- type Session
- type SessionEvent
- func (e SessionEvent) EventID() int64
- func (e SessionEvent) EventKind() EventKind
- func (e SessionEvent) EventTime() time.Time
- func (e SessionEvent) Object() Session
- func (o SessionEvent) ObjectID() int64
- func (e *SessionEvent) SetEventAccountID(accountID int64)
- func (e *SessionEvent) SetEventID(id int64)
- func (e *SessionEvent) SetEventKind(typ EventKind)
- func (e *SessionEvent) SetEventTime(t time.Time)
- func (e *SessionEvent) SetObject(o Session)
- func (o *SessionEvent) SetObjectID(id int64)
- type SessionStore
- func (s *SessionStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SessionStore) Create(ctx context.Context, object TPtr) error
- func (s *SessionStore) DB() *gosql.DB
- func (s *SessionStore) Delete(ctx context.Context, id int64) error
- func (s *SessionStore) Events() db.EventROStore[E]
- func (s *SessionStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *SessionStore) FindByAccount(id int64) ([]Session, error)
- func (s *SessionStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *SessionStore) Get(ctx context.Context, id int64) (T, error)
- func (s *SessionStore) GetByCookie(cookie string) (Session, error)
- func (s *SessionStore) Init(ctx context.Context) error
- func (s *SessionStore) Objects() db.ObjectROStore[T]
- func (s *SessionStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SessionStore) Sync(ctx context.Context) error
- func (s *SessionStore) TrySync(ctx context.Context) error
- func (s *SessionStore) Update(ctx context.Context, object T) error
- type Setting
- type SettingEvent
- func (e SettingEvent) EventID() int64
- func (e SettingEvent) EventKind() EventKind
- func (e SettingEvent) EventTime() time.Time
- func (e SettingEvent) Object() Setting
- func (o SettingEvent) ObjectID() int64
- func (e *SettingEvent) SetEventAccountID(accountID int64)
- func (e *SettingEvent) SetEventID(id int64)
- func (e *SettingEvent) SetEventKind(typ EventKind)
- func (e *SettingEvent) SetEventTime(t time.Time)
- func (e *SettingEvent) SetObject(o Setting)
- func (o *SettingEvent) SetObjectID(id int64)
- type SettingStore
- func (s *SettingStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SettingStore) Create(ctx context.Context, object TPtr) error
- func (s *SettingStore) DB() *gosql.DB
- func (s *SettingStore) Delete(ctx context.Context, id int64) error
- func (s *SettingStore) Events() db.EventROStore[E]
- func (s *SettingStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *SettingStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *SettingStore) Get(ctx context.Context, id int64) (T, error)
- func (s *SettingStore) GetBool(key string) (Option[bool], error)
- func (s *SettingStore) GetByKey(key string) (Setting, error)
- func (s *SettingStore) GetInt64(key string) (Option[int64], error)
- func (s *SettingStore) Init(ctx context.Context) error
- func (s *SettingStore) Objects() db.ObjectROStore[T]
- func (s *SettingStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SettingStore) Sync(ctx context.Context) error
- func (s *SettingStore) TrySync(ctx context.Context) error
- func (s *SettingStore) Update(ctx context.Context, object T) error
- type Solution
- type SolutionEvent
- func (e SolutionEvent) EventID() int64
- func (e SolutionEvent) EventKind() EventKind
- func (e SolutionEvent) EventTime() time.Time
- func (e SolutionEvent) Object() Solution
- func (o SolutionEvent) ObjectID() int64
- func (e *SolutionEvent) SetEventAccountID(accountID int64)
- func (e *SolutionEvent) SetEventID(id int64)
- func (e *SolutionEvent) SetEventKind(typ EventKind)
- func (e *SolutionEvent) SetEventTime(t time.Time)
- func (e *SolutionEvent) SetObject(o Solution)
- func (o *SolutionEvent) SetObjectID(id int64)
- type SolutionReport
- type SolutionStore
- func (s *SolutionStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SolutionStore) Create(ctx context.Context, object TPtr) error
- func (s *SolutionStore) DB() *gosql.DB
- func (s *SolutionStore) Delete(ctx context.Context, id int64) error
- func (s *SolutionStore) Events() db.EventROStore[E]
- func (s *SolutionStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *SolutionStore) FindByProblem(id int64) ([]Solution, error)
- func (s *SolutionStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *SolutionStore) Get(ctx context.Context, id int64) (T, error)
- func (s *SolutionStore) GetEventStore() db.EventStore[SolutionEvent, *SolutionEvent]
- func (s *SolutionStore) Init(ctx context.Context) error
- func (s *SolutionStore) Objects() db.ObjectROStore[T]
- func (s *SolutionStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *SolutionStore) Sync(ctx context.Context) error
- func (s *SolutionStore) TrySync(ctx context.Context) error
- func (s *SolutionStore) Update(ctx context.Context, object T) error
- type StandingsKind
- type Store
- type Task
- type TaskConfig
- type TaskEvent
- func (e TaskEvent) EventID() int64
- func (e TaskEvent) EventKind() EventKind
- func (e TaskEvent) EventTime() time.Time
- func (e TaskEvent) Object() Task
- func (o TaskEvent) ObjectID() int64
- func (e *TaskEvent) SetEventAccountID(accountID int64)
- func (e *TaskEvent) SetEventID(id int64)
- func (e *TaskEvent) SetEventKind(typ EventKind)
- func (e *TaskEvent) SetEventTime(t time.Time)
- func (e *TaskEvent) SetObject(o Task)
- func (o *TaskEvent) SetObjectID(id int64)
- type TaskKind
- type TaskStatus
- type TaskStore
- func (s *TaskStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *TaskStore) Create(ctx context.Context, object TPtr) error
- func (s *TaskStore) DB() *gosql.DB
- func (s *TaskStore) Delete(ctx context.Context, id int64) error
- func (s *TaskStore) Events() db.EventROStore[E]
- func (s *TaskStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *TaskStore) FindByProblem(id int64) ([]Task, error)
- func (s *TaskStore) FindBySolution(id int64) ([]Task, error)
- func (s *TaskStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *TaskStore) Get(ctx context.Context, id int64) (T, error)
- func (s *TaskStore) Init(ctx context.Context) error
- func (s *TaskStore) Objects() db.ObjectROStore[T]
- func (s *TaskStore) PopQueued(ctx context.Context, duration time.Duration, filter func(TaskKind) bool) (Task, error)
- func (s *TaskStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *TaskStore) Sync(ctx context.Context) error
- func (s *TaskStore) TrySync(ctx context.Context) error
- func (s *TaskStore) Update(ctx context.Context, object T) error
- type TestReport
- type Token
- type TokenConfig
- type TokenEvent
- func (e TokenEvent) EventID() int64
- func (e TokenEvent) EventKind() EventKind
- func (e TokenEvent) EventTime() time.Time
- func (e TokenEvent) Object() Token
- func (o TokenEvent) ObjectID() int64
- func (e *TokenEvent) SetEventAccountID(accountID int64)
- func (e *TokenEvent) SetEventID(id int64)
- func (e *TokenEvent) SetEventKind(typ EventKind)
- func (e *TokenEvent) SetEventTime(t time.Time)
- func (e *TokenEvent) SetObject(o Token)
- func (o *TokenEvent) SetObjectID(id int64)
- type TokenKind
- type TokenStore
- func (s *TokenStore) Create(ctx context.Context, object TPtr) error
- func (s *TokenStore) DB() *gosql.DB
- func (s *TokenStore) Delete(ctx context.Context, id int64) error
- func (s *TokenStore) Events() db.EventROStore[E]
- func (s *TokenStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *TokenStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *TokenStore) Get(ctx context.Context, id int64) (T, error)
- func (s *TokenStore) Objects() db.ObjectROStore[T]
- func (s *TokenStore) Update(ctx context.Context, object T) error
- type UpdateProblemPackageTaskConfig
- type UpdateProblemPackageTaskState
- type UsageReport
- type User
- type UserEvent
- func (e UserEvent) EventID() int64
- func (e UserEvent) EventKind() EventKind
- func (e UserEvent) EventTime() time.Time
- func (e UserEvent) Object() User
- func (o UserEvent) ObjectID() int64
- func (e *UserEvent) SetEventAccountID(accountID int64)
- func (e *UserEvent) SetEventID(id int64)
- func (e *UserEvent) SetEventKind(typ EventKind)
- func (e *UserEvent) SetEventTime(t time.Time)
- func (e *UserEvent) SetObject(o User)
- func (o *UserEvent) SetObjectID(id int64)
- type UserStatus
- type UserStore
- func (s *UserStore) All(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *UserStore) CheckPassword(user User, password string) bool
- func (s *UserStore) Create(ctx context.Context, object TPtr) error
- func (s *UserStore) DB() *gosql.DB
- func (s *UserStore) Delete(ctx context.Context, id int64) error
- func (s *UserStore) Events() db.EventROStore[E]
- func (s *UserStore) Find(ctx context.Context, options ...db.FindObjectsOption) (db.Rows[T], error)
- func (s *UserStore) FindOne(ctx context.Context, options ...db.FindObjectsOption) (T, error)
- func (s *UserStore) Get(ctx context.Context, id int64) (T, error)
- func (s *UserStore) GetByAccount(id int64) (User, error)
- func (s *UserStore) GetByLogin(login string) (User, error)
- func (s *UserStore) Init(ctx context.Context) error
- func (s *UserStore) Objects() db.ObjectROStore[T]
- func (s *UserStore) ReverseAll(ctx context.Context, limit int) (db.Rows[T], error)
- func (s *UserStore) SetPassword(user *User, password string) error
- func (s *UserStore) Sync(ctx context.Context) error
- func (s *UserStore) TrySync(ctx context.Context) error
- func (s *UserStore) Update(ctx context.Context, object T) error
- type Verdict
- type Visit
- type VisitStore
Constants ¶
const ( // LoginRole represents name of role for login action. LoginRole = "login" // LogoutRole represents name of role for logout action. LogoutRole = "logout" // RegisterRole represents name of role for register action. RegisterRole = "register" // StatusRole represents name of role for status check. StatusRole = "status" // ObserveSettingsRole represents name of role for observing settings. ObserveSettingsRole = "observe_settings" // CreateSettingRole represents name of role for creating new setting. CreateSettingRole = "create_setting" // UpdateSettingRole represents name of role for updating setting. UpdateSettingRole = "update_setting" // DeleteSettingRole represents name of role for deleting setting. DeleteSettingRole = "delete_setting" // ObserveRolesRole represents name of role for observing roles. ObserveRolesRole = "observe_roles" // CreateRoleRole represents name of role for creating new role. CreateRoleRole = "create_role" // DeleteRoleRole represents name of role for deleting role. DeleteRoleRole = "delete_role" // ObserveRoleRolesRole represents name of role for observing role roles. ObserveRoleRolesRole = "observe_role_roles" // CreateRoleRoleRole represents name of role for creating new role role. CreateRoleRoleRole = "create_role_role" // DeleteRoleRoleRole represents name of role for deleting role role. DeleteRoleRoleRole = "delete_role_role" // ObserveUserRolesRole represents name of role for observing user roles. ObserveUserRolesRole = "observe_user_roles" // CreateUserRoleRole represents name of role for attaching role to user. CreateUserRoleRole = "create_user_role" // DeleteUserRoleRole represents name of role for detaching role from user. DeleteUserRoleRole = "delete_user_role" // ObserveUserRole represents name of role for observing user. ObserveUserRole = "observe_user" // UpdateUserRole represents name of role for updating user. UpdateUserRole = "update_user" // ObserveUserEmailRole represents name of role for observing user email. ObserveUserEmailRole = "observe_user_email" // ObserveUserFirstNameRole represents name of role for observing // user first name. ObserveUserFirstNameRole = "observe_user_first_name" // ObserveUserLastNameRole represents name of role for observing // user last name. ObserveUserLastNameRole = "observe_user_last_name" // ObserveUserMiddleNameRole represents name of role for observing // user middle name. ObserveUserMiddleNameRole = "observe_user_middle_name" // ObserveUserSessionsRole represents name of role for observing // user sessions. ObserveUserSessionsRole = "observe_user_sessions" // UpdateUserPasswordRole represents name of role for updating // user password. UpdateUserPasswordRole = "update_user_password" // UpdateUserEmailRole represents name of role for updating user email. UpdateUserEmailRole = "update_user_email" // UpdateUserFirstNameRole represents name of role for updating // user first name. UpdateUserFirstNameRole = "update_user_first_name" // UpdateUserLastNameRole represents name of role for updating // user last name. UpdateUserLastNameRole = "update_user_last_name" // UpdateUserMiddleNameRole represents name of role for updating // user middle name. UpdateUserMiddleNameRole = "update_user_middle_name" // ObserveSessionRole represents role for observing session. ObserveSessionRole = "observe_session" // DeleteSessionRole represents role for deleting session. DeleteSessionRole = "delete_session" // ObserveProblemsRole represents role for observing problem list. ObserveProblemsRole = "observe_problems" // ObserveProblemRole represents role for observing problem. ObserveProblemRole = "observe_problem" // CreateProblemRole represents role for creating problem. CreateProblemRole = "create_problem" // UpdateProblemRole represents role for updating problem. UpdateProblemRole = "update_problem" // UpdateProblemOwnerRole represents role for updating problem owner. UpdateProblemOwnerRole = "update_problem_owner" // DeleteProblemRole represents role for deleting problem. DeleteProblemRole = "delete_problem" // ObserveCompilersRole represents role for observing compiler list. ObserveCompilersRole = "observe_compilers" // ObserveCompilerRole represents role for observing compiler. ObserveCompilerRole = "observe_compiler" // CreateCompilerRole represents role for creating compiler. CreateCompilerRole = "create_compiler" // UpdateCompilerRole represents role for updating compiler. UpdateCompilerRole = "update_compiler" // DeleteCompilerRole represents role for deleting compiler. DeleteCompilerRole = "delete_compiler" // ObserveSolutionsRole represents role for observing solution list. ObserveSolutionsRole = "observe_solutions" // ObserveSolutionRole represents role for observing solution. ObserveSolutionRole = "observe_solution" // ObserveSolutionReportTestNumber = "observe_solution_report_test_number" // ObserveSolutionReportCheckerLogs = "observe_solution_report_checker_logs" // ObserveContestsRole represents role for observing contest list. ObserveContestsRole = "observe_contests" // ObserveContestRole represents role for observing contest. ObserveContestRole = "observe_contest" // ObserveContestProblemsRole represents role for observing // contest problem list. ObserveContestProblemsRole = "observe_contest_problems" // ObserveContestProblemRole represents role for observing // contest problem. ObserveContestProblemRole = "observe_contest_problem" // CreateContestProblemRole represents role for creating // contest problem. CreateContestProblemRole = "create_contest_problem" // UpdateContestProblemRole represents role for updating // contest problem. UpdateContestProblemRole = "update_contest_problem" // DeleteContestProblemRole represents role for deleting // contest problem. DeleteContestProblemRole = "delete_contest_problem" // ObserveContestParticipantsRole represents role for observing // contest participant list. ObserveContestParticipantsRole = "observe_contest_participants" // ObserveContestParticipantRole represents role for observing // contest participant. ObserveContestParticipantRole = "observe_contest_participant" // CreateContestProblemRole represents role for creating // contest participant. CreateContestParticipantRole = "create_contest_participant" // DeleteContestParticipantRole represents role for deleting // contest participant. DeleteContestParticipantRole = "delete_contest_participant" // ObserveContestSolutionsRole represents role for observing // contest solution list. ObserveContestSolutionsRole = "observe_contest_solutions" // ObserveContestSolutionRole represents role for observing // contest solution. ObserveContestSolutionRole = "observe_contest_solution" // CreateContestSolutionRole represents role for creating // contest solution. CreateContestSolutionRole = "create_contest_solution" // SubmitContestSolutionRole represents role for submitting // contest solution. SubmitContestSolutionRole = "submit_contest_solution" // UpdateContestSolutionRole represents role for updating // contest solution. UpdateContestSolutionRole = "update_contest_solution" // DeleteContestSolutionRole represents role for deleting // contest solution. DeleteContestSolutionRole = "delete_contest_solution" // ObserveContestStandingsRole represents role for observing // contest standings. ObserveContestStandingsRole = "observe_contest_standings" // ObserveContestFullStandingsRole represents role for observing // full contest standings. ObserveContestFullStandingsRole = "observe_contest_full_standings" // ObserveContestMessagesRole represents role for observing // contest messages. ObserveContestMessagesRole = "observe_contest_messages" // ObserveContestMessageRole represents role for observing // contest message. ObserveContestMessageRole = "observe_contest_message" // CreateContestMessageRole represents role for creating // contest message. CreateContestMessageRole = "create_contest_message" // UpdateContestMessageRole represents role for updating // contest message. UpdateContestMessageRole = "update_contest_message" // DeleteContestMessageRole represents role for deleting // contest message. DeleteContestMessageRole = "delete_contest_message" // SubmitContestQuestionRole represents role for submitting // contest question. SubmitContestQuestionRole = "submit_contest_question" // CreateContestRole represents role for creating contest. CreateContestRole = "create_contest" // UpdateContestRole represents role for updating contest. UpdateContestRole = "update_contest" // UpdateContestOwnerRole represents role for updating contest owner. UpdateContestOwnerRole = "update_contest_owner" // DeleteContestRole represents role for deleting contest. DeleteContestRole = "delete_contest" // RegisterContestsRole represents role for register to contests. RegisterContestsRole = "register_contests" // RegisterContestRole represents role for register to contest. RegisterContestRole = "register_contest" // DeregisterContestRole represents role for deregister from contest. DeregisterContestRole = "deregister_contest" // ObserveFileContentRole represents role for observing file content. ObserveFileContentRole = "observe_file_content" // ObserveScopesRole represents role for observing scopes. ObserveScopesRole = "observe_scopes" // ObserveScopeRole represents role for observing scope. ObserveScopeRole = "observe_scope" // CreateScopeRole represents role for creating scope. CreateScopeRole = "create_scope" // UpdateScopeRole represents role for updating scope. UpdateScopeRole = "update_scope" // DeleteScopeRole represents role for deleting scope. DeleteScopeRole = "delete_scope" // ObserveScopeUserRole represents role for observing scope user. ObserveScopeUserRole = "observe_scope_user" // CreateScopeUserRole represents role for creating scope user. CreateScopeUserRole = "create_scope_user" // UpdateScopeUserRole represents role for updating scope user. UpdateScopeUserRole = "update_scope_user" // DeleteScopeUserRole represents role for deleting scope user. DeleteScopeUserRole = "delete_scope_user" // ConsumeTokenRole represents role for consuming token. ConsumeTokenRole = "consume_token_role" )
Variables ¶
var ( ErrLockAcquired = fmt.Errorf("lock already acquired") ErrLockReleased = fmt.Errorf("lock already released") )
Functions ¶
func GetAccountID ¶
GetAccountID returns account ID or zero if there is no account.
func WithAccountID ¶
WithAccountID replaces account ID.
Types ¶
type Account ¶
type Account struct { // Kind contains kind of account. Kind AccountKind `db:"kind"` // contains filtered or unexported fields }
Account represents an account.
func (*Account) SetObjectID ¶
func (o *Account) SetObjectID(id int64)
SetObjectID updates ID of object.
type AccountEvent ¶
type AccountEvent struct { Account // contains filtered or unexported fields }
AccountEvent represents an account event.
func (AccountEvent) EventID ¶
func (e AccountEvent) EventID() int64
EventID returns id of this event.
func (AccountEvent) EventKind ¶
func (e AccountEvent) EventKind() EventKind
EventKind returns type of this event.
func (AccountEvent) ObjectID ¶
func (o AccountEvent) ObjectID() int64
ObjectID returns ID of object.
func (*AccountEvent) SetEventAccountID ¶
func (e *AccountEvent) SetEventAccountID(accountID int64)
func (*AccountEvent) SetEventID ¶
func (e *AccountEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*AccountEvent) SetEventKind ¶
func (e *AccountEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*AccountEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*AccountEvent) SetObject ¶
func (e *AccountEvent) SetObject(o Account)
SetObject sets event account.
func (*AccountEvent) SetObjectID ¶
func (o *AccountEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type AccountKind ¶
type AccountKind int
AccountKind represents kind of account.
const ( // UserAccount represents kind of account for user. UserAccount AccountKind = 1 // ScopeUserAccount represents kind of account for scope user. ScopeUserAccount AccountKind = 2 // ScopeAccount represents kind of account for scope. ScopeAccount AccountKind = 3 )
type AccountRole ¶
type AccountRole struct { // AccountID contains account ID. AccountID int64 `db:"account_id"` // RoleID contains role ID. RoleID int64 `db:"role_id"` // contains filtered or unexported fields }
AccountRole represents a account role.
func (AccountRole) Clone ¶
func (o AccountRole) Clone() AccountRole
Clone creates copy of account role.
func (*AccountRole) SetObjectID ¶
func (o *AccountRole) SetObjectID(id int64)
SetObjectID updates ID of object.
type AccountRoleEvent ¶
type AccountRoleEvent struct { AccountRole // contains filtered or unexported fields }
AccountRoleEvent represents account role event.
func (AccountRoleEvent) EventID ¶
func (e AccountRoleEvent) EventID() int64
EventID returns id of this event.
func (AccountRoleEvent) EventKind ¶
func (e AccountRoleEvent) EventKind() EventKind
EventKind returns type of this event.
func (AccountRoleEvent) Object ¶
func (e AccountRoleEvent) Object() AccountRole
Object returns account role.
func (AccountRoleEvent) ObjectID ¶
func (o AccountRoleEvent) ObjectID() int64
ObjectID returns ID of object.
func (*AccountRoleEvent) SetEventAccountID ¶
func (e *AccountRoleEvent) SetEventAccountID(accountID int64)
func (*AccountRoleEvent) SetEventID ¶
func (e *AccountRoleEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*AccountRoleEvent) SetEventKind ¶
func (e *AccountRoleEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*AccountRoleEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*AccountRoleEvent) SetObject ¶
func (e *AccountRoleEvent) SetObject(o AccountRole)
SetObject sets event account role.
func (*AccountRoleEvent) SetObjectID ¶
func (o *AccountRoleEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type AccountRoleStore ¶
type AccountRoleStore struct {
// contains filtered or unexported fields
}
AccountRoleStore represents store for account roles.
func NewAccountRoleStore ¶
func NewAccountRoleStore( db *gosql.DB, table, eventTable string, ) *AccountRoleStore
NewAccountRoleStore creates a new instance of AccountRoleStore.
func (*AccountRoleStore) Events ¶
func (s *AccountRoleStore) Events() db.EventROStore[E]
func (*AccountRoleStore) Find ¶
func (s *AccountRoleStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*AccountRoleStore) FindByAccount ¶
func (s *AccountRoleStore) FindByAccount(id int64) ([]AccountRole, error)
FindByAccount returns roles by account ID.
func (*AccountRoleStore) FindOne ¶
func (s *AccountRoleStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*AccountRoleStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*AccountRoleStore) Objects ¶
func (s *AccountRoleStore) Objects() db.ObjectROStore[T]
func (*AccountRoleStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type AccountStore ¶
type AccountStore struct {
// contains filtered or unexported fields
}
AccountStore represents store for accounts.
func NewAccountStore ¶
func NewAccountStore( db *gosql.DB, table, eventTable string, ) *AccountStore
NewAccountStore creates a new instance of AccountStore.
func (*AccountStore) Events ¶
func (s *AccountStore) Events() db.EventROStore[E]
func (*AccountStore) Find ¶
func (s *AccountStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*AccountStore) FindOne ¶
func (s *AccountStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*AccountStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*AccountStore) Objects ¶
func (s *AccountStore) Objects() db.ObjectROStore[T]
func (*AccountStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type CachedStore ¶
CachedStore represents cached store.
type Cloner ¶
type Cloner[T any] interface { Clone() T }
Cloner represents object that can be cloned.
type Compiler ¶
type Compiler struct { OwnerID NInt64 `db:"owner_id"` Name string `db:"name"` Config JSON `db:"config"` ImageID int64 `db:"image_id"` // contains filtered or unexported fields }
Compiler represents compiler.
func (Compiler) GetConfig ¶
func (o Compiler) GetConfig() (CompilerConfig, error)
func (*Compiler) SetConfig ¶
func (o *Compiler) SetConfig(config CompilerConfig) error
func (*Compiler) SetObjectID ¶
func (o *Compiler) SetObjectID(id int64)
SetObjectID updates ID of object.
type CompilerCommandConfig ¶
type CompilerConfig ¶
type CompilerConfig struct { Language string `json:"language,omitempty"` Compiler string `json:"compiler,omitempty"` Extensions []string `json:"extensions"` Compile *CompilerCommandConfig `json:"compile,omitempty"` Execute *CompilerCommandConfig `json:"execute,omitempty"` }
type CompilerEvent ¶
type CompilerEvent struct { Compiler // contains filtered or unexported fields }
CompilerEvent represents compiler event.
func (CompilerEvent) EventID ¶
func (e CompilerEvent) EventID() int64
EventID returns id of this event.
func (CompilerEvent) EventKind ¶
func (e CompilerEvent) EventKind() EventKind
EventKind returns type of this event.
func (CompilerEvent) Object ¶
func (e CompilerEvent) Object() Compiler
Object returns event compiler.
func (CompilerEvent) ObjectID ¶
func (o CompilerEvent) ObjectID() int64
ObjectID returns ID of object.
func (*CompilerEvent) SetEventAccountID ¶
func (e *CompilerEvent) SetEventAccountID(accountID int64)
func (*CompilerEvent) SetEventID ¶
func (e *CompilerEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*CompilerEvent) SetEventKind ¶
func (e *CompilerEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*CompilerEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*CompilerEvent) SetObject ¶
func (e *CompilerEvent) SetObject(o Compiler)
SetObject sets event compiler.
func (*CompilerEvent) SetObjectID ¶
func (o *CompilerEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type CompilerStore ¶
type CompilerStore struct {
// contains filtered or unexported fields
}
CompilerStore represents store for compilers.
func NewCompilerStore ¶
func NewCompilerStore(db *gosql.DB, table, eventTable string) *CompilerStore
NewCompilerStore creates a new instance of CompilerStore.
func (*CompilerStore) Events ¶
func (s *CompilerStore) Events() db.EventROStore[E]
func (*CompilerStore) Find ¶
func (s *CompilerStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*CompilerStore) FindOne ¶
func (s *CompilerStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*CompilerStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*CompilerStore) GetByName ¶
func (s *CompilerStore) GetByName(name string) (Compiler, error)
GetByName returns compiler by name.
func (*CompilerStore) Objects ¶
func (s *CompilerStore) Objects() db.ObjectROStore[T]
func (*CompilerStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ConfirmEmailTokenConfig ¶
type ConfirmEmailTokenConfig struct {
Email string `json:"string"`
}
func (ConfirmEmailTokenConfig) TokenKind ¶
func (c ConfirmEmailTokenConfig) TokenKind() TokenKind
type Contest ¶
type Contest struct { OwnerID NInt64 `db:"owner_id"` Config JSON `db:"config"` Title string `db:"title"` // contains filtered or unexported fields }
Contest represents a contest.
func (Contest) GetConfig ¶
func (o Contest) GetConfig() (ContestConfig, error)
func (*Contest) SetConfig ¶
func (o *Contest) SetConfig(config ContestConfig) error
func (*Contest) SetObjectID ¶
func (o *Contest) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestConfig ¶
type ContestConfig struct { BeginTime NInt64 `json:"begin_time,omitempty"` Duration int `json:"duration,omitempty"` EnableRegistration bool `json:"enable_registration"` EnableUpsolving bool `json:"enable_upsolving"` EnableObserving bool `json:"enable_observing,omitempty"` FreezeBeginDuration int `json:"freeze_begin_duration,omitempty"` FreezeEndTime NInt64 `json:"freeze_end_time,omitempty"` StandingsKind StandingsKind `json:"standings_kind,omitempty"` }
type ContestEvent ¶
type ContestEvent struct { Contest // contains filtered or unexported fields }
ContestEvent represents a contest event.
func (ContestEvent) EventID ¶
func (e ContestEvent) EventID() int64
EventID returns id of this event.
func (ContestEvent) EventKind ¶
func (e ContestEvent) EventKind() EventKind
EventKind returns type of this event.
func (ContestEvent) ObjectID ¶
func (o ContestEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ContestEvent) SetEventAccountID ¶
func (e *ContestEvent) SetEventAccountID(accountID int64)
func (*ContestEvent) SetEventID ¶
func (e *ContestEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ContestEvent) SetEventKind ¶
func (e *ContestEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ContestEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ContestEvent) SetObject ¶
func (e *ContestEvent) SetObject(o Contest)
SetObject sets event contest.
func (*ContestEvent) SetObjectID ¶
func (o *ContestEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestMessage ¶
type ContestMessage struct { ContestID int64 `db:"contest_id"` ParticipantID NInt64 `db:"participant_id"` AuthorID int64 `db:"author_id"` Kind ContestMessageKind `db:"kind"` ParentID NInt64 `db:"parent_id"` Title string `db:"title"` Description string `db:"description"` CreateTime int64 `db:"create_time"` ProblemID NInt64 `db:"problem_id"` // contains filtered or unexported fields }
func (ContestMessage) Clone ¶
func (o ContestMessage) Clone() ContestMessage
Clone create copy of contest message.
func (ContestMessage) ObjectID ¶
func (o ContestMessage) ObjectID() int64
ObjectID returns ID of object.
func (*ContestMessage) SetObjectID ¶
func (o *ContestMessage) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestMessageEvent ¶
type ContestMessageEvent struct { ContestMessage // contains filtered or unexported fields }
func (ContestMessageEvent) EventID ¶
func (e ContestMessageEvent) EventID() int64
EventID returns id of this event.
func (ContestMessageEvent) EventKind ¶
func (e ContestMessageEvent) EventKind() EventKind
EventKind returns type of this event.
func (ContestMessageEvent) Object ¶
func (e ContestMessageEvent) Object() ContestMessage
Object returns event contest message.
func (ContestMessageEvent) ObjectID ¶
func (o ContestMessageEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ContestMessageEvent) SetEventAccountID ¶
func (e *ContestMessageEvent) SetEventAccountID(accountID int64)
func (*ContestMessageEvent) SetEventID ¶
func (e *ContestMessageEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ContestMessageEvent) SetEventKind ¶
func (e *ContestMessageEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ContestMessageEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ContestMessageEvent) SetObject ¶
func (e *ContestMessageEvent) SetObject(o ContestMessage)
SetObject sets event contest message.
func (*ContestMessageEvent) SetObjectID ¶
func (o *ContestMessageEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestMessageKind ¶
type ContestMessageKind int
const ( RegularContestMessage ContestMessageKind = 0 QuestionContestMessage ContestMessageKind = 1 AnswerContestMessage ContestMessageKind = 2 )
func (ContestMessageKind) String ¶
func (k ContestMessageKind) String() string
type ContestMessageStore ¶
type ContestMessageStore interface { Store[ContestMessage, ContestMessageEvent] FindByContest(ctx context.Context, contestID int64) (db.Rows[ContestMessage], error) }
func NewCachedContestMessageStore ¶
func NewCachedContestMessageStore( db *gosql.DB, table, eventTable string, ) ContestMessageStore
type ContestParticipant ¶
type ContestParticipant struct { // ContestID contains ID of contest. ContestID int64 `db:"contest_id"` // AccountID contains ID of account. AccountID int64 `db:"account_id"` // Kind contains participant kind. Kind ParticipantKind `db:"kind"` // Config contains participant config. Config JSON `db:"config"` // contains filtered or unexported fields }
ContestParticipant represents participant.
func (ContestParticipant) Clone ¶
func (o ContestParticipant) Clone() ContestParticipant
Clone creates copy of contest participant.
func (ContestParticipant) ObjectID ¶
func (o ContestParticipant) ObjectID() int64
ObjectID returns ID of object.
func (ContestParticipant) ScanConfig ¶
func (o ContestParticipant) ScanConfig(config any) error
func (*ContestParticipant) SetConfig ¶
func (o *ContestParticipant) SetConfig(config any) error
func (*ContestParticipant) SetObjectID ¶
func (o *ContestParticipant) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestParticipantEvent ¶
type ContestParticipantEvent struct { ContestParticipant // contains filtered or unexported fields }
ContestParticipant represents participant event.
func (ContestParticipantEvent) EventID ¶
func (e ContestParticipantEvent) EventID() int64
EventID returns id of this event.
func (ContestParticipantEvent) EventKind ¶
func (e ContestParticipantEvent) EventKind() EventKind
EventKind returns type of this event.
func (ContestParticipantEvent) Object ¶
func (e ContestParticipantEvent) Object() ContestParticipant
Object returns event participant.
func (ContestParticipantEvent) ObjectID ¶
func (o ContestParticipantEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ContestParticipantEvent) SetEventAccountID ¶
func (e *ContestParticipantEvent) SetEventAccountID(accountID int64)
func (*ContestParticipantEvent) SetEventID ¶
func (e *ContestParticipantEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ContestParticipantEvent) SetEventKind ¶
func (e *ContestParticipantEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ContestParticipantEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ContestParticipantEvent) SetObject ¶
func (e *ContestParticipantEvent) SetObject(o ContestParticipant)
SetObject sets event contest participant.
func (*ContestParticipantEvent) SetObjectID ¶
func (o *ContestParticipantEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestParticipantStore ¶
type ContestParticipantStore struct {
// contains filtered or unexported fields
}
ContestParticipantStore represents a participant store.
func NewContestParticipantStore ¶
func NewContestParticipantStore( db *gosql.DB, table, eventTable string, ) *ContestParticipantStore
NewContestParticipantStore creates a new instance of ContestParticipantStore.
func (*ContestParticipantStore) Events ¶
func (s *ContestParticipantStore) Events() db.EventROStore[E]
func (*ContestParticipantStore) Find ¶
func (s *ContestParticipantStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ContestParticipantStore) FindByContest ¶
func (s *ContestParticipantStore) FindByContest( id int64, ) ([]ContestParticipant, error)
func (*ContestParticipantStore) FindByContestAccount ¶
func (s *ContestParticipantStore) FindByContestAccount( contestID int64, accountID int64, ) ([]ContestParticipant, error)
FindByContestAccount returns participants by contest and account.
func (*ContestParticipantStore) FindOne ¶
func (s *ContestParticipantStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ContestParticipantStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ContestParticipantStore) Objects ¶
func (s *ContestParticipantStore) Objects() db.ObjectROStore[T]
func (*ContestParticipantStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ContestProblem ¶
type ContestProblem struct { // ProblemID contains ID of problem. ProblemID int64 `db:"problem_id"` // ContestID contains ID of contest. ContestID int64 `db:"contest_id"` // Code contains code of problem. Code string `db:"code"` // Config contains problem config. Config JSON `db:"config"` // contains filtered or unexported fields }
ContestProblem represents connection for problems.
func (ContestProblem) Clone ¶
func (o ContestProblem) Clone() ContestProblem
Clone creates copy of contest problem.
func (ContestProblem) GetConfig ¶
func (o ContestProblem) GetConfig() (ContestProblemConfig, error)
func (ContestProblem) ObjectID ¶
func (o ContestProblem) ObjectID() int64
ObjectID returns ID of object.
func (*ContestProblem) SetConfig ¶
func (o *ContestProblem) SetConfig(config ContestProblemConfig) error
func (*ContestProblem) SetObjectID ¶
func (o *ContestProblem) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestProblemConfig ¶
type ContestProblemEvent ¶
type ContestProblemEvent struct { ContestProblem // contains filtered or unexported fields }
ContestProblemEvent represents problem event.
func (ContestProblemEvent) EventID ¶
func (e ContestProblemEvent) EventID() int64
EventID returns id of this event.
func (ContestProblemEvent) EventKind ¶
func (e ContestProblemEvent) EventKind() EventKind
EventKind returns type of this event.
func (ContestProblemEvent) Object ¶
func (e ContestProblemEvent) Object() ContestProblem
Object returns event role edge.
func (ContestProblemEvent) ObjectID ¶
func (o ContestProblemEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ContestProblemEvent) SetEventAccountID ¶
func (e *ContestProblemEvent) SetEventAccountID(accountID int64)
func (*ContestProblemEvent) SetEventID ¶
func (e *ContestProblemEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ContestProblemEvent) SetEventKind ¶
func (e *ContestProblemEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ContestProblemEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ContestProblemEvent) SetObject ¶
func (e *ContestProblemEvent) SetObject(o ContestProblem)
SetObject sets event contest problem.
func (*ContestProblemEvent) SetObjectID ¶
func (o *ContestProblemEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestProblemStore ¶
type ContestProblemStore struct {
// contains filtered or unexported fields
}
ContestProblemStore represents a problem store.
func NewContestProblemStore ¶
func NewContestProblemStore( db *gosql.DB, table, eventTable string, ) *ContestProblemStore
NewContestProblemStore creates a new instance of ContestProblemStore.
func (*ContestProblemStore) Events ¶
func (s *ContestProblemStore) Events() db.EventROStore[E]
func (*ContestProblemStore) Find ¶
func (s *ContestProblemStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ContestProblemStore) FindByContest ¶
func (s *ContestProblemStore) FindByContest(id int64) ([]ContestProblem, error)
FindByContest returns problems by parent ID.
func (*ContestProblemStore) FindOne ¶
func (s *ContestProblemStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ContestProblemStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ContestProblemStore) Objects ¶
func (s *ContestProblemStore) Objects() db.ObjectROStore[T]
func (*ContestProblemStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ContestSolution ¶
type ContestSolution struct { // SolutionID contains ID of solution. SolutionID int64 `db:"solution_id"` // ContestID contains ID of contest. ContestID int64 `db:"contest_id"` // ParticipantID contains ID of participant. ParticipantID int64 `db:"participant_id"` // ProblemID contains ID of contest problem. ProblemID int64 `db:"problem_id"` // contains filtered or unexported fields }
ContestSolution represents connection for solutions.
func (ContestSolution) Clone ¶
func (o ContestSolution) Clone() ContestSolution
Clone creates copy of contest solution.
func (ContestSolution) ObjectID ¶
func (o ContestSolution) ObjectID() int64
ObjectID returns ID of object.
func (*ContestSolution) SetObjectID ¶
func (o *ContestSolution) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestSolutionEvent ¶
type ContestSolutionEvent struct { ContestSolution // contains filtered or unexported fields }
ContestSolutionEvent represents solution event.
func (ContestSolutionEvent) EventID ¶
func (e ContestSolutionEvent) EventID() int64
EventID returns id of this event.
func (ContestSolutionEvent) EventKind ¶
func (e ContestSolutionEvent) EventKind() EventKind
EventKind returns type of this event.
func (ContestSolutionEvent) Object ¶
func (e ContestSolutionEvent) Object() ContestSolution
Object returns event role edge.
func (ContestSolutionEvent) ObjectID ¶
func (o ContestSolutionEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ContestSolutionEvent) SetEventAccountID ¶
func (e *ContestSolutionEvent) SetEventAccountID(accountID int64)
func (*ContestSolutionEvent) SetEventID ¶
func (e *ContestSolutionEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ContestSolutionEvent) SetEventKind ¶
func (e *ContestSolutionEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ContestSolutionEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ContestSolutionEvent) SetObject ¶
func (e *ContestSolutionEvent) SetObject(o ContestSolution)
SetObject sets event contest solution.
func (*ContestSolutionEvent) SetObjectID ¶
func (o *ContestSolutionEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ContestSolutionStore ¶
type ContestSolutionStore struct {
// contains filtered or unexported fields
}
ContestSolutionStore represents a solution store.
func NewContestSolutionStore ¶
func NewContestSolutionStore( db *gosql.DB, table, eventTable string, ) *ContestSolutionStore
NewContestSolutionStore creates a new instance of ContestSolutionStore.
func (*ContestSolutionStore) Events ¶
func (s *ContestSolutionStore) Events() db.EventROStore[E]
func (*ContestSolutionStore) Find ¶
func (s *ContestSolutionStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ContestSolutionStore) FindByContest ¶
func (s *ContestSolutionStore) FindByContest( ctx context.Context, contestID ...int64, ) (db.Rows[ContestSolution], error)
FindByContest returns solutions by contest ID.
func (*ContestSolutionStore) FindByParticipant ¶
func (s *ContestSolutionStore) FindByParticipant( ctx context.Context, participantID ...int64, ) (db.Rows[ContestSolution], error)
FindByContest returns solutions by participant ID.
func (*ContestSolutionStore) FindOne ¶
func (s *ContestSolutionStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ContestSolutionStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ContestSolutionStore) Objects ¶
func (s *ContestSolutionStore) Objects() db.ObjectROStore[T]
func (*ContestSolutionStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ContestStore ¶
type ContestStore struct {
// contains filtered or unexported fields
}
ContestStore represents store for contests.
func NewContestStore ¶
func NewContestStore( db *gosql.DB, table, eventTable string, ) *ContestStore
NewContestStore creates a new instance of ContestStore.
func (*ContestStore) Events ¶
func (s *ContestStore) Events() db.EventROStore[E]
func (*ContestStore) Find ¶
func (s *ContestStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ContestStore) FindOne ¶
func (s *ContestStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ContestStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ContestStore) Objects ¶
func (s *ContestStore) Objects() db.ObjectROStore[T]
func (*ContestStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ExecuteReport ¶
type ExecuteReport struct { Usage UsageReport `json:"usage"` Log string `json:"log"` }
type File ¶
type File struct { Status FileStatus `db:"status"` ExpireTime NInt64 `db:"expire_time"` Path string `db:"path"` Meta JSON `db:"meta"` // contains filtered or unexported fields }
File represents a file.
type FileEvent ¶
type FileEvent struct { File // contains filtered or unexported fields }
FileEvent represents a file event.
func (FileEvent) EventKind ¶
func (e FileEvent) EventKind() EventKind
EventKind returns type of this event.
func (*FileEvent) SetEventAccountID ¶
func (e *FileEvent) SetEventAccountID(accountID int64)
func (*FileEvent) SetEventID ¶
func (e *FileEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*FileEvent) SetEventKind ¶
func (e *FileEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*FileEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*FileEvent) SetObjectID ¶
func (o *FileEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type FileStatus ¶
type FileStatus int
const ( PendingFile FileStatus = 0 AvailableFile FileStatus = 1 )
func (FileStatus) String ¶
func (t FileStatus) String() string
String returns string representation.
type FileStore ¶
func NewCachedFileStore ¶
NewCachedFileStore creates a new instance of FileStore.
type JSON ¶
type JSON []byte
JSON represents json value.
func (*JSON) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON.
type JudgeSolutionTaskConfig ¶
type JudgeSolutionTaskConfig struct { SolutionID int64 `json:"solution_id"` EnablePoints bool `json:"enable_points,omitempty"` }
JudgeSolutionTaskConfig represets config for JudgeSolution.
func (JudgeSolutionTaskConfig) TaskKind ¶
func (c JudgeSolutionTaskConfig) TaskKind() TaskKind
type JudgeSolutionTaskState ¶
type LockStore ¶
type LockStore struct {
// contains filtered or unexported fields
}
func (*LockStore) AcquireByName ¶
type NString ¶
type NString string
NString represents nullable string with empty value means null value.
type ObjectEventPtr ¶
type ParticipantKind ¶
type ParticipantKind int
const ( RegularParticipant ParticipantKind = 1 UpsolvingParticipant ParticipantKind = 2 ManagerParticipant ParticipantKind = 3 ObserverParticipant ParticipantKind = 4 )
func (ParticipantKind) MarshalText ¶
func (k ParticipantKind) MarshalText() ([]byte, error)
func (ParticipantKind) String ¶
func (k ParticipantKind) String() string
String returns string representation.
func (*ParticipantKind) UnmarshalText ¶
func (k *ParticipantKind) UnmarshalText(data []byte) error
type Problem ¶
type Problem struct { OwnerID NInt64 `db:"owner_id"` Config JSON `db:"config"` Title string `db:"title"` PackageID NInt64 `db:"package_id"` CompiledID NInt64 `db:"compiled_id"` // contains filtered or unexported fields }
Problem represents a problem.
func (Problem) GetConfig ¶
func (o Problem) GetConfig() (ProblemConfig, error)
func (*Problem) SetConfig ¶
func (o *Problem) SetConfig(config ProblemConfig) error
func (*Problem) SetObjectID ¶
func (o *Problem) SetObjectID(id int64)
SetObjectID updates ID of object.
type ProblemConfig ¶
type ProblemEvent ¶
type ProblemEvent struct { Problem // contains filtered or unexported fields }
ProblemEvent represents a problem event.
func (ProblemEvent) EventID ¶
func (e ProblemEvent) EventID() int64
EventID returns id of this event.
func (ProblemEvent) EventKind ¶
func (e ProblemEvent) EventKind() EventKind
EventKind returns type of this event.
func (ProblemEvent) ObjectID ¶
func (o ProblemEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ProblemEvent) SetEventAccountID ¶
func (e *ProblemEvent) SetEventAccountID(accountID int64)
func (*ProblemEvent) SetEventID ¶
func (e *ProblemEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ProblemEvent) SetEventKind ¶
func (e *ProblemEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ProblemEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ProblemEvent) SetObject ¶
func (e *ProblemEvent) SetObject(o Problem)
SetObject sets event problem.
func (*ProblemEvent) SetObjectID ¶
func (o *ProblemEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ProblemResource ¶
type ProblemResource struct { ProblemID int64 `db:"problem_id"` Kind ProblemResourceKind `db:"kind"` Config JSON `db:"config"` FileID NInt64 `db:"file_id"` // contains filtered or unexported fields }
ProblemResource represents a problem resource.
func (ProblemResource) Clone ¶
func (o ProblemResource) Clone() ProblemResource
Clone creates copy of problem resource.
func (ProblemResource) ObjectID ¶
func (o ProblemResource) ObjectID() int64
ObjectID returns ID of object.
func (ProblemResource) ScanConfig ¶
func (o ProblemResource) ScanConfig(config ProblemResourceConfig) error
func (*ProblemResource) SetConfig ¶
func (o *ProblemResource) SetConfig(config ProblemResourceConfig) error
SetConfig updates kind and config of task.
func (*ProblemResource) SetObjectID ¶
func (o *ProblemResource) SetObjectID(id int64)
SetObjectID updates ID of object.
type ProblemResourceConfig ¶
type ProblemResourceConfig interface {
ProblemResourceKind() ProblemResourceKind
}
type ProblemResourceEvent ¶
type ProblemResourceEvent struct { ProblemResource // contains filtered or unexported fields }
ProblemResourceEvent represents a problem resource event.
func (ProblemResourceEvent) EventID ¶
func (e ProblemResourceEvent) EventID() int64
EventID returns id of this event.
func (ProblemResourceEvent) EventKind ¶
func (e ProblemResourceEvent) EventKind() EventKind
EventKind returns type of this event.
func (ProblemResourceEvent) Object ¶
func (e ProblemResourceEvent) Object() ProblemResource
Object returns event problem resource.
func (ProblemResourceEvent) ObjectID ¶
func (o ProblemResourceEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ProblemResourceEvent) SetEventAccountID ¶
func (e *ProblemResourceEvent) SetEventAccountID(accountID int64)
func (*ProblemResourceEvent) SetEventID ¶
func (e *ProblemResourceEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ProblemResourceEvent) SetEventKind ¶
func (e *ProblemResourceEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ProblemResourceEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ProblemResourceEvent) SetObject ¶
func (e *ProblemResourceEvent) SetObject(o ProblemResource)
SetObject sets event problem resource.
func (*ProblemResourceEvent) SetObjectID ¶
func (o *ProblemResourceEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ProblemResourceKind ¶
type ProblemResourceKind int
const ( ProblemStatement ProblemResourceKind = 1 ProblemStatementResource ProblemResourceKind = 2 )
type ProblemResourceStore ¶
type ProblemResourceStore struct {
// contains filtered or unexported fields
}
ProblemResourceStore represents store for problem resources.
func NewProblemResourceStore ¶
func NewProblemResourceStore( db *gosql.DB, table, eventTable string, ) *ProblemResourceStore
NewProblemResourceStore creates a new instance of ProblemResourceStore.
func (*ProblemResourceStore) Events ¶
func (s *ProblemResourceStore) Events() db.EventROStore[E]
func (*ProblemResourceStore) Find ¶
func (s *ProblemResourceStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ProblemResourceStore) FindByProblem ¶
func (s *ProblemResourceStore) FindByProblem(ctx context.Context, id int64) ([]ProblemResource, error)
func (*ProblemResourceStore) FindOne ¶
func (s *ProblemResourceStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ProblemResourceStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ProblemResourceStore) Objects ¶
func (s *ProblemResourceStore) Objects() db.ObjectROStore[T]
func (*ProblemResourceStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ProblemStatementConfig ¶
type ProblemStatementConfig struct { Locale string `json:"locale"` Title string `json:"title"` Legend string `json:"legend,omitempty"` Input string `json:"input,omitempty"` Output string `json:"output,omitempty"` Notes string `json:"notes,omitempty"` Scoring string `json:"scoring,omitempty"` Interaction string `json:"interaction,omitempty"` // Samples contains problem sample tests. Samples []ProblemStatementSample `json:"samples,omitempty"` }
func (ProblemStatementConfig) ProblemResourceKind ¶
func (c ProblemStatementConfig) ProblemResourceKind() ProblemResourceKind
type ProblemStatementResourceConfig ¶
type ProblemStatementResourceConfig struct { Locale string `json:"locale"` Name string `json:"name"` }
func (ProblemStatementResourceConfig) ProblemResourceKind ¶
func (c ProblemStatementResourceConfig) ProblemResourceKind() ProblemResourceKind
type ProblemStatementSample ¶
type ProblemStore ¶
type ProblemStore struct {
// contains filtered or unexported fields
}
ProblemStore represents store for problems.
func NewProblemStore ¶
func NewProblemStore( db *gosql.DB, table, eventTable string, ) *ProblemStore
NewProblemStore creates a new instance of ProblemStore.
func (*ProblemStore) Events ¶
func (s *ProblemStore) Events() db.EventROStore[E]
func (*ProblemStore) Find ¶
func (s *ProblemStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ProblemStore) FindOne ¶
func (s *ProblemStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ProblemStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ProblemStore) Objects ¶
func (s *ProblemStore) Objects() db.ObjectROStore[T]
func (*ProblemStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type RegularParticipantConfig ¶
type RegularParticipantConfig struct {
BeginTime NInt64 `json:"begin_time,omitempty"`
}
type Role ¶
type Role struct { // Name contains role name. // // Name should be unique for all roles in the events. Name string `db:"name"` // contains filtered or unexported fields }
Role represents a role.
type RoleEdge ¶
type RoleEdge struct { // RoleID contains ID of parent role. RoleID int64 `db:"role_id" json:"role_id"` // ChildID contains ID of child role. ChildID int64 `db:"child_id" json:"child_id"` // contains filtered or unexported fields }
RoleEdge represents connection for roles.
func (*RoleEdge) SetObjectID ¶
func (o *RoleEdge) SetObjectID(id int64)
SetObjectID updates ID of object.
type RoleEdgeEvent ¶
type RoleEdgeEvent struct { RoleEdge // contains filtered or unexported fields }
RoleEdgeEvent represents role edge event.
func (RoleEdgeEvent) EventID ¶
func (e RoleEdgeEvent) EventID() int64
EventID returns id of this event.
func (RoleEdgeEvent) EventKind ¶
func (e RoleEdgeEvent) EventKind() EventKind
EventKind returns type of this event.
func (RoleEdgeEvent) Object ¶
func (e RoleEdgeEvent) Object() RoleEdge
Object returns event role edge.
func (RoleEdgeEvent) ObjectID ¶
func (o RoleEdgeEvent) ObjectID() int64
ObjectID returns ID of object.
func (*RoleEdgeEvent) SetEventAccountID ¶
func (e *RoleEdgeEvent) SetEventAccountID(accountID int64)
func (*RoleEdgeEvent) SetEventID ¶
func (e *RoleEdgeEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*RoleEdgeEvent) SetEventKind ¶
func (e *RoleEdgeEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*RoleEdgeEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*RoleEdgeEvent) SetObject ¶
func (e *RoleEdgeEvent) SetObject(o RoleEdge)
SetObject sets event role edge.
func (*RoleEdgeEvent) SetObjectID ¶
func (o *RoleEdgeEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type RoleEdgeStore ¶
type RoleEdgeStore struct {
// contains filtered or unexported fields
}
RoleEdgeStore represents a role edge store.
func NewRoleEdgeStore ¶
func NewRoleEdgeStore( db *gosql.DB, table, eventTable string, ) *RoleEdgeStore
NewRoleEdgeStore creates a new instance of RoleEdgeStore.
func (*RoleEdgeStore) Events ¶
func (s *RoleEdgeStore) Events() db.EventROStore[E]
func (*RoleEdgeStore) Find ¶
func (s *RoleEdgeStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*RoleEdgeStore) FindByRole ¶
func (s *RoleEdgeStore) FindByRole(id int64) ([]RoleEdge, error)
FindByRole returns edges by parent ID.
func (*RoleEdgeStore) FindOne ¶
func (s *RoleEdgeStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*RoleEdgeStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*RoleEdgeStore) Objects ¶
func (s *RoleEdgeStore) Objects() db.ObjectROStore[T]
func (*RoleEdgeStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type RoleEvent ¶
type RoleEvent struct { Role // contains filtered or unexported fields }
RoleEvent represents role event.
func (RoleEvent) EventKind ¶
func (e RoleEvent) EventKind() EventKind
EventKind returns type of this event.
func (*RoleEvent) SetEventAccountID ¶
func (e *RoleEvent) SetEventAccountID(accountID int64)
func (*RoleEvent) SetEventID ¶
func (e *RoleEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*RoleEvent) SetEventKind ¶
func (e *RoleEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*RoleEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*RoleEvent) SetObjectID ¶
func (o *RoleEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type RoleStore ¶
type RoleStore struct {
// contains filtered or unexported fields
}
RoleStore represents a role store.
func NewRoleStore ¶
NewRoleStore creates a new instance of RoleStore.
func (*RoleStore) Events ¶
func (s *RoleStore) Events() db.EventROStore[E]
func (*RoleStore) Find ¶
func (s *RoleStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*RoleStore) FindOne ¶
func (s *RoleStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*RoleStore) GetByName ¶
GetByName returns role by name.
If there is no role with specified name then sql.ErrNoRows will be returned.
func (*RoleStore) Objects ¶
func (s *RoleStore) Objects() db.ObjectROStore[T]
func (*RoleStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type Scope ¶
type Scope struct { AccountID int64 `db:"account_id"` OwnerID NInt64 `db:"owner_id"` Title string `db:"title"` // contains filtered or unexported fields }
Scope represents a scope for users.
func (Scope) AccountKind ¶
func (o Scope) AccountKind() AccountKind
AccountKind returns ScopeAccount kind.
type ScopeEvent ¶
type ScopeEvent struct { Scope // contains filtered or unexported fields }
ScopeEvent represents an scope event.
func (ScopeEvent) EventKind ¶
func (e ScopeEvent) EventKind() EventKind
EventKind returns type of this event.
func (*ScopeEvent) SetEventAccountID ¶
func (e *ScopeEvent) SetEventAccountID(accountID int64)
func (*ScopeEvent) SetEventID ¶
func (e *ScopeEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ScopeEvent) SetEventKind ¶
func (e *ScopeEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ScopeEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ScopeEvent) SetObjectID ¶
func (o *ScopeEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ScopeStore ¶
type ScopeStore struct {
// contains filtered or unexported fields
}
ScopeStore represents store for scopes.
func NewScopeStore ¶
func NewScopeStore( db *gosql.DB, table, eventTable string, ) *ScopeStore
NewScopeStore creates a new instance of ScopeStore.
func (*ScopeStore) Events ¶
func (s *ScopeStore) Events() db.EventROStore[E]
func (*ScopeStore) Find ¶
func (s *ScopeStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ScopeStore) FindOne ¶
func (s *ScopeStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ScopeStore) GetByAccount ¶
func (s *ScopeStore) GetByAccount(id int64) (Scope, error)
GetByAccount returns scope user by account id.
func (*ScopeStore) Objects ¶
func (s *ScopeStore) Objects() db.ObjectROStore[T]
func (*ScopeStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type ScopeUser ¶
type ScopeUser struct { AccountID int64 `db:"account_id"` ScopeID int64 `db:"scope_id"` Login string `db:"login"` PasswordHash string `db:"password_hash"` PasswordSalt string `db:"password_salt"` Title NString `db:"title"` // contains filtered or unexported fields }
ScopeUser contains common information about scope user.
func (ScopeUser) AccountKind ¶
func (o ScopeUser) AccountKind() AccountKind
AccountKind returns ScopeUserAccount kind.
func (*ScopeUser) SetObjectID ¶
func (o *ScopeUser) SetObjectID(id int64)
SetObjectID updates ID of object.
type ScopeUserEvent ¶
type ScopeUserEvent struct { ScopeUser // contains filtered or unexported fields }
ScopeUserEvent represents an scope user event.
func (ScopeUserEvent) EventID ¶
func (e ScopeUserEvent) EventID() int64
EventID returns id of this event.
func (ScopeUserEvent) EventKind ¶
func (e ScopeUserEvent) EventKind() EventKind
EventKind returns type of this event.
func (ScopeUserEvent) Object ¶
func (e ScopeUserEvent) Object() ScopeUser
Object returns scope user.
func (ScopeUserEvent) ObjectID ¶
func (o ScopeUserEvent) ObjectID() int64
ObjectID returns ID of object.
func (*ScopeUserEvent) SetEventAccountID ¶
func (e *ScopeUserEvent) SetEventAccountID(accountID int64)
func (*ScopeUserEvent) SetEventID ¶
func (e *ScopeUserEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*ScopeUserEvent) SetEventKind ¶
func (e *ScopeUserEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*ScopeUserEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*ScopeUserEvent) SetObject ¶
func (e *ScopeUserEvent) SetObject(o ScopeUser)
SetObject sets event scope user.
func (*ScopeUserEvent) SetObjectID ¶
func (o *ScopeUserEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type ScopeUserStore ¶
type ScopeUserStore struct {
// contains filtered or unexported fields
}
ScopeUserStore represents scope users store.
func NewScopeUserStore ¶
func NewScopeUserStore( db *gosql.DB, table, eventTable, salt string, ) *ScopeUserStore
NewScopeUserStore creates new instance of scope user store.
func (*ScopeUserStore) CheckPassword ¶
func (s *ScopeUserStore) CheckPassword(user ScopeUser, password string) bool
CheckPassword checks that passwords are the same.
func (*ScopeUserStore) Events ¶
func (s *ScopeUserStore) Events() db.EventROStore[E]
func (*ScopeUserStore) Find ¶
func (s *ScopeUserStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*ScopeUserStore) FindByScope ¶
func (s *ScopeUserStore) FindByScope(scope int64) ([]ScopeUser, error)
FindByScope returns scope users by scope.
func (*ScopeUserStore) FindOne ¶
func (s *ScopeUserStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*ScopeUserStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*ScopeUserStore) GetByAccount ¶
func (s *ScopeUserStore) GetByAccount(id int64) (ScopeUser, error)
GetByAccount returns scope user by account id.
func (*ScopeUserStore) GetByScopeLogin ¶
func (s *ScopeUserStore) GetByScopeLogin(scope int64, login string) (ScopeUser, error)
GetByScopeLogin returns scope user by scope and login.
func (*ScopeUserStore) Objects ¶
func (s *ScopeUserStore) Objects() db.ObjectROStore[T]
func (*ScopeUserStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
func (*ScopeUserStore) SetPassword ¶
func (s *ScopeUserStore) SetPassword(user *ScopeUser, password string) error
SetPassword modifies PasswordHash and PasswordSalt fields.
PasswordSalt will be replaced with random 16 byte string and PasswordHash will be calculated using password, salt and global salt.
type Session ¶
type Session struct { // AccountID contains ID of account. AccountID int64 `db:"account_id"` // Secret contains secret string of session. Secret string `db:"secret"` // CreateTime contains time when session was created. CreateTime int64 `db:"create_time"` // ExpireTime contains time when session should be expired. ExpireTime int64 `db:"expire_time"` // RealIP contains real IP of user for created session. RealIP string `db:"real_ip"` // UserAgent contains user agent header for created session. UserAgent string `db:"user_agent"` // contains filtered or unexported fields }
Session represents account session.
func (*Session) GenerateSecret ¶
GenerateSecret generates a new value for session secret.
func (*Session) SetObjectID ¶
func (o *Session) SetObjectID(id int64)
SetObjectID updates ID of object.
type SessionEvent ¶
type SessionEvent struct { Session // contains filtered or unexported fields }
SessionEvent represents session event.
func (SessionEvent) EventID ¶
func (e SessionEvent) EventID() int64
EventID returns id of this event.
func (SessionEvent) EventKind ¶
func (e SessionEvent) EventKind() EventKind
EventKind returns type of this event.
func (SessionEvent) ObjectID ¶
func (o SessionEvent) ObjectID() int64
ObjectID returns ID of object.
func (*SessionEvent) SetEventAccountID ¶
func (e *SessionEvent) SetEventAccountID(accountID int64)
func (*SessionEvent) SetEventID ¶
func (e *SessionEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*SessionEvent) SetEventKind ¶
func (e *SessionEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*SessionEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*SessionEvent) SetObject ¶
func (e *SessionEvent) SetObject(o Session)
SetObject sets event session.
func (*SessionEvent) SetObjectID ¶
func (o *SessionEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
SessionStore represents store for sessions.
func NewSessionStore ¶
func NewSessionStore( db *gosql.DB, table, eventTable string, ) *SessionStore
NewSessionStore creates a new instance of SessionStore.
func (*SessionStore) Events ¶
func (s *SessionStore) Events() db.EventROStore[E]
func (*SessionStore) Find ¶
func (s *SessionStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*SessionStore) FindByAccount ¶
func (s *SessionStore) FindByAccount(id int64) ([]Session, error)
FindByAccount returns sessions by account ID.
func (*SessionStore) FindOne ¶
func (s *SessionStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*SessionStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*SessionStore) GetByCookie ¶
func (s *SessionStore) GetByCookie(cookie string) (Session, error)
GetByCookie returns session for specified cookie value.
func (*SessionStore) Objects ¶
func (s *SessionStore) Objects() db.ObjectROStore[T]
func (*SessionStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type Setting ¶
type Setting struct { Key string `db:"key"` Value string `db:"value"` // contains filtered or unexported fields }
Setting represents setting.
func (*Setting) SetObjectID ¶
func (o *Setting) SetObjectID(id int64)
SetObjectID updates ID of object.
type SettingEvent ¶
type SettingEvent struct { Setting // contains filtered or unexported fields }
SettingEvent represents setting event.
func (SettingEvent) EventID ¶
func (e SettingEvent) EventID() int64
EventID returns id of this event.
func (SettingEvent) EventKind ¶
func (e SettingEvent) EventKind() EventKind
EventKind returns type of this event.
func (SettingEvent) ObjectID ¶
func (o SettingEvent) ObjectID() int64
ObjectID returns ID of object.
func (*SettingEvent) SetEventAccountID ¶
func (e *SettingEvent) SetEventAccountID(accountID int64)
func (*SettingEvent) SetEventID ¶
func (e *SettingEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*SettingEvent) SetEventKind ¶
func (e *SettingEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*SettingEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*SettingEvent) SetObject ¶
func (e *SettingEvent) SetObject(o Setting)
SetObject sets event setting.
func (*SettingEvent) SetObjectID ¶
func (o *SettingEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type SettingStore ¶
type SettingStore struct {
// contains filtered or unexported fields
}
SettingStore represents store for settings.
func NewSettingStore ¶
func NewSettingStore(db *gosql.DB, table, eventTable string) *SettingStore
NewSettingStore creates a new instance of SettingStore.
func (*SettingStore) Events ¶
func (s *SettingStore) Events() db.EventROStore[E]
func (*SettingStore) Find ¶
func (s *SettingStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*SettingStore) FindOne ¶
func (s *SettingStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*SettingStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*SettingStore) GetByKey ¶
func (s *SettingStore) GetByKey(key string) (Setting, error)
GetByKey returns setting by specified key.
func (*SettingStore) Objects ¶
func (s *SettingStore) Objects() db.ObjectROStore[T]
func (*SettingStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type Solution ¶
type Solution struct { ProblemID int64 `db:"problem_id"` CompilerID int64 `db:"compiler_id"` AuthorID int64 `db:"author_id"` Report JSON `db:"report"` CreateTime int64 `db:"create_time"` Content NString `db:"content"` ContentID NInt64 `db:"content_id"` // contains filtered or unexported fields }
Solution represents a solution.
func (Solution) GetReport ¶
func (o Solution) GetReport() (*SolutionReport, error)
GetReport returns solution report.
func (*Solution) SetObjectID ¶
func (o *Solution) SetObjectID(id int64)
SetObjectID updates ID of object.
func (*Solution) SetReport ¶
func (o *Solution) SetReport(report *SolutionReport) error
SetReport sets serialized report to solution.
type SolutionEvent ¶
type SolutionEvent struct { Solution // contains filtered or unexported fields }
SolutionEvent represents a solution event.
func (SolutionEvent) EventID ¶
func (e SolutionEvent) EventID() int64
EventID returns id of this event.
func (SolutionEvent) EventKind ¶
func (e SolutionEvent) EventKind() EventKind
EventKind returns type of this event.
func (SolutionEvent) Object ¶
func (e SolutionEvent) Object() Solution
Object returns event solution.
func (SolutionEvent) ObjectID ¶
func (o SolutionEvent) ObjectID() int64
ObjectID returns ID of object.
func (*SolutionEvent) SetEventAccountID ¶
func (e *SolutionEvent) SetEventAccountID(accountID int64)
func (*SolutionEvent) SetEventID ¶
func (e *SolutionEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*SolutionEvent) SetEventKind ¶
func (e *SolutionEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*SolutionEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*SolutionEvent) SetObject ¶
func (e *SolutionEvent) SetObject(o Solution)
SetObject sets event solution.
func (*SolutionEvent) SetObjectID ¶
func (o *SolutionEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type SolutionReport ¶
type SolutionReport struct { Verdict Verdict `json:"verdict"` Usage UsageReport `json:"usage"` Compiler *ExecuteReport `json:"compiler,omitempty"` Tests []TestReport `json:"tests,omitempty"` Points *float64 `json:"points,omitempty"` }
type SolutionStore ¶
type SolutionStore struct {
// contains filtered or unexported fields
}
SolutionStore represents store for solutions.
func NewSolutionStore ¶
func NewSolutionStore( db *gosql.DB, table, eventTable string, ) *SolutionStore
NewSolutionStore creates a new instance of SolutionStore.
func (*SolutionStore) Events ¶
func (s *SolutionStore) Events() db.EventROStore[E]
func (*SolutionStore) Find ¶
func (s *SolutionStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*SolutionStore) FindByProblem ¶
func (s *SolutionStore) FindByProblem(id int64) ([]Solution, error)
func (*SolutionStore) FindOne ¶
func (s *SolutionStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*SolutionStore) Get ¶
Get returns object by id.
Returns sql.ErrNoRows if object does not exist.
func (*SolutionStore) GetEventStore ¶
func (s *SolutionStore) GetEventStore() db.EventStore[SolutionEvent, *SolutionEvent]
func (*SolutionStore) Objects ¶
func (s *SolutionStore) Objects() db.ObjectROStore[T]
func (*SolutionStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type StandingsKind ¶
type StandingsKind int
const ( DisabledStandings StandingsKind = 0 ICPCStandings StandingsKind = 1 IOIStandings StandingsKind = 2 )
func (StandingsKind) MarshalText ¶
func (v StandingsKind) MarshalText() ([]byte, error)
func (StandingsKind) String ¶
func (v StandingsKind) String() string
func (*StandingsKind) UnmarshalText ¶
func (v *StandingsKind) UnmarshalText(data []byte) error
type Store ¶
type Store[T any, E any] interface { // DB should return database connection for specified store. DB() *gosql.DB Objects() db.ObjectROStore[T] Events() db.EventROStore[E] // Get should return object with speficied ID. Get(context.Context, int64) (T, error) // Create should create object and update `object.ID` on success. Create(context.Context, *T) error // Update should update object fields with specified `object.ID`. Update(context.Context, T) error // Delete should delete object with speficied ID. Delete(context.Context, int64) error }
Store represents store for objects.
type Task ¶
type Task struct { Kind TaskKind `db:"kind"` Config JSON `db:"config"` Status TaskStatus `db:"status"` State JSON `db:"state"` ExpireTime NInt64 `db:"expire_time"` // contains filtered or unexported fields }
Task represents async task.
func (Task) ScanConfig ¶
func (o Task) ScanConfig(config TaskConfig) error
func (*Task) SetConfig ¶
func (o *Task) SetConfig(config TaskConfig) error
SetConfig updates kind and config of task.
type TaskConfig ¶
type TaskConfig interface {
TaskKind() TaskKind
}
type TaskEvent ¶
type TaskEvent struct { Task // contains filtered or unexported fields }
TaskEvent represents task event.
func (TaskEvent) EventKind ¶
func (e TaskEvent) EventKind() EventKind
EventKind returns type of this event.
func (*TaskEvent) SetEventAccountID ¶
func (e *TaskEvent) SetEventAccountID(accountID int64)
func (*TaskEvent) SetEventID ¶
func (e *TaskEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*TaskEvent) SetEventKind ¶
func (e *TaskEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*TaskEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*TaskEvent) SetObjectID ¶
func (o *TaskEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type TaskKind ¶
type TaskKind int
TaskKind represents kind of task.
func (TaskKind) MarshalText ¶
MarshalText marshals kind to text.
type TaskStatus ¶
type TaskStatus int
TaskStatus represents status of task.
const ( // QueuedTask means that task in queue and should be processed. QueuedTask TaskStatus = 0 // RunningTask means that task already in processing. RunningTask TaskStatus = 1 // SucceededTask means that task is processed with success. SucceededTask TaskStatus = 2 // FailedTask means that task is processed with failure. FailedTask TaskStatus = 3 )
func (TaskStatus) MarshalText ¶
func (t TaskStatus) MarshalText() ([]byte, error)
MarshalText marshals status to text.
func (TaskStatus) String ¶
func (t TaskStatus) String() string
String returns string representation.
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
TaskStore represents store for tasks.
func NewTaskStore ¶
NewTaskStore creates a new instance of TaskStore.
func (*TaskStore) Events ¶
func (s *TaskStore) Events() db.EventROStore[E]
func (*TaskStore) Find ¶
func (s *TaskStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*TaskStore) FindBySolution ¶
FindBySolution returns a list of tasks by specified solution.
func (*TaskStore) FindOne ¶
func (s *TaskStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*TaskStore) Objects ¶
func (s *TaskStore) Objects() db.ObjectROStore[T]
func (*TaskStore) PopQueued ¶
func (s *TaskStore) PopQueued( ctx context.Context, duration time.Duration, filter func(TaskKind) bool, ) (Task, error)
PopQueued pops queued action from the events and sets running status.
Note that events is not synchronized after tasks is popped.
func (*TaskStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
type TestReport ¶
type TestReport struct { Verdict Verdict `json:"verdict"` Usage UsageReport `json:"usage"` Checker *ExecuteReport `json:"checker,omitempty"` Interactor *ExecuteReport `json:"interactor,omitempty"` Points *float64 `json:"points,omitempty"` }
type Token ¶
type Token struct { AccountID int64 `db:"account_id"` Secret string `db:"secret"` Kind TokenKind `db:"kind"` Config JSON `db:"config"` CreateTime int64 `db:"create_time"` ExpireTime int64 `db:"expire_time"` // contains filtered or unexported fields }
Token represents a token.
func (*Token) GenerateSecret ¶
GenerateSecret generates a new value for token secret.
func (Token) ScanConfig ¶
func (o Token) ScanConfig(config TokenConfig) error
func (*Token) SetConfig ¶
func (o *Token) SetConfig(config TokenConfig) error
SetConfig updates kind and config of token.
type TokenConfig ¶
type TokenConfig interface {
TokenKind() TokenKind
}
type TokenEvent ¶
type TokenEvent struct { Token // contains filtered or unexported fields }
TokenEvent represents a token event.
func (TokenEvent) EventKind ¶
func (e TokenEvent) EventKind() EventKind
EventKind returns type of this event.
func (*TokenEvent) SetEventAccountID ¶
func (e *TokenEvent) SetEventAccountID(accountID int64)
func (*TokenEvent) SetEventID ¶
func (e *TokenEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*TokenEvent) SetEventKind ¶
func (e *TokenEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*TokenEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*TokenEvent) SetObject ¶
func (e *TokenEvent) SetObject(o Token)
SetObject sets event temporary token.
func (*TokenEvent) SetObjectID ¶
func (o *TokenEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore represents store for tokens.
func NewTokenStore ¶
func NewTokenStore( db *gosql.DB, table, eventTable string, ) *TokenStore
NewTokenStore creates a new instance of TokenStore.
func (*TokenStore) Events ¶
func (s *TokenStore) Events() db.EventROStore[E]
func (*TokenStore) Find ¶
func (s *TokenStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*TokenStore) FindOne ¶
func (s *TokenStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*TokenStore) Objects ¶
func (s *TokenStore) Objects() db.ObjectROStore[T]
type UpdateProblemPackageTaskConfig ¶
type UpdateProblemPackageTaskConfig struct { ProblemID int64 `json:"problem_id"` FileID int64 `json:"file_id"` Compile bool `json:"compile"` }
UpdateProblemPackageTaskConfig represets config for JudgeSolution.
func (UpdateProblemPackageTaskConfig) TaskKind ¶
func (c UpdateProblemPackageTaskConfig) TaskKind() TaskKind
type UpdateProblemPackageTaskState ¶
type UpdateProblemPackageTaskState struct {
Error string `json:"error,omitempty"`
}
type UsageReport ¶
type User ¶
type User struct { AccountID int64 `db:"account_id"` Login string `db:"login"` Status UserStatus `db:"status"` PasswordHash string `db:"password_hash"` PasswordSalt string `db:"password_salt"` Email NString `db:"email"` FirstName NString `db:"first_name"` LastName NString `db:"last_name"` MiddleName NString `db:"middle_name"` // contains filtered or unexported fields }
User contains common information about user.
func (User) AccountKind ¶
func (o User) AccountKind() AccountKind
AccountKind returns UserAccount kind.
type UserEvent ¶
type UserEvent struct { User // contains filtered or unexported fields }
UserEvent represents an user event.
func (UserEvent) EventKind ¶
func (e UserEvent) EventKind() EventKind
EventKind returns type of this event.
func (*UserEvent) SetEventAccountID ¶
func (e *UserEvent) SetEventAccountID(accountID int64)
func (*UserEvent) SetEventID ¶
func (e *UserEvent) SetEventID(id int64)
SetEventID updates id of this event.
func (*UserEvent) SetEventKind ¶
func (e *UserEvent) SetEventKind(typ EventKind)
SetEventKind updates type of this event.
func (*UserEvent) SetEventTime ¶
SetEventTime updates time of this event.
func (*UserEvent) SetObjectID ¶
func (o *UserEvent) SetObjectID(id int64)
SetObjectID updates ID of object.
type UserStatus ¶
type UserStatus int
const ( PendingUser UserStatus = 0 ActiveUser UserStatus = 1 BlockedUser UserStatus = 2 )
func (UserStatus) String ¶
func (t UserStatus) String() string
String returns string representation.
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore represents users store.
func NewUserStore ¶
NewUserStore creates new instance of user store.
func (*UserStore) CheckPassword ¶
CheckPassword checks that passwords are the same.
func (*UserStore) Events ¶
func (s *UserStore) Events() db.EventROStore[E]
func (*UserStore) Find ¶
func (s *UserStore) Find( ctx context.Context, options ...db.FindObjectsOption, ) (db.Rows[T], error)
Find finds objects with specified query.
func (*UserStore) FindOne ¶
func (s *UserStore) FindOne( ctx context.Context, options ...db.FindObjectsOption, ) (T, error)
FindOne finds one object with specified query.
func (*UserStore) GetByAccount ¶
GetByAccount returns user by account id.
func (*UserStore) GetByLogin ¶
GetByLogin returns user by login.
func (*UserStore) Objects ¶
func (s *UserStore) Objects() db.ObjectROStore[T]
func (*UserStore) ReverseAll ¶
ReverseAll returns all objects contained by this store.
func (*UserStore) SetPassword ¶
SetPassword modifies PasswordHash and PasswordSalt fields.
PasswordSalt will be replaced with random 16 byte string and PasswordHash will be calculated using password, salt and global salt.
type Verdict ¶
type Verdict int
const ( // Accepted means that solution is correct. Accepted Verdict = 1 // Rejected means that solutios is rejected. Rejected Verdict = 2 // CompilationError means that solution can not compiled. CompilationError Verdict = 3 // TimeLimitExceeded means that solution uses more time than allowed. TimeLimitExceeded Verdict = 4 // MemoryLimitExceeded means that solution uses more memory than allowed. MemoryLimitExceeded Verdict = 5 // RuntimeError means that solution runs incorrectly. RuntimeError Verdict = 6 // WrongAnswer means that solution is incorrect. WrongAnswer Verdict = 7 // PresentationError means that solution output is incorrect. PresentationError Verdict = 8 // PartiallyAccepted means that solution is partially accepted. PartiallyAccepted Verdict = 9 // Failed means that solution checker is failed. Failed Verdict = 10 )
func (Verdict) MarshalText ¶
func (*Verdict) UnmarshalText ¶
type Visit ¶
type Visit struct { ID int64 `db:"id"` Time int64 `db:"time"` AccountID NInt64 `db:"account_id"` SessionID NInt64 `db:"session_id"` Host string `db:"host"` Protocol string `db:"protocol"` Method string `db:"method"` UserAgent string `db:"user_agent"` Path string `db:"path"` RealIP string `db:"real_ip"` Status int `db:"status"` }
Visit represents user visit.
type VisitStore ¶
type VisitStore struct {
// contains filtered or unexported fields
}
VisitStore represents visit store.
func NewVisitStore ¶
func NewVisitStore(dbConn *gosql.DB, table string) *VisitStore
NewVisitStore creates a new instance of ViewStore.
func (*VisitStore) Create ¶
func (s *VisitStore) Create(ctx context.Context, visit *Visit) error
Create creates a new visit in the events.
func (*VisitStore) MakeFromContext ¶
func (s *VisitStore) MakeFromContext(c echo.Context) Visit
MakeFromContext creates Visit from context.
Source Files ¶
- account.go
- account_role.go
- base.go
- btree_index.go
- cached_store.go
- compiler.go
- contest.go
- contest_message.go
- contest_participant.go
- contest_problem.go
- contest_solution.go
- fields.go
- file.go
- lock.go
- problem.go
- problem_resource.go
- role.go
- role_edge.go
- scope.go
- scope_user.go
- session.go
- setting.go
- solution.go
- task.go
- token.go
- user.go
- visit.go