models

package
v0.0.0-...-8984e3b Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 License: GPL-3.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionNeuron

type ActionNeuron struct {
	ID          string            `json:"id" on_create:"set,auto_uuid"`
	Name        string            `json:"name" validate:"required"`
	EndPoint    string            `json:"end_point" validate:"required"`
	Params      map[string]string `json:"params"`
	Method      string            `json:"method" validate:"required"`
	Description string            `json:"description" validate:"required"`
	Help        string            `json:"help"`
}

func (*ActionNeuron) Validate

func (this *ActionNeuron) Validate() []map[string]string

type Lane

type Lane struct {
	//ID            string `json:"id"`
	Name          string   `json:"name"`
	PoolRef       string   `json:"pool_ref"`
	ActivitiesRef []string `json:"activities_ref"`
}

type NeuronModel

type NeuronModel struct {
	arangoDB.Document

	ID   string `json:"id" validate:"required" on_create:"set,auto_uuid"`
	Host string `json:"host" validate:"url,required"`
	Port int    `json:"port" validate:"required"`
	Name string `json:"name" validate:"required"`
	// option dive is for validate element to array
	Actions   []ActionNeuron `json:"actions" validate:"required,dive,required"`
	PublicKey string         `json:"public_key"`

	ErrorsValidation []map[string]string `json:"errors_validation,omitempty"`
}

func (NeuronModel) GetAction

func (this NeuronModel) GetAction(id string) (ActionNeuron, error)

func (NeuronModel) GetCollection

func (this NeuronModel) GetCollection() string

func (NeuronModel) GetError

func (this NeuronModel) GetError() (string, bool)

func (NeuronModel) GetKey

func (this NeuronModel) GetKey() string

func (NeuronModel) GetValidationErrors

func (this NeuronModel) GetValidationErrors() []map[string]string

func (*NeuronModel) PreSave

func (this *NeuronModel) PreSave(c *arangoDB.Context)

type ProcedureHistoryModel

type ProcedureHistoryModel struct {
	arangoDB.Document

	ProcedureID string  `json:"id" validate:"required" on_create:"set,auto_uuid"`
	UserID      string  `json:"user_id,omitempty" validate:"required"`
	Stages      []Stage `json:"stage"`

	types.Timestamps
	ErrorsValidation []map[string]string `json:"errors_validation,omitempty"`
}

func (ProcedureHistoryModel) GetCollection

func (this ProcedureHistoryModel) GetCollection() string

func (ProcedureHistoryModel) GetError

func (this ProcedureHistoryModel) GetError() (string, bool)

func (ProcedureHistoryModel) GetKey

func (this ProcedureHistoryModel) GetKey() string

func (ProcedureHistoryModel) GetValidationErrors

func (this ProcedureHistoryModel) GetValidationErrors() []map[string]string

func (*ProcedureHistoryModel) PreSave

func (this *ProcedureHistoryModel) PreSave(c *arangoDB.Context)

type ProcedureModel

type ProcedureModel struct {
	arangoDB.Document

	ID    string `json:"id" on_create:"set,auto_uuid"`
	Owner string `json:"owner,omitempty" validate:"required"`
	Pool  string `json:"pool"`
	Lanes []Lane `json:"lanes"`
	Tasks []Task `json:"tasks,omitempty" validate:"required"`

	types.Timestamps
	ErrorsValidation []map[string]string `json:"errors_validation,omitempty"`
}

func (ProcedureModel) GetCollection

func (this ProcedureModel) GetCollection() string

func (ProcedureModel) GetError

func (this ProcedureModel) GetError() (string, bool)

func (ProcedureModel) GetFirstTask

func (this ProcedureModel) GetFirstTask() (*Task, error)

func (ProcedureModel) GetKey

func (this ProcedureModel) GetKey() string

func (ProcedureModel) GetNextTask

func (this ProcedureModel) GetNextTask(task_id string) (*Task, error)

func (ProcedureModel) GetValidationErrors

func (this ProcedureModel) GetValidationErrors() []map[string]string

func (*ProcedureModel) PreSave

func (this *ProcedureModel) PreSave(c *arangoDB.Context)

type ProcedureSessionModel

type ProcedureSessionModel struct {
	arangoDB.Document

	ID           string `json:"id" on_create:"set,auto_uuid"`
	ProcedureID  string `json:"procedure_id" validate:"required"`
	UserID       string `json:"user_id,omitempty" validate:"required"`
	CurrentStage int    `json:"stage"`

	ErrorsValidation []map[string]string `json:"errors_validation,omitempty"`
}

func (ProcedureSessionModel) GetCollection

func (this ProcedureSessionModel) GetCollection() string

func (ProcedureSessionModel) GetError

func (this ProcedureSessionModel) GetError() (string, bool)

func (ProcedureSessionModel) GetKey

func (this ProcedureSessionModel) GetKey() string

func (ProcedureSessionModel) GetValidationErrors

func (this ProcedureSessionModel) GetValidationErrors() []map[string]string

func (*ProcedureSessionModel) PreSave

func (this *ProcedureSessionModel) PreSave(c *arangoDB.Context)

type Stage

type Stage struct {
	Code        string `json:"code"`
	Name        string `json:"name"`
	Description string `json:"description"`
	IsCurrent   bool   `json:"is_current"`
}

type Task

type Task struct {
	ID         string                 `json:"id" on_create:"set,auto_uuid"`
	Name       string                 `json:"name"`
	NeuronKey  string                 `json:"neuron_key"`
	ActionID   string                 `json:"action_id"`
	Sequence   int                    `json:"sequence"`
	Type       string                 `json:"type"` //manually - automatic
	InputData  map[string]interface{} `json:"input_data"`
	OutputData map[string]interface{} `json:"output_data"`
}

type UserModel

type UserModel struct {
	arangoDB.Document

	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Username  string    `json:"username,omitempty" validate:"required"`
	Email     string    `json:"email,omitempty" validate:"required,email"`
	Password  string    `json:"password,omitempty" validate:"required" on_create:"make_password"`
	Token     string    `json:"token,omitempty"`
	LastLogin time.Time `json:"last_login,omitempty"`

	types.Timestamps
	ErrorsValidation []map[string]string `json:"errors_validation,omitempty"`
}

func (UserModel) GetCollection

func (this UserModel) GetCollection() string

func (UserModel) GetError

func (this UserModel) GetError() (string, bool)

func (UserModel) GetKey

func (this UserModel) GetKey() string

func (UserModel) GetValidationErrors

func (this UserModel) GetValidationErrors() []map[string]string

func (*UserModel) PreSave

func (this *UserModel) PreSave(c *arangoDB.Context)

Jump to

Keyboard shortcuts

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