model

package
v0.0.0-...-ca71e2f Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Type   string `json:"type"`
	Name   string `json:"name"`
	Reason string `json:"reason"`
}

type Job

type Job struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Name      string     `json:"name"`
	Project   Project    `json:"project"`
	ProjectID int        `json:"project_id"`
	Spec      string     `json:"spec"`
	Cmd       string     `json:"cmd"`
	Active    bool       `json:"active"`
}

func (Job) Errors

func (j Job) Errors() map[string][]string

type JobParams

type JobParams struct {
	Job
	OmitID        interface{} `json:"id,omitempty"`
	OmitCreatedAt interface{} `json:"created_at,omitempty"`
	OmitUpdatedAt interface{} `json:"updated_at,omitempty"`
}

type Project

type Project struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Name      string     `json:"name"`
}

func (Project) Errors

func (p Project) Errors() []Error

type ProjectListResponse

type ProjectListResponse struct {
	Response
	Projects []Project `json:"data"`
}

type ProjectResponse

type ProjectResponse struct {
	Response
	Project Project `json:"data"`
}

type Response

type Response struct {
	HTTPStatusCode int         `json:"-"`
	Data           interface{} `json:"data"`
	HasErrors      bool        `json:"has_errors"`
	Errors         []Error     `json:"errors"`
}

type Result

type Result struct {
	ID          int       `json:"id"`
	JobID       int       `json:"job_id"`
	IsTriggered bool      `json:"is_triggered"`
	CreatedAt   time.Time `json:"created_at" db:"createdAt"`
	UpdatedAt   time.Time `json:"updated_at" db:"updatedAt"`
}

type Trigger

type Trigger struct {
	ID        uint        `gorm:"primary_key" json:"id"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
	DeletedAt *time.Time  `json:"deleted_at"`
	Target    string      `json:"target"`
	Val       string      `json:"val"`
	Type      TriggerType `json:"type"`
	Job       Job         `json:"job"`
	JobID     int         `json:"job_id"`
}

func (Trigger) Errors

func (t Trigger) Errors() map[string][]string

type TriggerType

type TriggerType int
const (
	TriggerEqual TriggerType = iota
	TriggerLessThan
	TriggerMoreThan
)

Jump to

Keyboard shortcuts

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