Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(CreateInitControllersFn, NewController, NewService, NewRepository, InitDispatcher, )
Functions ¶
This section is empty.
Types ¶
type Arg ¶ added in v0.0.12
type Arg struct {
Key string `json:"key"`
Value interface{} `json:"value"`
}
type Controller ¶
type Controller interface {
CreateJudgement(c *gin.Context)
GetJudgements(c *gin.Context)
GetJudgement(c *gin.Context)
CancelJudgement(c *gin.Context)
}
func NewController ¶
func NewController(logger *zap.Logger, s Service) Controller
type DefaultController ¶
type DefaultController struct {
// contains filtered or unexported fields
}
func (*DefaultController) CancelJudgement ¶
func (d *DefaultController) CancelJudgement(c *gin.Context)
func (*DefaultController) CreateJudgement ¶
func (d *DefaultController) CreateJudgement(c *gin.Context)
func (*DefaultController) GetJudgement ¶
func (d *DefaultController) GetJudgement(c *gin.Context)
func (*DefaultController) GetJudgements ¶
func (d *DefaultController) GetJudgements(c *gin.Context)
type Dispatcher ¶ added in v0.0.12
func GetDispatcher ¶ added in v0.0.12
func GetDispatcher() Dispatcher
func InitDispatcher ¶ added in v0.0.12
func InitDispatcher(logger *zap.Logger, pr problems.Repository, sr submissions.Repository, jr Repository, br blueprints.Repository, pgr programs.Repository) Dispatcher
type InitJudgementGroupFn ¶
type InitJudgementGroupFn func(r *gin.RouterGroup)
func CreateInitControllersFn ¶
func CreateInitControllersFn(jc Controller) InitJudgementGroupFn
type Repository ¶
type Repository interface {
GetJudgement(judgementId string) (*models.Judgement, error)
GetJudgementsByAccountId(accountId uint64) ([]*models.Judgement, error)
GetPendingJudgements() ([]*models.Judgement, error)
Create(blueprintId uint64, args map[string]interface{}) (*models.Judgement, error)
Update(judgement *models.Judgement) error
}
func NewRepository ¶
func NewRepository(logger *zap.Logger, db *gorm.DB) Repository
type Service ¶
type Service interface {
GetJudgement(judgementId string) (*models.Judgement, error)
GetJudgements(accountId uint64) ([]*models.Judgement, error)
GetJudgementPrerequisites(blueprintId uint64) (string, error)
CreateJudgement(accountId, blueprintId uint64, args map[string]interface{}) (int, *models.Judgement, error)
UpdateJudgement(judgementId string, status models.JudgeStatus, score float64, msg string) (*models.Judgement, error)
}
func NewService ¶
func NewService( logger *zap.Logger, repository Repository, repository2 blueprints.Repository, dispatcher Dispatcher, ) Service
Click to show internal directories.
Click to hide internal directories.