client

package
v0.0.0-...-5973960 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkSize = 100

Variables

This section is empty.

Functions

func IsNotFoundError

func IsNotFoundError(err error) bool

Types

type About

type About struct {
	InstanceName        string    `json:"instanceName" yaml:"instanceName"`
	InstanceDescription string    `json:"instanceDescription" yaml:"instanceDescription"`
	TKOVersion          string    `json:"tkoVersion" yaml:"tkoVersion"`
	Backend             string    `json:"backend" yaml:"backend"`
	GRPC                AboutGRPC `json:"grpc" yaml:"grpc"`
}

type AboutGRPC

type AboutGRPC struct {
	AddressPorts         []string `json:"addressPorts" yaml:"addressPorts"`
	DefaultPackageFormat string   `json:"defaultPackageFormat" yaml:"defaultPackageFormat"`
}

type Client

type Client struct {
	GRPCLevel2Protocol string
	GRPCAddress        string
	GRPCPort           int
	PackageFormat      string
	Timeout            time.Duration
	Timezone           *time.Location
	// contains filtered or unexported fields
}

func NewClient

func NewClient(grpcIpStack util.IPStack, grpcAddress string, grpcPort int, packageFormat string, timeout time.Duration, log commonlog.Logger) *Client

func (*Client) About

func (self *Client) About() (About, error)

func (*Client) CancelDeploymentModification

func (self *Client) CancelDeploymentModification(modificationToken string) (bool, string, error)

func (*Client) CreateDeployment

func (self *Client) CreateDeployment(parentDeploymentId string, templateId string, siteId string, mergeMetadata map[string]string, prepared bool, approved bool, mergePackage tkoutil.Package) (bool, string, string, error)

func (*Client) CreateDeploymentRaw

func (self *Client) CreateDeploymentRaw(parentDeploymentId string, templateId string, siteId string, mergeMetadata map[string]string, prepared bool, approved bool, mergePackageFormat string, mergePackage []byte) (bool, string, string, error)

func (*Client) DataClient

func (self *Client) DataClient() (api.DataClient, error)

func (*Client) DeleteDeployment

func (self *Client) DeleteDeployment(deploymentId string) (bool, string, error)

func (*Client) DeletePlugin

func (self *Client) DeletePlugin(pluginId PluginID) (bool, string, error)

func (*Client) DeleteSite

func (self *Client) DeleteSite(siteId string) (bool, string, error)

func (*Client) DeleteTemplate

func (self *Client) DeleteTemplate(templateId string) (bool, string, error)

func (*Client) EndDeploymentModification

func (self *Client) EndDeploymentModification(modificationToken string, package_ tkoutil.Package) (bool, string, string, error)

func (*Client) EndDeploymentModificationRaw

func (self *Client) EndDeploymentModificationRaw(modificationToken string, packageFormat string, package_ []byte) (bool, string, string, error)

func (*Client) GetDeployment

func (self *Client) GetDeployment(deploymentId string) (Deployment, bool, error)

func (*Client) GetPlugin

func (self *Client) GetPlugin(pluginId PluginID) (Plugin, bool, error)

func (*Client) GetSite

func (self *Client) GetSite(siteId string) (Site, bool, error)

func (*Client) GetTemplate

func (self *Client) GetTemplate(templateId string) (Template, bool, error)

func (*Client) ListAllDeployments

func (self *Client) ListAllDeployments(selectDeployments SelectDeployments) util.Results[DeploymentInfo]

func (*Client) ListAllPlugins

func (self *Client) ListAllPlugins(selectPlugins SelectPlugins) util.Results[Plugin]

func (*Client) ListAllSites

func (self *Client) ListAllSites(selectSites SelectSites) util.Results[SiteInfo]

func (*Client) ListAllTemplates

func (self *Client) ListAllTemplates(selectTemplates SelectTemplates) util.Results[TemplateInfo]

func (*Client) ListDeployments

func (self *Client) ListDeployments(selectDeployments SelectDeployments, offset uint, maxCount int) (util.Results[DeploymentInfo], error)

func (*Client) ListPlugins

func (self *Client) ListPlugins(selectPlugins SelectPlugins, offset uint, maxCount int) (util.Results[Plugin], error)

func (*Client) ListSites

func (self *Client) ListSites(selectSites SelectSites, offset uint, maxCount int) (util.Results[SiteInfo], error)

func (*Client) ListTemplates

func (self *Client) ListTemplates(selectTemplates SelectTemplates, offset uint, maxCount int) (util.Results[TemplateInfo], error)

func (*Client) ModifyDeployment

func (self *Client) ModifyDeployment(deploymentId string, modify ModifyDeploymentFunc) (bool, error)

func (*Client) PurgeDeployments

func (self *Client) PurgeDeployments(selectDeployments SelectDeployments) (bool, string, error)

func (*Client) PurgePlugins

func (self *Client) PurgePlugins(selectPlugins SelectPlugins) (bool, string, error)

func (*Client) PurgeSites

func (self *Client) PurgeSites(selectSites SelectSites) (bool, string, error)

func (*Client) PurgeTemplates

