judgements

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

type Dispatcher interface {
	PushJudgement(judgement *models.Judgement)
}

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

Jump to

Keyboard shortcuts

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