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.
Index ¶
- Variables
- func AddNotificationEmail(ctx context.Context, input *schema.AddNotificationEmailInput, n Notification) (*schema.NotificationEmail, error)
- func AddNotificationMicrosoftTeams(ctx context.Context, input *schema.AddNotificationMicrosoftTeamsInput, ...) (*schema.NotificationMicrosoftTeams, error)
- func AddNotificationRocketChat(ctx context.Context, input *schema.AddNotificationRocketChatInput, ...) (*schema.NotificationRocketChat, error)
- func AddNotificationSlack(ctx context.Context, input *schema.AddNotificationSlackInput, n Notification) (*schema.NotificationSlack, error)
- func AddNotificationToProject(ctx context.Context, input *schema.AddNotificationToProjectInput, ...) (*schema.Project, error)
- func AddNotificationWebhook(ctx context.Context, input *schema.AddNotificationWebhookInput, n Notification) (*schema.NotificationWebhook, error)
- func ExportProject(ctx context.Context, e Exporter, name string, exclude map[string]bool) ([]byte, error)
- func GetLagoonAPIVersion(ctx context.Context, l APIVersion) (*schema.LagoonVersion, error)
- func Import(ctx context.Context, i Importer, r io.Reader, keepGoing bool, openshiftID uint) error
- type APIVersion
- type Config
- type Context
- type Exporter
- type Importer
- type Notification
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 AddNotificationEmail ¶ added in v0.18.0
func AddNotificationEmail(ctx context.Context, input *schema.AddNotificationEmailInput, n Notification) (*schema.NotificationEmail, error)
AddNotificationEmail adds a notification.
func AddNotificationMicrosoftTeams ¶ added in v0.18.0
func AddNotificationMicrosoftTeams(ctx context.Context, input *schema.AddNotificationMicrosoftTeamsInput, n Notification) (*schema.NotificationMicrosoftTeams, error)
AddNotificationMicrosoftTeams adds a notification.
func AddNotificationRocketChat ¶ added in v0.18.0
func AddNotificationRocketChat(ctx context.Context, input *schema.AddNotificationRocketChatInput, n Notification) (*schema.NotificationRocketChat, error)
AddNotificationRocketChat adds a notification.
func AddNotificationSlack ¶ added in v0.18.0
func AddNotificationSlack(ctx context.Context, input *schema.AddNotificationSlackInput, n Notification) (*schema.NotificationSlack, error)
AddNotificationSlack adds a notification.
func AddNotificationToProject ¶ added in v0.18.0
func AddNotificationToProject(ctx context.Context, input *schema.AddNotificationToProjectInput, n Notification) (*schema.Project, error)
AddNotificationToProject adds a notification to project.
func AddNotificationWebhook ¶ added in v0.18.0
func AddNotificationWebhook(ctx context.Context, input *schema.AddNotificationWebhookInput, n Notification) (*schema.NotificationWebhook, error)
AddNotificationWebhook adds a notification.
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 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+
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"`
StrictHostKeyChecking string `json:"stricthostkeychecking,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"`
SSHPortal bool `json:"sshPortal,omitempty"`
PublicKeyIdentities []string `json:"publickeyidentities,omitempty"`
}
Context is used for each lagoon context in the config file.
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
}
Importer interface contains methods for exporting data from Lagoon. TODO: compose this once simpler interfaces are defined.
type Notification ¶ added in v0.18.0
type Notification interface {
AddNotificationWebhook(ctx context.Context, input *schema.AddNotificationWebhookInput, result *schema.NotificationWebhook) error
AddNotificationEmail(ctx context.Context, input *schema.AddNotificationEmailInput, result *schema.NotificationEmail) error
AddNotificationRocketChat(ctx context.Context, input *schema.AddNotificationRocketChatInput, result *schema.NotificationRocketChat) error
AddNotificationMicrosoftTeams(ctx context.Context, input *schema.AddNotificationMicrosoftTeamsInput, result *schema.NotificationMicrosoftTeams) error
AddNotificationSlack(ctx context.Context, input *schema.AddNotificationSlackInput, result *schema.NotificationSlack) error
AddNotificationToProject(context.Context, *schema.AddNotificationToProjectInput, *schema.Project) error
}
Notification interface contains methods for adding notifications in Lagoon.