Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyWindow[E any](list []E, window Window) []E
- func EscapePatternRE(s string) string
- func IDMatchesPattern(s string, pattern string) bool
- func IDMatchesPatterns(id string, patterns []string) bool
- func IDPatternRE(pattern string) string
- func IsBadArgumentError(err error) bool
- func IsBusyError(err error) bool
- func IsNotDoneError(err error) bool
- func IsNotFoundError(err error) bool
- func IsNotImplementedError(err error) bool
- func IsTimeoutError(err error) bool
- func MatchesPattern(s string, pattern string) bool
- func MetadataMatchesPatterns(metadata map[string]string, patterns map[string]string) bool
- func NewID() string
- func PatternRE(pattern string) string
- func SortDeploymentInfos(deploymentInfos []DeploymentInfo)
- func SortPlugins(plugins []Plugin)
- func SortSiteInfos(siteInfos []SiteInfo)
- func SortTemplateInfos(templateInfos []TemplateInfo)
- type Backend
- type BadArgumentError
- type BusyError
- type Deployment
- type DeploymentInfo
- type NotDoneError
- type NotFoundError
- type NotImplementedError
- type Plugin
- type PluginID
- type SelectDeployments
- type SelectPlugins
- type SelectSites
- type SelectTemplates
- type Site
- func (self *Site) AddDeployment(deploymentId string) bool
- func (self *Site) Clone(withDeployments bool) *Site
- func (self *Site) EncodePackage(format string) ([]byte, error)
- func (self *Site) MergeTemplate(template *Template)
- func (self *Site) RemoveDeployment(deploymentId string) bool
- func (self *Site) UpdateFromPackage()
- type SiteInfo
- type Template
- type TemplateInfo
- type TimeoutError
- type Window
Constants ¶
View Source
const PluginIDSeparator = "|"
Variables ¶
View Source
var ( DefaultMaxCount uint = 100 MaxMaxCount uint = 1_000 )
Functions ¶
func ApplyWindow ¶
func EscapePatternRE ¶
func IDMatchesPattern ¶
func IDMatchesPatterns ¶
func IDPatternRE ¶
func IsBadArgumentError ¶
func IsBusyError ¶
func IsNotDoneError ¶
func IsNotFoundError ¶
func IsNotImplementedError ¶
func IsTimeoutError ¶
func MatchesPattern ¶
func MetadataMatchesPatterns ¶
func SortDeploymentInfos ¶
func SortDeploymentInfos(deploymentInfos []DeploymentInfo)
func SortPlugins ¶
func SortPlugins(plugins []Plugin)
func SortSiteInfos ¶
func SortSiteInfos(siteInfos []SiteInfo)
func SortTemplateInfos ¶
func SortTemplateInfos(templateInfos []TemplateInfo)
Types ¶
type Backend ¶
type Backend interface {
Connect(context contextpkg.Context) error
Release(context contextpkg.Context) error
String() string
// Owns and may change the contents of the template argument.
// Ignores template DeploymentIDs.
// Can return BadArgumentError, NotDoneError.
SetTemplate(context contextpkg.Context, template *Template) error
// Can return BadArgumentError, NotFoundError.
GetTemplate(context contextpkg.Context, templateId string) (*Template, error)
// Does *not* delete associated deployments, but removes associations.
// Can return BadArgumentError, NotFoundError, NotDoneError.
DeleteTemplate(context contextpkg.Context, templateId string) error
// Can return BadArgumentError.
ListTemplates(context contextpkg.Context, selectTemplates SelectTemplates, window Window) (util.Results[TemplateInfo], error)
// Does *not* delete associated deployments, but removes associations.
// Can return BadArgumentError, NotDoneError.
PurgeTemplates(context contextpkg.Context, selectTemplates SelectTemplates) error
// Owns and may change the contents of the site argument.
// Ignores site DeploymentIDs.
// Can return BadArgumentError, NotDoneError.
SetSite(context contextpkg.Context, site *Site) error
// Can return BadArgumentError, NotFoundError.
GetSite(context contextpkg.Context, siteId string) (*Site, error)
// Does *not* delete associated deployments, but removes association.
// Can return BadArgumentError, NotFoundError, NotDoneError.
DeleteSite(context contextpkg.Context, siteId string) error
// Can return BadArgumentError.
ListSites(context contextpkg.Context, selectSites SelectSites, window Window) (util.Results[SiteInfo], error)
// Does *not* delete associated deployments, but removes association.
// Can return BadArgumentError, NotDoneError.
PurgeSites(context contextpkg.Context, selectSites SelectSites) error
// Owns and may change the contents of the deployment argument.
// Can return BadArgumentError, NotDoneError.
CreateDeployment(context contextpkg.Context, deployment *Deployment) error
// Can return BadArgumentError, NotFoundError.
GetDeployment(context contextpkg.Context, deploymentId string) (*Deployment, error)
// Does *not* delete child deployments, but orphans them.
// Can return BadArgumentError, NotFoundError, NotDoneError.
DeleteDeployment(context contextpkg.Context, deploymentId string) error
// Can return BadArgumentError.
ListDeployments(context contextpkg.Context, selectDeployments SelectDeployments, window Window) (util.Results[DeploymentInfo], error)
// Does *not* delete child deployments, but orphans them.
// Can return BadArgumentError, NotDoneError.
PurgeDeployments(context contextpkg.Context, selectDeployments SelectDeployments) error
// Can return BadArgumentError, NotFoundError, NotDoneError, BusyError.
StartDeploymentModification(context contextpkg.Context, deploymentId string) (string, *Deployment, error)
// Owns and may change the contents of the package argument.
// May change TemplateID, SiteID, Prepared, Approved.
// Does *not* modify Metadata, even if modified package indicate a change.
// If validation is not nil, should validate the modification. If the deployment is prepared, it should be complete validation.
// Can return BadArgumentError, NotFoundError, NotDoneError, TimeoutError.
EndDeploymentModification(context contextpkg.Context, modificationToken string, package_ tkoutil.Package, validation *validationpkg.Validation) (string, error)
// Can return BadArgumentError, NotFoundError, NotDoneError.
CancelDeploymentModification(context contextpkg.Context, modificationToken string) error
// Owns and may change the contents of the plugin argument.
// Can return BadArgumentError, NotDoneError.
SetPlugin(context contextpkg.Context, plugin *Plugin) error
// Can return BadArgumentError, NotFoundError.
GetPlugin(context contextpkg.Context, pluginId PluginID) (*Plugin, error)
// Can return BadArgumentError, NotFoundError, NotDoneError.
DeletePlugin(context contextpkg.Context, pluginId PluginID) error
// Can return BadArgumentError.
ListPlugins(context contextpkg.Context, selectPlugins SelectPlugins, window Window) (util.Results[Plugin], error)
// Can return BadArgumentError, NotDoneError.
PurgePlugins(context contextpkg.Context, selectPlugins SelectPlugins) error
}
type BadArgumentError ¶
type BadArgumentError struct {
// contains filtered or unexported fields
}
func NewBadArgumentError ¶
func NewBadArgumentError(message string) *BadArgumentError
func NewBadArgumentErrorf ¶
func NewBadArgumentErrorf(format string, a ...any) *BadArgumentError
func WrapBadArgumentError ¶
func WrapBadArgumentError(err error) *BadArgumentError
type BusyError ¶
type BusyError struct {
// contains filtered or unexported fields
}
func NewBusyError ¶
func NewBusyErrorf ¶
type Deployment ¶
type Deployment struct {
DeploymentInfo
Package util.Package
}
func NewDeploymentFromBytes ¶
func (*Deployment) Clone ¶
func (self *Deployment) Clone(withPackage bool) *Deployment
func (*Deployment) EncodePackage ¶
func (self *Deployment) EncodePackage(format string) ([]byte, error)
func (*Deployment) MergeDeploymentResource ¶
func (self *Deployment) MergeDeploymentResource()
func (*Deployment) MergeTemplate ¶
func (self *Deployment) MergeTemplate(template *Template)
func (*Deployment) UpdateFromPackage ¶
func (self *Deployment) UpdateFromPackage(withMetadata bool)
type DeploymentInfo ¶
type DeploymentInfo struct {
DeploymentID string
ParentDeploymentID string
TemplateID string
SiteID string
Metadata map[string]string
Created time.Time // millisecond precision
Updated time.Time // millisecond precision
Prepared bool
Approved bool
}
func (*DeploymentInfo) Clone ¶
func (self *DeploymentInfo) Clone() DeploymentInfo
func (*DeploymentInfo) MergeTemplateInfo ¶
func (self *DeploymentInfo) MergeTemplateInfo(templateInfo *TemplateInfo)
func (*DeploymentInfo) NewDeploymentResource ¶
func (self *DeploymentInfo) NewDeploymentResource() util.Resource
func (*DeploymentInfo) UpdateFromPackage ¶
func (self *DeploymentInfo) UpdateFromPackage(package_ util.Package, withMetadata bool)
type NotDoneError ¶
type NotDoneError struct {
// contains filtered or unexported fields
}
func NewNotDoneError ¶
func NewNotDoneError(message string) *NotDoneError
func NewNotDoneErrorf ¶
func NewNotDoneErrorf(format string, a ...any) *NotDoneError
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func NewNotFoundError ¶
func NewNotFoundError(message string) *NotFoundError
func NewNotFoundErrorf ¶
func NewNotFoundErrorf(format string, a ...any) *NotFoundError
type NotImplementedError ¶
type NotImplementedError struct {
// contains filtered or unexported fields
}
func NewNotImplementedError ¶
func NewNotImplementedError(feature string) *NotImplementedError
func (*NotImplementedError) Error ¶
func (self *NotImplementedError) Error() string
(error interface)
type Plugin ¶
type Plugin struct {
PluginID
Executor string
Arguments []string
Properties map[string]string
Triggers []util.GVK
}
func (*Plugin) AddTrigger ¶
func (*Plugin) TriggersAsStrings ¶
type SelectDeployments ¶
type SelectPlugins ¶
type SelectSites ¶
type SelectTemplates ¶
type Site ¶
func NewSiteFromBytes ¶
func (*Site) AddDeployment ¶
func (*Site) MergeTemplate ¶
func (*Site) RemoveDeployment ¶
func (*Site) UpdateFromPackage ¶
func (self *Site) UpdateFromPackage()
type SiteInfo ¶
type SiteInfo struct {
SiteID string
TemplateID string
Metadata map[string]string
Updated time.Time // millisecond precision
DeploymentIDs []string
}
func (*SiteInfo) MergeTemplateInfo ¶
func (self *SiteInfo) MergeTemplateInfo(templateInfo *TemplateInfo)
func (*SiteInfo) UpdateFromPackage ¶
type Template ¶
type Template struct {
TemplateInfo
Package util.Package
}
func NewTemplateFromBytes ¶
func (*Template) AddDeployment ¶
func (*Template) RemoveDeployment ¶
func (*Template) UpdateFromPackage ¶
func (self *Template) UpdateFromPackage()
type TemplateInfo ¶
type TemplateInfo struct {
TemplateID string
Metadata map[string]string
Updated time.Time // millisecond precision
DeploymentIDs []string
}
func (*TemplateInfo) Clone ¶
func (self *TemplateInfo) Clone(withDeployments bool) TemplateInfo
func (*TemplateInfo) UpdateFromPackage ¶
func (self *TemplateInfo) UpdateFromPackage(package_ util.Package)
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func NewTimeoutError ¶
func NewTimeoutError(message string) *TimeoutError
func NewTimeoutErrorf ¶
func NewTimeoutErrorf(format string, a ...any) *TimeoutError
Source Files
¶
Click to show internal directories.
Click to hide internal directories.