Documentation ¶
Index ¶
- type ComposeStackFileContentBuilder
- func (b *ComposeStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *ComposeStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
- func (b *ComposeStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *ComposeStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
- type ComposeStackFileUploadBuilder
- func (b *ComposeStackFileUploadBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *ComposeStackFileUploadBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *ComposeStackFileUploadBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
- func (b *ComposeStackFileUploadBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
- type ComposeStackGitBuilder
- func (b *ComposeStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *ComposeStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
- func (b *ComposeStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *ComposeStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
- func (b *ComposeStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
- type FileContentMethodStackBuildProcess
- type FileContentMethodStackBuilder
- func (b *FileContentMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *FileContentMethodStackBuilder) GetResponse() string
- func (b *FileContentMethodStackBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
- func (b *FileContentMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *FileContentMethodStackBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
- type FileUploadMethodStackBuildProcess
- type FileUploadMethodStackBuilder
- func (b *FileUploadMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *FileUploadMethodStackBuilder) GetResponse() string
- func (b *FileUploadMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *FileUploadMethodStackBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
- func (b *FileUploadMethodStackBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
- type GitMethodStackBuildProcess
- type GitMethodStackBuilder
- func (b *GitMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *GitMethodStackBuilder) GetResponse() string
- func (b *GitMethodStackBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
- func (b *GitMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *GitMethodStackBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
- func (b *GitMethodStackBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
- type K8sStackFileContentBuilder
- func (b *K8sStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *K8sStackFileContentBuilder) GetResponse() string
- func (b *K8sStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
- func (b *K8sStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *K8sStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
- type KubernetesStackGitBuilder
- func (b *KubernetesStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *KubernetesStackGitBuilder) GetResponse() string
- func (b *KubernetesStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
- func (b *KubernetesStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *KubernetesStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
- func (b *KubernetesStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
- type KubernetesStackUrlBuilder
- func (b *KubernetesStackUrlBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
- func (b *KubernetesStackUrlBuilder) GetResponse() string
- func (b *KubernetesStackUrlBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
- func (b *KubernetesStackUrlBuilder) SetURL(payload *StackPayload) UrlMethodStackBuildProcess
- func (b *KubernetesStackUrlBuilder) SetUniqueInfo(payload *StackPayload) UrlMethodStackBuildProcess
- type RepositoryConfigPayload
- type StackBuilder
- type StackBuilderDirector
- type StackPayload
- type SwarmStackFileContentBuilder
- func (b *SwarmStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *SwarmStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
- func (b *SwarmStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
- func (b *SwarmStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
- type SwarmStackFileUploadBuilder
- func (b *SwarmStackFileUploadBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *SwarmStackFileUploadBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
- func (b *SwarmStackFileUploadBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
- func (b *SwarmStackFileUploadBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
- type SwarmStackGitBuilder
- func (b *SwarmStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *SwarmStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
- func (b *SwarmStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
- func (b *SwarmStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
- func (b *SwarmStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
- type UrlMethodStackBuildProcess
- type UrlMethodStackBuilder
- func (b *UrlMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
- func (b *UrlMethodStackBuilder) GetResponse() string
- func (b *UrlMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
- func (b *UrlMethodStackBuilder) SetURL(payload *StackPayload) UrlMethodStackBuildProcess
- func (b *UrlMethodStackBuilder) SetUniqueInfo(payload *StackPayload) UrlMethodStackBuildProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComposeStackFileContentBuilder ¶
type ComposeStackFileContentBuilder struct { FileContentMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateComposeStackFileContentBuilder ¶
func CreateComposeStackFileContentBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer) *ComposeStackFileContentBuilder
CreateComposeStackFileContentBuilder creates a builder for the compose stack (docker standalone) that will be deployed by file content method
func (*ComposeStackFileContentBuilder) Deploy ¶
func (b *ComposeStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*ComposeStackFileContentBuilder) SetFileContent ¶
func (b *ComposeStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
func (*ComposeStackFileContentBuilder) SetGeneralInfo ¶
func (b *ComposeStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*ComposeStackFileContentBuilder) SetUniqueInfo ¶
func (b *ComposeStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
type ComposeStackFileUploadBuilder ¶
type ComposeStackFileUploadBuilder struct { FileUploadMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateComposeStackFileUploadBuilder ¶
func CreateComposeStackFileUploadBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer) *ComposeStackFileUploadBuilder
CreateComposeStackFileUploadBuilder creates a builder for the compose stack (docker standalone) that will be deployed by file upload method
func (*ComposeStackFileUploadBuilder) Deploy ¶
func (b *ComposeStackFileUploadBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*ComposeStackFileUploadBuilder) SetGeneralInfo ¶
func (b *ComposeStackFileUploadBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*ComposeStackFileUploadBuilder) SetUniqueInfo ¶
func (b *ComposeStackFileUploadBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
func (*ComposeStackFileUploadBuilder) SetUploadedFile ¶
func (b *ComposeStackFileUploadBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
type ComposeStackGitBuilder ¶
type ComposeStackGitBuilder struct { GitMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateComposeStackGitBuilder ¶
func CreateComposeStackGitBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, gitService portainer.GitService, scheduler *scheduler.Scheduler, stackDeployer deployments.StackDeployer) *ComposeStackGitBuilder
CreateComposeStackGitBuilder creates a builder for the compose stack (docker standalone) that will be deployed by git repository method
func (*ComposeStackGitBuilder) Deploy ¶
func (b *ComposeStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*ComposeStackGitBuilder) SetAutoUpdate ¶
func (b *ComposeStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
func (*ComposeStackGitBuilder) SetGeneralInfo ¶
func (b *ComposeStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*ComposeStackGitBuilder) SetGitRepository ¶
func (b *ComposeStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
func (*ComposeStackGitBuilder) SetUniqueInfo ¶
func (b *ComposeStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
type FileContentMethodStackBuildProcess ¶
type FileContentMethodStackBuildProcess interface { // Set general stack information SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess // Set unique stack information, e.g. swarm stack has swarmID, kubernetes stack has namespace SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess // Deploy stack based on the configuration Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess // Save the stack information to database SaveStack() (*portainer.Stack, *httperror.HandlerError) // Get reponse from http request. Use if it is needed GetResponse() string // Process the file content SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess }
type FileContentMethodStackBuilder ¶
type FileContentMethodStackBuilder struct {
StackBuilder
}
func (*FileContentMethodStackBuilder) Deploy ¶
func (b *FileContentMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*FileContentMethodStackBuilder) GetResponse ¶
func (b *FileContentMethodStackBuilder) GetResponse() string
func (*FileContentMethodStackBuilder) SetFileContent ¶
func (b *FileContentMethodStackBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
func (*FileContentMethodStackBuilder) SetGeneralInfo ¶
func (b *FileContentMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*FileContentMethodStackBuilder) SetUniqueInfo ¶
func (b *FileContentMethodStackBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
type FileUploadMethodStackBuildProcess ¶
type FileUploadMethodStackBuildProcess interface { // Set general stack information SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess // Set unique stack information, e.g. swarm stack has swarmID, kubernetes stack has namespace SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess // Deploy stack based on the configuration Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess // Save the stack information to database SaveStack() (*portainer.Stack, *httperror.HandlerError) // Get reponse from http request. Use if it is needed GetResponse() string // Process the upload file SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess }
type FileUploadMethodStackBuilder ¶
type FileUploadMethodStackBuilder struct {
StackBuilder
}
func (*FileUploadMethodStackBuilder) Deploy ¶
func (b *FileUploadMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*FileUploadMethodStackBuilder) GetResponse ¶
func (b *FileUploadMethodStackBuilder) GetResponse() string
func (*FileUploadMethodStackBuilder) SetGeneralInfo ¶
func (b *FileUploadMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*FileUploadMethodStackBuilder) SetUniqueInfo ¶
func (b *FileUploadMethodStackBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
func (*FileUploadMethodStackBuilder) SetUploadedFile ¶
func (b *FileUploadMethodStackBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
type GitMethodStackBuildProcess ¶
type GitMethodStackBuildProcess interface { // Set general stack information SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess // Set unique stack information, e.g. swarm stack has swarmID, kubernetes stack has namespace SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess // Deploy stack based on the configuration Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess // Save the stack information to database and return the stack object SaveStack() (*portainer.Stack, *httperror.HandlerError) // Get reponse from http request. Use if it is needed GetResponse() string // Set git repository configuration SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess // Set auto update setting SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess }
type GitMethodStackBuilder ¶
type GitMethodStackBuilder struct { StackBuilder // contains filtered or unexported fields }
func (*GitMethodStackBuilder) Deploy ¶
func (b *GitMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*GitMethodStackBuilder) GetResponse ¶
func (b *GitMethodStackBuilder) GetResponse() string
func (*GitMethodStackBuilder) SetAutoUpdate ¶
func (b *GitMethodStackBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
func (*GitMethodStackBuilder) SetGeneralInfo ¶
func (b *GitMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*GitMethodStackBuilder) SetGitRepository ¶
func (b *GitMethodStackBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
func (*GitMethodStackBuilder) SetUniqueInfo ¶
func (b *GitMethodStackBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
type K8sStackFileContentBuilder ¶
type K8sStackFileContentBuilder struct { FileContentMethodStackBuilder KuberneteDeployer portainer.KubernetesDeployer User *portainer.User // contains filtered or unexported fields }
func CreateK8sStackFileContentBuilder ¶
func CreateK8sStackFileContentBuilder(dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer, kuberneteDeployer portainer.KubernetesDeployer, user *portainer.User) *K8sStackFileContentBuilder
CreateK8sStackFileContentBuilder creates a builder for the Kubernetes stack that will be deployed by file content method
func (*K8sStackFileContentBuilder) Deploy ¶
func (b *K8sStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*K8sStackFileContentBuilder) GetResponse ¶
func (b *K8sStackFileContentBuilder) GetResponse() string
func (*K8sStackFileContentBuilder) SetFileContent ¶
func (b *K8sStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
func (*K8sStackFileContentBuilder) SetGeneralInfo ¶
func (b *K8sStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*K8sStackFileContentBuilder) SetUniqueInfo ¶
func (b *K8sStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
type KubernetesStackGitBuilder ¶
type KubernetesStackGitBuilder struct { GitMethodStackBuilder KuberneteDeployer portainer.KubernetesDeployer // contains filtered or unexported fields }
func CreateKubernetesStackGitBuilder ¶
func CreateKubernetesStackGitBuilder(dataStore dataservices.DataStore, fileService portainer.FileService, gitService portainer.GitService, scheduler *scheduler.Scheduler, stackDeployer deployments.StackDeployer, kuberneteDeployer portainer.KubernetesDeployer, user *portainer.User) *KubernetesStackGitBuilder
CreateKuberntesStackGitBuilder creates a builder for the Kubernetes stack that will be deployed by git repository method
func (*KubernetesStackGitBuilder) Deploy ¶
func (b *KubernetesStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*KubernetesStackGitBuilder) GetResponse ¶
func (b *KubernetesStackGitBuilder) GetResponse() string
func (*KubernetesStackGitBuilder) SetAutoUpdate ¶
func (b *KubernetesStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
func (*KubernetesStackGitBuilder) SetGeneralInfo ¶
func (b *KubernetesStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*KubernetesStackGitBuilder) SetGitRepository ¶
func (b *KubernetesStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
func (*KubernetesStackGitBuilder) SetUniqueInfo ¶
func (b *KubernetesStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
type KubernetesStackUrlBuilder ¶
type KubernetesStackUrlBuilder struct { UrlMethodStackBuilder KuberneteDeployer portainer.KubernetesDeployer // contains filtered or unexported fields }
func CreateKubernetesStackUrlBuilder ¶
func CreateKubernetesStackUrlBuilder(dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer, kuberneteDeployer portainer.KubernetesDeployer, user *portainer.User) *KubernetesStackUrlBuilder
CreateKuberntesStackGitBuilder creates a builder for the Kubernetes stack that will be deployed by git repository method
func (*KubernetesStackUrlBuilder) Deploy ¶
func (b *KubernetesStackUrlBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
func (*KubernetesStackUrlBuilder) GetResponse ¶
func (b *KubernetesStackUrlBuilder) GetResponse() string
func (*KubernetesStackUrlBuilder) SetGeneralInfo ¶
func (b *KubernetesStackUrlBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
func (*KubernetesStackUrlBuilder) SetURL ¶
func (b *KubernetesStackUrlBuilder) SetURL(payload *StackPayload) UrlMethodStackBuildProcess
func (*KubernetesStackUrlBuilder) SetUniqueInfo ¶
func (b *KubernetesStackUrlBuilder) SetUniqueInfo(payload *StackPayload) UrlMethodStackBuildProcess
type RepositoryConfigPayload ¶
type RepositoryConfigPayload struct { // URL of a Git repository hosting the Stack file URL string `example:"https://github.com/openfaas/faas" validate:"required"` // Reference name of a Git repository hosting the Stack file ReferenceName string `example:"refs/heads/master"` // Use basic authentication to clone the Git repository Authentication bool `example:"true"` // Username used in basic authentication. Required when RepositoryAuthentication is true // and RepositoryGitCredentialID is 0 Username string `example:"myGitUsername"` // Password used in basic authentication. Required when RepositoryAuthentication is true // and RepositoryGitCredentialID is 0 Password string `example:"myGitPassword"` }
type StackBuilder ¶
type StackBuilder struct {
// contains filtered or unexported fields
}
func CreateStackBuilder ¶
func CreateStackBuilder(dataStore dataservices.DataStore, fileService portainer.FileService, deployer deployments.StackDeployer) StackBuilder
func (*StackBuilder) SaveStack ¶
func (b *StackBuilder) SaveStack() (*portainer.Stack, *httperror.HandlerError)
type StackBuilderDirector ¶
type StackBuilderDirector struct {
// contains filtered or unexported fields
}
func NewStackBuilderDirector ¶
func NewStackBuilderDirector(b interface{}) *StackBuilderDirector
func (*StackBuilderDirector) Build ¶
func (d *StackBuilderDirector) Build(payload *StackPayload, endpoint *portainer.Endpoint) (*portainer.Stack, *httperror.HandlerError)
type StackPayload ¶
type StackPayload struct { // Name of the stack Name string `example:"myStack" validate:"required"` // Swarm cluster identifier SwarmID string `example:"jpofkc0i9uo9wtx1zesuk649w" validate:"required"` // Stack file data in byte format. Used by file upload method StackFileContentBytes []byte // Stack file data in string format. Used by file content method StackFileContent string Webhook string // A list of environment(endpoint) variables used during stack deployment Env []portainer.Pair // Optional auto update configuration AutoUpdate *portainer.StackAutoUpdate // Whether the stack is from a app template FromAppTemplate bool `example:"false"` // Kubernetes stack name StackName string // Whether the kubernetes stack config file is compose format ComposeFormat bool // Kubernetes stack namespace Namespace string // Path to the k8s Stack file. Used by k8s git repository method ManifestFile string // URL to the k8s Stack file. Used by k8s git repository method ManifestURL string // Path to the Stack file inside the Git repository ComposeFile string `example:"docker-compose.yml" default:"docker-compose.yml"` // Applicable when deploying with multiple stack files AdditionalFiles []string `example:"[nz.compose.yml, uat.compose.yml]"` // Git repository configuration of a stack RepositoryConfigPayload }
StackPayload contains all the fields for creating a stack with all kinds of methods
type SwarmStackFileContentBuilder ¶
type SwarmStackFileContentBuilder struct { FileContentMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateSwarmStackFileContentBuilder ¶
func CreateSwarmStackFileContentBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer) *SwarmStackFileContentBuilder
CreateSwarmStackFileContentBuilder creates a builder for the swarm stack that will be deployed by file content method
func (*SwarmStackFileContentBuilder) Deploy ¶
func (b *SwarmStackFileContentBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*SwarmStackFileContentBuilder) SetFileContent ¶
func (b *SwarmStackFileContentBuilder) SetFileContent(payload *StackPayload) FileContentMethodStackBuildProcess
func (*SwarmStackFileContentBuilder) SetGeneralInfo ¶
func (b *SwarmStackFileContentBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileContentMethodStackBuildProcess
func (*SwarmStackFileContentBuilder) SetUniqueInfo ¶
func (b *SwarmStackFileContentBuilder) SetUniqueInfo(payload *StackPayload) FileContentMethodStackBuildProcess
type SwarmStackFileUploadBuilder ¶
type SwarmStackFileUploadBuilder struct { FileUploadMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateSwarmStackFileUploadBuilder ¶
func CreateSwarmStackFileUploadBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, stackDeployer deployments.StackDeployer) *SwarmStackFileUploadBuilder
CreateSwarmStackFileUploadBuilder creates a builder for the swarm stack that will be deployed by file upload method
func (*SwarmStackFileUploadBuilder) Deploy ¶
func (b *SwarmStackFileUploadBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*SwarmStackFileUploadBuilder) SetGeneralInfo ¶
func (b *SwarmStackFileUploadBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) FileUploadMethodStackBuildProcess
func (*SwarmStackFileUploadBuilder) SetUniqueInfo ¶
func (b *SwarmStackFileUploadBuilder) SetUniqueInfo(payload *StackPayload) FileUploadMethodStackBuildProcess
func (*SwarmStackFileUploadBuilder) SetUploadedFile ¶
func (b *SwarmStackFileUploadBuilder) SetUploadedFile(payload *StackPayload) FileUploadMethodStackBuildProcess
type SwarmStackGitBuilder ¶
type SwarmStackGitBuilder struct { GitMethodStackBuilder SecurityContext *security.RestrictedRequestContext }
func CreateSwarmStackGitBuilder ¶
func CreateSwarmStackGitBuilder(securityContext *security.RestrictedRequestContext, dataStore dataservices.DataStore, fileService portainer.FileService, gitService portainer.GitService, scheduler *scheduler.Scheduler, stackDeployer deployments.StackDeployer) *SwarmStackGitBuilder
CreateSwarmStackGitBuilder creates a builder for the swarm stack that will be deployed by git repository method
func (*SwarmStackGitBuilder) Deploy ¶
func (b *SwarmStackGitBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
Deploy creates deployment configuration for swarm stack
func (*SwarmStackGitBuilder) SetAutoUpdate ¶
func (b *SwarmStackGitBuilder) SetAutoUpdate(payload *StackPayload) GitMethodStackBuildProcess
func (*SwarmStackGitBuilder) SetGeneralInfo ¶
func (b *SwarmStackGitBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) GitMethodStackBuildProcess
func (*SwarmStackGitBuilder) SetGitRepository ¶
func (b *SwarmStackGitBuilder) SetGitRepository(payload *StackPayload) GitMethodStackBuildProcess
func (*SwarmStackGitBuilder) SetUniqueInfo ¶
func (b *SwarmStackGitBuilder) SetUniqueInfo(payload *StackPayload) GitMethodStackBuildProcess
type UrlMethodStackBuildProcess ¶
type UrlMethodStackBuildProcess interface { // Set general stack information SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess // Set unique stack information, e.g. swarm stack has swarmID, kubernetes stack has namespace SetUniqueInfo(payload *StackPayload) UrlMethodStackBuildProcess // Deploy stack based on the configuration Deploy(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess // Save the stack information to database SaveStack() (*portainer.Stack, *httperror.HandlerError) // Get reponse from http request. Use if it is needed GetResponse() string // Set manifest url SetURL(payload *StackPayload) UrlMethodStackBuildProcess }
type UrlMethodStackBuilder ¶
type UrlMethodStackBuilder struct {
StackBuilder
}
func (*UrlMethodStackBuilder) Deploy ¶
func (b *UrlMethodStackBuilder) Deploy(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
func (*UrlMethodStackBuilder) GetResponse ¶
func (b *UrlMethodStackBuilder) GetResponse() string
func (*UrlMethodStackBuilder) SetGeneralInfo ¶
func (b *UrlMethodStackBuilder) SetGeneralInfo(payload *StackPayload, endpoint *portainer.Endpoint) UrlMethodStackBuildProcess
func (*UrlMethodStackBuilder) SetURL ¶
func (b *UrlMethodStackBuilder) SetURL(payload *StackPayload) UrlMethodStackBuildProcess
func (*UrlMethodStackBuilder) SetUniqueInfo ¶
func (b *UrlMethodStackBuilder) SetUniqueInfo(payload *StackPayload) UrlMethodStackBuildProcess
Source Files ¶
- compose_file_content_builder.go
- compose_file_upload_builder.go
- compose_git_builder.go
- director.go
- k8s_file_content_builder.go
- k8s_git_builder.go
- k8s_url_builder.go
- stack_builder.go
- stack_file_content_builder.go
- stack_file_upload_builder.go
- stack_git_builder.go
- stack_payload.go
- stack_url_builder.go
- swarm_file_content_builder.go
- swarm_file_upload_builder.go
- swarm_git_builder.go