Documentation
¶
Overview ¶
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Package lagoon implements high-level functions for interacting with the Lagoon API.
Index ¶
- Variables
- func ActiveStandbySwitch(ctx context.Context, project string, t Tasks) (*schema.Task, error)
- func AddBackupRestore(ctx context.Context, backupID string, e Environments) (*schema.Restore, error)
- func DeployBranch(ctx context.Context, deploy *schema.DeployEnvironmentBranchInput, m Deploy) (*schema.DeployEnvironmentBranch, error)
- func DeployLatest(ctx context.Context, deploy *schema.DeployEnvironmentLatestInput, m Deploy) (*schema.DeployEnvironmentLatest, error)
- func DeployPromote(ctx context.Context, deploy *schema.DeployEnvironmentPromoteInput, m Deploy) (*schema.DeployEnvironmentPromote, error)
- func DeployPullRequest(ctx context.Context, deploy *schema.DeployEnvironmentPullrequestInput, ...) (*schema.DeployEnvironmentPullrequest, error)
- func ExportProject(ctx context.Context, e Exporter, name string, exclude map[string]bool) ([]byte, error)
- func GetBackupsForEnvironmentByName(ctx context.Context, name string, project uint, e Environments) (*schema.Environment, error)
- func GetLagoonAPIVersion(ctx context.Context, l APIVersion) (*schema.LagoonVersion, error)
- func GetMeInfo(ctx context.Context, m Me) (*schema.User, error)
- func GetMinimalProjectByName(ctx context.Context, name string, p Projects) (*schema.Project, error)
- func GetProjectMetadata(ctx context.Context, name string, p Projects) (*schema.ProjectMetadata, error)
- func GetProjectsByMetadata(ctx context.Context, key string, value string, p Projects) (*[]schema.ProjectMetadata, error)
- func Import(ctx context.Context, i Importer, r io.Reader, keepGoing bool, openshiftID uint) error
- func RemoveProjectMetadataByKey(ctx context.Context, id int, key string, p Projects) (*schema.ProjectMetadata, error)
- func TaskByID(ctx context.Context, id int, t Tasks) (*schema.Task, error)
- func UpdateProjectMetadata(ctx context.Context, id int, key string, value string, p Projects) (*schema.ProjectMetadata, error)
- type APIVersion
- type Config
- type Context
- type Deploy
- type Environments
- type Exporter
- type Importer
- type Me
- type Projects
- type Tasks
Constants ¶
This section is empty.
Variables ¶
var ErrExist = errors.New("object already exists")
ErrExist indicates that an attempt was made to create an object that already exists.
Functions ¶
func ActiveStandbySwitch ¶
ActiveStandbySwitch runs the activestandby switch.
func AddBackupRestore ¶ added in v0.12.2
func AddBackupRestore(ctx context.Context, backupID string, e Environments) (*schema.Restore, error)
AddBackupRestore adds a backup restore based on backup ID.
func DeployBranch ¶
func DeployBranch(ctx context.Context, deploy *schema.DeployEnvironmentBranchInput, m Deploy) (*schema.DeployEnvironmentBranch, error)
DeployBranch deploys a branch.
func DeployLatest ¶
func DeployLatest(ctx context.Context, deploy *schema.DeployEnvironmentLatestInput, m Deploy) (*schema.DeployEnvironmentLatest, error)
DeployLatest deploys the latest environment.
func DeployPromote ¶
func DeployPromote(ctx context.Context, deploy *schema.DeployEnvironmentPromoteInput, m Deploy) (*schema.DeployEnvironmentPromote, error)
DeployPromote promotes one environment into a new environment.
func DeployPullRequest ¶
func DeployPullRequest(ctx context.Context, deploy *schema.DeployEnvironmentPullrequestInput, m Deploy) (*schema.DeployEnvironmentPullrequest, error)
DeployPullRequest deploys a pull request.
func ExportProject ¶
func ExportProject(ctx context.Context, e Exporter, name string, exclude map[string]bool) ([]byte, error)
ExportProject exports the given project by name.
func GetBackupsForEnvironmentByName ¶ added in v0.12.2
func GetBackupsForEnvironmentByName(ctx context.Context, name string, project uint, e Environments) (*schema.Environment, error)
GetBackupsForEnvironmentByName gets backup info in lagoon for specific environment.
func GetLagoonAPIVersion ¶
func GetLagoonAPIVersion(ctx context.Context, l APIVersion) (*schema.LagoonVersion, error)
GetLagoonAPIVersion gets info on the current API version of lagoon, supported in lagoon v1.4.1+
func GetMinimalProjectByName ¶ added in v0.12.0
GetMinimalProjectByName gets info of projects in lagoon that have matching metadata.
func GetProjectMetadata ¶ added in v0.12.0
func GetProjectMetadata(ctx context.Context, name string, p Projects) (*schema.ProjectMetadata, error)
GetProjectMetadata gets the metadata key:values for a lagoon project.
func GetProjectsByMetadata ¶ added in v0.12.0
func GetProjectsByMetadata(ctx context.Context, key string, value string, p Projects) (*[]schema.ProjectMetadata, error)
GetProjectsByMetadata gets info of projects in lagoon that have matching metadata.
func RemoveProjectMetadataByKey ¶ added in v0.12.0
func RemoveProjectMetadataByKey(ctx context.Context, id int, key string, p Projects) (*schema.ProjectMetadata, error)
RemoveProjectMetadataByKey remove metadata from a project by key.
Types ¶
type APIVersion ¶
type APIVersion interface {
LagoonAPIVersion(ctx context.Context, apiVersion *schema.LagoonVersion) error
LagoonSchema(ctx context.Context, lagoonSchema *schema.LagoonSchema) error
}
APIVersion interface contains methods for getting info on the current version of lagoon.
type Config ¶
type Config struct {
Current string `json:"current"`
Default string `json:"default"`
Lagoons map[string]Context `json:"lagoons"`
UpdateCheckDisable bool `json:"updatecheckdisable,omitempty"`
EnvironmentFromDirectory bool `json:"environmentfromdirectory,omitempty"`
}
Config is used for the lagoon configuration.
type Context ¶
type Context struct {
GraphQL string `json:"graphql"`
HostName string `json:"hostname"`
UI string `json:"ui,omitempty"`
Kibana string `json:"kibana,omitempty"`
Port string `json:"port"`
Token string `json:"token,omitempty"`
Version string `json:"version,omitempty"`
}
Context is used for each lagoon context in the config file.
type Deploy ¶
type Deploy interface {
DeployEnvironmentPromote(ctx context.Context, deploy *schema.DeployEnvironmentPromoteInput, result *schema.DeployEnvironmentPromote) error
DeployEnvironmentLatest(ctx context.Context, deploy *schema.DeployEnvironmentLatestInput, result *schema.DeployEnvironmentLatest) error
DeployEnvironmentPullrequest(ctx context.Context, deploy *schema.DeployEnvironmentPullrequestInput, result *schema.DeployEnvironmentPullrequest) error
DeployEnvironmentBranch(ctx context.Context, deploy *schema.DeployEnvironmentBranchInput, result *schema.DeployEnvironmentBranch) error
}
Deploy interface contains methods for deploying branches and environments in lagoon.
type Environments ¶ added in v0.12.2
type Environments interface {
BackupsForEnvironmentByName(context.Context, string, uint, *schema.Environment) error
AddRestore(context.Context, string, *schema.Restore) error
}
Environments interface contains methods for getting info on environments.
type Exporter ¶
type Exporter interface {
ProjectByName(ctx context.Context, name string, project *schema.Project) error
}
Exporter interface contains methods for exporting data from Lagoon.
type Importer ¶
type Importer interface {
AddGroup(context.Context, *schema.AddGroupInput, *schema.Group) error
AddUser(context.Context, *schema.AddUserInput, *schema.User) error
AddSSHKey(context.Context, *schema.AddSSHKeyInput, *schema.SSHKey) error
AddUserToGroup(
context.Context, *schema.UserGroupRoleInput, *schema.Group) error
AddNotificationSlack(context.Context,
*schema.AddNotificationSlackInput,
*schema.NotificationSlack) error
AddNotificationRocketChat(context.Context,
*schema.AddNotificationRocketChatInput,
*schema.NotificationRocketChat) error
AddNotificationEmail(context.Context,
*schema.AddNotificationEmailInput,
*schema.NotificationEmail) error
AddNotificationMicrosoftTeams(context.Context,
*schema.AddNotificationMicrosoftTeamsInput,
*schema.NotificationMicrosoftTeams) error
AddProject(context.Context, *schema.AddProjectInput, *schema.Project) error
AddEnvVariable(
context.Context, *schema.EnvVariableInput, *schema.EnvKeyValue) error
ProjectByName(context.Context, string, *schema.Project) error
AddOrUpdateEnvironment(
context.Context, *schema.AddEnvironmentInput, *schema.Environment) error
EnvironmentByName(context.Context, string, uint, *schema.Environment) error
AddGroupsToProject(
context.Context, *schema.ProjectGroupsInput, *schema.Project) error
AddNotificationToProject(context.Context,
*schema.AddNotificationToProjectInput, *schema.Project) error
AddBillingGroup(
context.Context, *schema.AddBillingGroupInput, *schema.BillingGroup) error
AddProjectToBillingGroup(context.Context, *schema.ProjectBillingGroupInput,
*schema.Project) error
}
Importer interface contains methods for exporting data from Lagoon. TODO: compose this once simpler interfaces are defined.
type Projects ¶ added in v0.12.0
type Projects interface {
MinimalProjectByName(ctx context.Context, name string, project *schema.Project) error
ProjectByNameMetadata(ctx context.Context, name string, project *schema.ProjectMetadata) error
ProjectsByMetadata(ctx context.Context, key string, value string, project *[]schema.ProjectMetadata) error
UpdateProjectMetadata(ctx context.Context, id int, key string, value string, project *schema.ProjectMetadata) error
RemoveProjectMetadataByKey(ctx context.Context, id int, key string, project *schema.ProjectMetadata) error
}
Projects interface contains methods for getting info on projects.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client implements the interfaces required by the parent lagoon package.
|
Package client implements the interfaces required by the parent lagoon package. |
|
lgraphql
Package lgraphql generated by go-bindata.// sources: _lgraphql/addBillingGroup.graphql _lgraphql/addEnvVariable.graphql _lgraphql/addGroup.graphql _lgraphql/addGroupsToProject.graphql _lgraphql/addNotificationEmail.graphql _lgraphql/addNotificationMicrosoftTeams.graphql _lgraphql/addNotificationRocketChat.graphql _lgraphql/addNotificationSlack.graphql _lgraphql/addNotificationToProject.graphql _lgraphql/addOrUpdateEnvironment.graphql _lgraphql/addProject.graphql _lgraphql/addProjectToBillingGroup.graphql _lgraphql/addRestore.graphql _lgraphql/addSshKey.graphql _lgraphql/addUser.graphql _lgraphql/addUserToGroup.graphql _lgraphql/backupsForEnvironmentByName.graphql _lgraphql/deployEnvironmentBranch.graphql _lgraphql/deployEnvironmentLatest.graphql _lgraphql/deployEnvironmentPromote.graphql _lgraphql/deployEnvironmentPullrequest.graphql _lgraphql/environmentByName.graphql _lgraphql/lagoonSchema.graphql _lgraphql/lagoonVersion.graphql _lgraphql/me.graphql _lgraphql/minimalProjectByName.graphql _lgraphql/projectByName.graphql _lgraphql/projectByNameMetadata.graphql _lgraphql/projectsByMetadata.graphql _lgraphql/removeProjectMetadataByKey.graphql _lgraphql/switchActiveStandby.graphql _lgraphql/taskByID.graphql _lgraphql/updateProjectMetadata.graphql
|
Package lgraphql generated by go-bindata.// sources: _lgraphql/addBillingGroup.graphql _lgraphql/addEnvVariable.graphql _lgraphql/addGroup.graphql _lgraphql/addGroupsToProject.graphql _lgraphql/addNotificationEmail.graphql _lgraphql/addNotificationMicrosoftTeams.graphql _lgraphql/addNotificationRocketChat.graphql _lgraphql/addNotificationSlack.graphql _lgraphql/addNotificationToProject.graphql _lgraphql/addOrUpdateEnvironment.graphql _lgraphql/addProject.graphql _lgraphql/addProjectToBillingGroup.graphql _lgraphql/addRestore.graphql _lgraphql/addSshKey.graphql _lgraphql/addUser.graphql _lgraphql/addUserToGroup.graphql _lgraphql/backupsForEnvironmentByName.graphql _lgraphql/deployEnvironmentBranch.graphql _lgraphql/deployEnvironmentLatest.graphql _lgraphql/deployEnvironmentPromote.graphql _lgraphql/deployEnvironmentPullrequest.graphql _lgraphql/environmentByName.graphql _lgraphql/lagoonSchema.graphql _lgraphql/lagoonVersion.graphql _lgraphql/me.graphql _lgraphql/minimalProjectByName.graphql _lgraphql/projectByName.graphql _lgraphql/projectByNameMetadata.graphql _lgraphql/projectsByMetadata.graphql _lgraphql/removeProjectMetadataByKey.graphql _lgraphql/switchActiveStandby.graphql _lgraphql/taskByID.graphql _lgraphql/updateProjectMetadata.graphql |