lagoon

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 12 Imported by: 0

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.

Package lagoon implements high-level functions for interacting with the Lagoon API.

Index

Constants

This section is empty.

Variables

View Source
var ErrExist = errors.New("object already exists")

ErrExist indicates that an attempt was made to create an object that already exists.

Functions

func ActiveStandbySwitch

func ActiveStandbySwitch(ctx context.Context, project string, t Tasks) (*schema.Task, error)

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 AddDeployTarget added in v0.15.0

func AddDeployTargetConfiguration added in v0.12.3

AddDeployTargetConfiguration adds a deploytarget config to a specific project.

func DeleteDeployTarget added in v0.15.0

func DeleteDeployTargetConfiguration added in v0.12.3

func DeleteDeployTargetConfiguration(ctx context.Context, id int, project int, dtc DeployTargetConfigs) (*schema.DeleteDeployTargetConfig, error)

DeleteDeployTargetConfiguration deletes a deploytarget config from a specific project.

func DeployBranch

DeployBranch deploys a branch.

func DeployLatest

DeployLatest deploys the latest environment.

func DeployPromote

DeployPromote promotes one environment into a new environment.

func DeployPullRequest

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 GetDeployTargetConfigs added in v0.12.3

func GetDeployTargetConfigs(ctx context.Context, project int, dtc DeployTargetConfigs) (*[]schema.DeployTargetConfig, error)

GetDeployTargetConfigs gets deploytarget configs for a specific project.

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 GetMeInfo

func GetMeInfo(ctx context.Context, m Me) (*schema.User, error)

GetMeInfo gets info on the current user of lagoon.

func GetMinimalProjectByName added in v0.12.0

func GetMinimalProjectByName(ctx context.Context, name string, p Projects) (*schema.Project, error)

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 Import

func Import(ctx context.Context, i Importer, r io.Reader, keepGoing bool,
	openshiftID uint) error

Import creates objects in the Lagoon API based on a configuration object.

func ListDeployTargets added in v0.15.0

func ListDeployTargets(ctx context.Context, out DeployTargets) (*[]schema.DeployTarget, error)

ListDeployTargets gets info of deploytargets in lagoon.

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.

func TaskByID

func TaskByID(ctx context.Context, id int, t Tasks) (*schema.Task, error)

TaskByID returns a task by the associated id

func UpdateDeployTarget added in v0.15.0

func UpdateDeployTargetConfiguration added in v0.12.3

func UpdateDeployTargetConfiguration(ctx context.Context, in *schema.UpdateDeployTargetConfigInput, dtc DeployTargetConfigs) (*schema.DeployTargetConfig, error)

UpdateDeployTargetConfiguration adds a deploytarget config to a specific project.

func UpdateProjectMetadata added in v0.12.0

func UpdateProjectMetadata(ctx context.Context, id int, key string, value string, p Projects) (*schema.ProjectMetadata, error)

UpdateProjectMetadata updates a project with provided metadata.

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"`
	SSHKey   string `json:"sshkey,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 DeployTargetConfigs added in v0.12.3

type DeployTargetConfigs interface {
	DeployTargetConfigsByProjectID(ctx context.Context, project int, deployTargets *[]schema.DeployTargetConfig) error
	AddDeployTargetConfiguration(ctx context.Context, in *schema.AddDeployTargetConfigInput, deployTargets *schema.DeployTargetConfig) error
	UpdateDeployTargetConfiguration(ctx context.Context, in *schema.UpdateDeployTargetConfigInput, deployTargets *schema.DeployTargetConfig) error
	DeleteDeployTargetConfiguration(ctx context.Context, id int, project int, deployTargets *schema.DeleteDeployTargetConfig) error
}

DeployTargetConfigs interface contains methods for getting info on deploytarget configs.

type DeployTargets added in v0.15.0

type DeployTargets interface {
	AddDeployTarget(ctx context.Context, in *schema.AddDeployTargetInput, out *schema.AddDeployTargetResponse) error
	UpdateDeployTarget(ctx context.Context, in *schema.UpdateDeployTargetInput, out *schema.UpdateDeployTargetResponse) error
	DeleteDeployTarget(ctx context.Context, in *schema.DeleteDeployTargetInput, out *schema.DeleteDeployTargetResponse) error
	ListDeployTargets(ctx context.Context, out *[]schema.DeployTarget) error
}

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

Importer interface contains methods for exporting data from Lagoon. TODO: compose this once simpler interfaces are defined.

type Me

type Me interface {
	Me(ctx context.Context, user *schema.User) error
}

Me interface contains methods for getting info on the current user of lagoon.

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.

type Tasks

type Tasks interface {
	RunActiveStandbySwitch(ctx context.Context, project string, result *schema.Task) error
	GetTaskByID(ctx context.Context, id int, result *schema.Task) error
}

Tasks interface contains methods for running tasks in projects and environments in lagoon.

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
Code generated for package lgraphql by go-bindata DO NOT EDIT.
Code generated for package lgraphql by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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