run

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetParams

type GetParams struct {
	RequestId string
	RunId     uuid.UUID
}

type Run

type Run struct {
	ID               uuid.UUID            `gorm:"type:uuid;default:gen_random_uuid()" json:"id"`
	CreatedAt        time.Time            `json:"created_at"`
	UpdatedAt        time.Time            `json:"updated_at"`
	DeletedAt        *time.Time           `sql:"index" json:"deleted_at"`
	Status           types.RunStatus      `json:"status"`
	WorkspaceID      uuid.UUID            `json:"workspace_id"`
	Workspace        workspaces.Workspace `json:"-"`
	Add              int                  `json:"add"`
	Change           int                  `json:"change"`
	Destroy          int                  `json:"destroy"`
	ManagedResources int                  `json:"managed_resources"`
	CompletedAt      *time.Time           `json:"completed_at"`
	Operation        string               `json:"operation"`

	// Agent configuration
	AgentID *uuid.UUID  `json:"-" gorm:"default:null"`
	Agent   agent.Agent `json:"agent,omitempty"`

	SourceRunID *uuid.UUID `json:"source_run_id"`
}

type RunListParams

type RunListParams struct {
	AgentId        string
	Status         types.RunStatus
	WorkspaceId    string
	OrganizationId uuid.UUID
}

type RunRepository

type RunRepository interface {
	List(params *RunListParams) ([]Run, error)
	Get(runId *types.UuidOrString) (*Run, error)
	Create(run *Run) (*Run, error)
	Update(run *Run) (*Run, error)
	Delete(runId *types.UuidOrString) error
}

func NewRunRepository

func NewRunRepository(db *gorm.DB) RunRepository

type RunRepositoryImpl

type RunRepositoryImpl struct {
	Db *gorm.DB
}

func (*RunRepositoryImpl) Create

func (r *RunRepositoryImpl) Create(run *Run) (*Run, error)

func (*RunRepositoryImpl) Delete

func (r *RunRepositoryImpl) Delete(runId *types.UuidOrString) error

func (*RunRepositoryImpl) Get

func (r *RunRepositoryImpl) Get(runId *types.UuidOrString) (*Run, error)

func (*RunRepositoryImpl) List

func (r *RunRepositoryImpl) List(params *RunListParams) ([]Run, error)

func (*RunRepositoryImpl) Update

func (r *RunRepositoryImpl) Update(run *Run) (*Run, error)

type UpdateRunParams

type UpdateRunParams struct {
	Add    int    `json:"add,omitempty"`
	Change int    `json:"change,omitempty"`
	Remove int    `json:"remove,omitempty"`
	Status string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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