func (self *Client) PurgeTemplates(selectTemplates SelectTemplates) (bool, string, error)

func (*Client) RegisterPlugin

func (self *Client) RegisterPlugin(pluginId PluginID, executor string, arguments []string, properties map[string]string, triggers []tkoutil.GVK) (bool, string, error)

func (*Client) RegisterSite

func (self *Client) RegisterSite(siteId string, templateId string, metadata map[string]string, package_ tkoutil.Package) (bool, string, error)

func (*Client) RegisterSiteRaw

func (self *Client) RegisterSiteRaw(siteId string, templateId string, metadata map[string]string, packageFormat string, package_ []byte) (bool, string, error)

func (*Client) RegisterTemplate

func (self *Client) RegisterTemplate(templateId string, metadata map[string]string, package_ tkoutil.Package) (bool, string, error)

func (*Client) RegisterTemplateRaw

func (self *Client) RegisterTemplateRaw(templateId string, metadata map[string]string, packageFormat string, package_ []byte) (bool, string, error)

func (*Client) StartDeploymentModification

func (self *Client) StartDeploymentModification(deploymentId string) (bool, string, string, tkoutil.Package, error)

type Deployment

type Deployment struct {
	DeploymentInfo
	Package tkoutil.Package `json:"package" yaml:"package"`
}

type DeploymentInfo

type DeploymentInfo struct {
	DeploymentID       string            `json:"deploymentId" yaml:"deploymentId"`
	ParentDeploymentID string            `json:"parentDeploymentId,omitempty" yaml:"parentDeploymentId,omitempty"`
	TemplateID         string            `json:"templateId" yaml:"templateId"`
	SiteID             string            `json:"siteId,omitempty" yaml:"siteId,omitempty"`
	Metadata           map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Created            time.Time         `json:"created" yaml:"created"`
	Updated            time.Time         `json:"updated" yaml:"updated"`
	Prepared           bool              `json:"prepared" yaml:"prepared"`
	Approved           bool              `json:"approved" yaml:"approved"`
}

type ModifyDeploymentFunc

type ModifyDeploymentFunc func(package_ tkoutil.Package) (bool, tkoutil.Package, error)

type Plugin

type Plugin struct {
	PluginID   `json:",inline" yaml:",inline"`
	Executor   string            `json:"executor" yaml:"executor"`
	Arguments  []string          `json:"arguments" yaml:"arguments"`
	Properties map[string]string `json:"properties" yaml:"properties"`
	Triggers   []tkoutil.GVK     `json:"triggers" yaml:"triggers"`
}

type PluginID

type PluginID struct {
	Type string `json:"type" yaml:"type"`
	Name string `json:"name" yaml:"name"`
}

func NewPluginID

func NewPluginID(type_ string, name string) PluginID

func (PluginID) String

func (self PluginID) String() string

(fmt.Stringer interface)

type SelectDeployments

type SelectDeployments struct {
	ParentDeploymentID       *string
	TemplateIDPatterns       []string
	TemplateMetadataPatterns map[string]string
	SiteIDPatterns           []string
	SiteMetadataPatterns     map[string]string
	MetadataPatterns         map[string]string
	Prepared                 *bool
	Approved                 *bool
}

func (SelectDeployments) String

func (self SelectDeployments) String() string

(fmt.Stringer interface)

type SelectPlugins

type SelectPlugins struct {
	Type         *string
	NamePatterns []string
	Executor     *string
	Trigger      *tkoutil.GVK
}

func (SelectPlugins) String

func (self SelectPlugins) String() string

(fmt.Stringer interface)

type SelectSites

type SelectSites struct {
	SiteIDPatterns     []string
	TemplateIDPatterns []string
	MetadataPatterns   map[string]string
}

func (SelectSites) String

func (self SelectSites) String() string

(fmt.Stringer interface)

type SelectTemplates

type SelectTemplates struct {
	TemplateIDPatterns []string
	MetadataPatterns   map[string]string
}

func (SelectTemplates) String

func (self SelectTemplates) String() string

(fmt.Stringer interface)

type Site

type Site struct {
	SiteInfo
	Package tkoutil.Package `json:"package" yaml:"package"`
}

type SiteInfo

type SiteInfo struct {
	SiteID        string            `json:"siteId" yaml:"siteId"`
	TemplateID    string            `json:"templateId,omitempty" yaml:"templateId,omitempty"`
	Metadata      map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Updated       time.Time         `json:"updated" yaml:"updated"`
	DeploymentIDs []string          `json:"deploymentIds,omitempty" yaml:"deploymentIds,omitempty"`
}

type Template

type Template struct {
	TemplateInfo
	Package tkoutil.Package `json:"package" yaml:"package"`
}

type TemplateInfo

type TemplateInfo struct {
	TemplateID    string            `json:"templateId" yaml:"templateId"`
	Metadata      map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Updated       time.Time         `json:"updated" yaml:"updated"`
	DeploymentIDs []string          `json:"deploymentIds,omitempty" yaml:"deploymentIds,omitempty"`
}

Jump to

Keyboard shortcuts

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