repositories

package
v0.0.0-...-226c3a4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type JudgementElement

type JudgementElement struct {
	Idle        bool
	JudgementId string
	Type        string
	Properties  map[string]string

	Inputs  [][]byte
	Outputs [][]byte
	// contains filtered or unexported fields
}

type JudgementsRepository

type JudgementsRepository interface {
	List()
	Fetch() *models.Judgement
	Create(tp string, properties map[string]string, inputs [][]byte) (*models.Judgement, error)
	Update(judgement *models.Judgement) error

	WrapJudgement(judgement *models.Judgement) (*JudgementElement, error)
	PutJudgementInQueue(element *JudgementElement)
	FetchJudgementInQueue(tp string) *JudgementElement
	ReturnJudgementInQueue(element *JudgementElement, outputs [][]byte) error
}

func CreateJudgementsRepository

func CreateJudgementsRepository(f string) (JudgementsRepository, error)

func NewMysqlJudgementsRepository

func NewMysqlJudgementsRepository(logger *zap.Logger, db *gorm.DB) JudgementsRepository

type MysqlJudgementsRepository

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

func (MysqlJudgementsRepository) Create

func (m MysqlJudgementsRepository) Create(tp string, properties map[string]string, inputs [][]byte) (*models.Judgement, error)

func (MysqlJudgementsRepository) Fetch

func (MysqlJudgementsRepository) FetchJudgementInQueue

func (m MysqlJudgementsRepository) FetchJudgementInQueue(taskType string) *JudgementElement

FetchJudgementInQueue returns task with specific task type.

func (MysqlJudgementsRepository) List

func (m MysqlJudgementsRepository) List()

func (MysqlJudgementsRepository) PutJudgementInQueue

func (m MysqlJudgementsRepository) PutJudgementInQueue(judgementElement *JudgementElement)

func (MysqlJudgementsRepository) ReturnJudgementInQueue

func (m MysqlJudgementsRepository) ReturnJudgementInQueue(element *JudgementElement, outputs [][]byte) error

func (MysqlJudgementsRepository) Update

func (m MysqlJudgementsRepository) Update(judgement *models.Judgement) error

func (MysqlJudgementsRepository) WrapJudgement

func (m MysqlJudgementsRepository) WrapJudgement(judgement *models.Judgement) (*JudgementElement, error)

Jump to

Keyboard shortcuts

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