db

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	mysqlxorm.Interface
}

func (*Client) CreatePipelineTrigger

func (client *Client) CreatePipelineTrigger(trigger *PipelineTrigger, ops ...mysqlxorm.SessionOption) error

func (*Client) DeletePipelineTrigger

func (client *Client) DeletePipelineTrigger(id uint64, ops ...mysqlxorm.SessionOption) error

func (*Client) GetPipelineTriggerByID

func (client *Client) GetPipelineTriggerByID(pipelineDefinitionID uint64, ops ...mysqlxorm.SessionOption) ([]PipelineTrigger, error)

func (*Client) ListPipelineTriggers

func (client *Client) ListPipelineTriggers(req *pb.PipelineTriggerRequest, ops ...mysqlxorm.SessionOption) ([]PipelineTrigger, error)

func (*Client) UpdatePipelineTrigger

func (client *Client) UpdatePipelineTrigger(id uint64, trigger *PipelineTrigger, ops ...mysqlxorm.SessionOption) error

type PipelineTrigger

type PipelineTrigger struct {
	ID                   uint64                    `json:"id" xorm:"pk autoincr"`
	Event                string                    `json:"event" xorm:"event"`
	PipelineSource       apistructs.PipelineSource `json:"pipelineSource" xorm:"pipeline_source"`
	PipelineYmlName      string                    `json:"pipelineYmlName" xorm:"pipeline_yml_name"`
	PipelineDefinitionID uint64                    `json:"pipelineDefinitionID" xorm:"pipeline_definition_id"`
	Filter               map[string]string         `json:"filter" xorm:"filter"` // TODO change to query once in the database
	CreatedAt            *time.Time                `json:"createdAt,omitempty" xorm:"created_at created"`
	UpdatedAt            *time.Time                `json:"updatedAt,omitempty" xorm:"updated_at updated"`
}

PipelineBase represents `pipeline_triggers` table.

func FilterByEvent

func FilterByEvent(triggers []PipelineTrigger, Filter map[string]string) ([]PipelineTrigger, error)

func (*PipelineTrigger) TableName

func (*PipelineTrigger) TableName() string

Jump to

Keyboard shortcuts

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