models

package
v0.0.0-...-abd831d Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invocation

type Invocation struct {
	Model
	TaskID       uint       `gorm:"index:ix_invocation_time;" json:"task_id" sql:"type:integer REFERENCES tasks(id)"`
	ScheduledAt  *time.Time `gorm:"index:ix_invocation_time" json:"scheduled_to_start_at"`
	Start        *time.Time `json:"started_at"`
	Finish       *time.Time `json:"finished_at"`
	Success      bool       `json:"success"`
	ErrorMessage string     `json:"error_message"`
	Log          string     `json:"log" sql:"type:text"`
}

func (*Invocation) Create

func (i *Invocation) Create(db *gorm.DB) error

func (*Invocation) Delete

func (i *Invocation) Delete(db *gorm.DB) error

func (*Invocation) Update

func (i *Invocation) Update(db *gorm.DB) error

type Model

type Model struct {
	ID        uint      `gorm:"primary_key" json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Model is base for model, copied from gorm.Model

type Repository

type Repository struct {
	Model
	Name              string     `json:"name"`
	RemoteURL         string     `json:"remote_url"`
	AuthUser          string     `json:"auth_user"`
	LocalPath         string     `json:"-"`
	LastCommitHash    string     `json:"last_commit_hash"`
	LastCommitMessage string     `json:"last_commit_message"`
	LastCommitDate    *time.Time `json:"last_commit_date"`
	LastCommitAuthor  string     `json:"last_commit_author"`
}

func (*Repository) Clone

func (r *Repository) Clone(db *gorm.DB, dir, password string) error

func (*Repository) Create

func (r *Repository) Create(db *gorm.DB) error

func (*Repository) Delete

func (r *Repository) Delete(db *gorm.DB) error

func (*Repository) Files

func (r *Repository) Files() ([]string, error)

func (*Repository) Pull

func (r *Repository) Pull(password string) error

func (*Repository) Update

func (r *Repository) Update(db *gorm.DB) error

func (*Repository) UpdateStats

func (r *Repository) UpdateStats(db *gorm.DB) error

type Task

type Task struct {
	Model
	Name       string     `gorm:"type:varchar(128);UNIQUE;NOT_NULL" json:"name"`
	Schedule   string     `gorm:"type:varchar(128);NOT_NULL" json:"schedule"`
	Repository string     `gorm:"type:varchar(255)" json:"repository"`
	Command    string     `gorm:"NOT_NULL" json:"command"`
	Arguments  string     `json:"args"`
	IsAQL      bool       `json:"is_aql"`
	Enabled    bool       `json:"enabled"`
	Coalesce   bool       `json:"coalesce"`
	NextRun    *time.Time `json:"next_run"`
	// contains filtered or unexported fields
}

func (*Task) Create

func (t *Task) Create(db *gorm.DB) error

func (*Task) Delete

func (t *Task) Delete(db *gorm.DB) error

func (*Task) Disable

func (t *Task) Disable(db *gorm.DB) error

func (*Task) Enable

func (t *Task) Enable(db *gorm.DB) error

func (*Task) GetInvocations

func (t *Task) GetInvocations(db *gorm.DB, limit int) ([]Invocation, error)

func (*Task) GetLastInvocation

func (t *Task) GetLastInvocation(db *gorm.DB) (Invocation, error)

func (*Task) NextInvocation

func (t *Task) NextInvocation(catchupTime time.Time) (time.Time, error)

func (*Task) Update

func (t *Task) Update(db *gorm.DB) error

Jump to

Keyboard shortcuts

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