handler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CfgValidationHandler

type CfgValidationHandler interface {
	ValidateBase(cType string, cTypeOpt module.ConfigTypeOptions, dataType module.DataType) error
	ValidateTypeOptions(cType string, cTypeOpt module.ConfigTypeOptions) error
	ValidateValue(cType string, cTypeOpt module.ConfigTypeOptions, value any, isSlice bool, dataType module.DataType) error
	ValidateValInOpt(cOpt any, value any, isSlice bool, dataType module.DataType) error
}

type DepHealthHandler

type DepHealthHandler interface {
	List(ctx context.Context, instances map[string]model.DepInstance) (map[string]model.DepHealthInfo, error)
	Get(ctx context.Context, instance model.DepInstance) (model.DepHealthInfo, error)
}

type DepStorageHandler

type DepStorageHandler interface {
	BeginTransaction(ctx context.Context) (driver.Tx, error)
	ListDep(ctx context.Context, filter model.DepFilter) ([]model.DepMeta, error)
	CreateDep(ctx context.Context, tx driver.Tx, mID, name, inclDir string, indirect bool, timestamp time.Time) (string, error)
	CreateDepConfigs(ctx context.Context, tx driver.Tx, mConfigs module.Configs, dConfigs map[string]any, dID string) error
	CreateDepHostRes(ctx context.Context, tx driver.Tx, hostResources map[string]string, dID string) error
	CreateDepSecrets(ctx context.Context, tx driver.Tx, secrets map[string]model.DepSecret, dID string) error
	CreateDepReq(ctx context.Context, tx driver.Tx, depReq []string, dID string) error
	DeleteDepReq(ctx context.Context, tx driver.Tx, dID string) error
	ReadDep(ctx context.Context, dID string) (*model.Deployment, error)
	UpdateDep(ctx context.Context, dID, name, inclDir string, enabled, indirect bool, timestamp time.Time) error
	DeleteDep(ctx context.Context, dID string) error
	DeleteDepConfigs(ctx context.Context, tx driver.Tx, dID string) error
	DeleteDepHostRes(ctx context.Context, tx driver.Tx, dID string) error
	DeleteDepSecrets(ctx context.Context, tx driver.Tx, dID string) error
	ListInst(ctx context.Context, filter model.DepInstFilter) ([]model.Instance, error)
	CreateInst(ctx context.Context, tx driver.Tx, dID string, timestamp time.Time) (string, error)
	ReadInst(ctx context.Context, iID string) (model.Instance, error)
	DeleteInst(ctx context.Context, iID string) error
	ListInstCtr(ctx context.Context, iID string, filter model.CtrFilter) ([]model.Container, error)
	CreateInstCtr(ctx context.Context, tx driver.Tx, iID, cID, sRef string, order uint) error
}

type DeploymentHandler

type DeploymentHandler interface {
	List(ctx context.Context, filter model.DepFilter) ([]model.DepMeta, error)
	Get(ctx context.Context, dID string) (*model.Deployment, error)
	ListInstances(ctx context.Context) (map[string]model.DepInstance, error)
	GetInstance(ctx context.Context, dID string) (model.DepInstance, error)
	Create(ctx context.Context, mod *module.Module, depReq model.DepInput, incl dir_fs.DirFS, indirect bool) (string, error)
	Delete(ctx context.Context, dID string, orphans bool) error
	Update(ctx context.Context, mod *module.Module, depReq model.DepInput, incl dir_fs.DirFS, dID, inclDir string, enabled, indirect bool) error
	Enable(ctx context.Context, dID string) error
	Disable(ctx context.Context, dID string, dependencies bool) error
}

type JobHandler

type JobHandler interface {
	List(filter model.JobFilter) []model.Job
	Get(id string) (model.Job, error)
	Create(desc string, tFunc func(context.Context, context.CancelFunc) error) (string, error)
	Cancel(id string) error
}

type ModFileHandler

type ModFileHandler interface {
	GetModule(file fs.File) (*module.Module, error)
	GetModFile(dir dir_fs.DirFS) (fs.File, string, error)
}

type ModRepo

type ModRepo interface {
	Versions() []string
	Get(ver string) (dir_fs.DirFS, error)
	Remove() error
}

type ModStagingHandler

type ModStagingHandler interface {
	Prepare(ctx context.Context, modules map[string]*module.Module, mID, ver string) (Stage, error)
}

type ModStorageHandler

type ModStorageHandler interface {
	List(ctx context.Context, filter model.ModFilter) ([]model.Module, error)
	Get(ctx context.Context, mID string) (model.Module, error)
	GetDir(ctx context.Context, mID string) (model.Module, dir_fs.DirFS, error)
	Add(ctx context.Context, mod model.Module, modDir dir_fs.DirFS, modFile string) error
	Update(ctx context.Context, mod model.Module, modDir dir_fs.DirFS, modFile string) error
	Delete(ctx context.Context, mID string) error
}

type ModTransferHandler

type ModTransferHandler interface {
	Get(ctx context.Context, mID string) (ModRepo, error)
}

type ModUpdateHandler

type ModUpdateHandler interface {
	Check(ctx context.Context, modules map[string]*module.Module) error
	List(ctx context.Context) map[string]model.ModUpdate
	Get(ctx context.Context, mID string) (model.ModUpdate, error)
	Remove(ctx context.Context, mID string) error
	Prepare(ctx context.Context, modules map[string]*module.Module, stage Stage, mID string) error
	GetPending(ctx context.Context, mID string) (Stage, map[string]struct{}, map[string]struct{}, map[string]struct{}, error)
	CancelPending(ctx context.Context, mID string) error
}

type ModuleHandler

type ModuleHandler interface {
	List(ctx context.Context, filter model.ModFilter) ([]model.Module, error)
	Get(ctx context.Context, mID string) (model.Module, error)
	GetReq(ctx context.Context, mID string) (model.Module, map[string]model.Module, error)
	GetIncl(ctx context.Context, mID string) (dir_fs.DirFS, error)
	Add(ctx context.Context, mod *module.Module, modDir dir_fs.DirFS, modFile string, indirect bool) error
	Update(ctx context.Context, mod *module.Module, modDir dir_fs.DirFS, modFile string, indirect bool) error
	Delete(ctx context.Context, mID string, force bool) error
}

type Stage

type Stage interface {
	Items() map[string]StageItem
	Get(mID string) (StageItem, bool)
	Remove() error
}

type StageItem

type StageItem interface {
	Module() *module.Module
	ModFile() string
	Dir() dir_fs.DirFS
	Indirect() bool
}

type Validator

type Validator func(params map[string]any) error

Jump to

Keyboard shortcuts

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