Documentation ¶
Index ¶
- func Delete(opts *CommandOptions) error
- func Diff(opts *CommandOptions, diffOpts DiffOptions) (int, error)
- func Export(opts *CommandOptions, appName string, overrides ...ExportOption) (int, error)
- func Format(opts *CommandOptions) error
- func Pause(opts *CommandOptions, appName string) error
- func Plan(opts *CommandOptions) (int, error)
- func Publish(opts *CommandOptions, force bool) (int, error)
- func Resume(opts *CommandOptions, appName string) error
- func Validate(opts *CommandOptions) (int, error)
- type CommandOptions
- type DiffOptions
- type ExportOption
- func AssumeEnvName(envName string) ExportOption
- func ConstraintsProvider(cp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
- func CustomResourceExporter(f func(*mdlib.Client, *mdlib.ExportableResource) ([]byte, error)) ExportOption
- func CustomResourceScanner(f func(*mdlib.ApplicationResources) []*mdlib.ExportableResource) ExportOption
- func ExportAll(b bool) ExportOption
- func NotificationsProvider(np func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
- func OnlyAccount(acct string) ExportOption
- func PostDeployProvider(pdp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
- func SetClusters(clusters []string) ExportOption
- func SetEnvironment(envName string) ExportOption
- func VerifyWithProvider(vp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
- type FdReader
- type FdWriter
- type PublishError
- type PublishErrorBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(opts *CommandOptions) error
Delete is a command line interface for removing the management of a delivery config. All management history will be removed.
func Diff ¶
func Diff(opts *CommandOptions, diffOpts DiffOptions) (int, error)
Diff is a command line interface to display differences between a delivery config on disk with what is actively deployed.
func Export ¶
func Export(opts *CommandOptions, appName string, overrides ...ExportOption) (int, error)
Export is a command line interface to discover exportable Spinnaker resources and then optional add those resources to a local delivery config file to be later managed by Spinnaker.
func Format ¶
func Format(opts *CommandOptions) error
Format is a command line interface to format the delivery config file.
func Pause ¶
func Pause(opts *CommandOptions, appName string) error
Pause is a command line interface to pause the management of a Spinnaker application.
func Plan ¶
func Plan(opts *CommandOptions) (int, error)
Plan returns actuation plan for a local delivery config
func Publish ¶
func Publish(opts *CommandOptions, force bool) (int, error)
Publish is a command line interface for publishing a local delivery config to be managed by Spinnaker.
func Resume ¶
func Resume(opts *CommandOptions, appName string) error
Resume is a command line interface to resume the paused management of a Spinnaker application.
func Validate ¶
func Validate(opts *CommandOptions) (int, error)
Validate is a command line interface for validating a local delivery conifg.
Types ¶
type CommandOptions ¶
type CommandOptions struct { ConfigDir string ConfigFile string BaseURL string HTTPClient func(*http.Request) (*http.Response, error) Logger mdlib.Logger Stdout FdWriter Stderr io.Writer Stdin FdReader }
CommandOptions are global options available for each command
func NewCommandOptions ¶
func NewCommandOptions() *CommandOptions
NewCommandOptions creates a new CommandOptions struct with a default logger and stdio
type DiffOptions ¶
type DiffOptions struct { // Brief will only print resources names and indicate the diff status Brief bool // Quiet exit without output, exit code will determine if there are diffs Quiet bool }
DiffOptions allows for optional flags to the Diff command.
type ExportOption ¶
type ExportOption func(o *exportOptions)
ExportOption is an interface to provide custom overrides for the Export command.
func AssumeEnvName ¶
func AssumeEnvName(envName string) ExportOption
AssumeEnvName is an override to Export, if a non-empty string Export will not prompt for the environment name when exporting a new resource not already found in the delivery config.
func ConstraintsProvider ¶
func ConstraintsProvider(cp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
ConstraintsProvider is an override to Export that can be used to customizing how a default environment constraint is generated for newly created environments.
func CustomResourceExporter ¶
func CustomResourceExporter(f func(*mdlib.Client, *mdlib.ExportableResource) ([]byte, error)) ExportOption
CustomResourceExporter is an override to Export that can be used to implement a custom resource exporter. The default exporter is mdlib.ExportResource
func CustomResourceScanner ¶
func CustomResourceScanner(f func(*mdlib.ApplicationResources) []*mdlib.ExportableResource) ExportOption
CustomResourceScanner is an override to Export that can be used to implement a resource scanner if you Spinnaker deployment can manage custom resource types. For example, maybe Spinnaker can manage a "bake" resource to automatically generate an AWS AMI. The default scanner is mdlib.ExportableApplicationResources
func ExportAll ¶
func ExportAll(b bool) ExportOption
ExportAll is an override to Export, when true Export will not prompt and will export all resources found.
func NotificationsProvider ¶
func NotificationsProvider(np func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
NotificationsProvider is an override to Export that can be used to customizing how a default environment notification is generated for newly created environments.
func OnlyAccount ¶
func OnlyAccount(acct string) ExportOption
OnlyAccount is an override to Export, if a non-empty string Export will only attempt to export resources that are found in the provided account.
func PostDeployProvider ¶
func PostDeployProvider(pdp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
PostDeployProvider is an override to Export that can be used to customizing a default postDeploy configuration is generated for new and existing environments.
func SetClusters ¶
func SetClusters(clusters []string) ExportOption
SetClusters sets the clusters to export
func SetEnvironment ¶
func SetEnvironment(envName string) ExportOption
SetEnvironment sets the environment name
func VerifyWithProvider ¶
func VerifyWithProvider(vp func(envName string, current mdlib.DeliveryConfig) []interface{}) ExportOption
VerifyWithProvider is an override to Export that can be used to customizing how a default verifyWith configuration is generated for new and existing environments.
type PublishError ¶
type PublishError struct { Timestamp int64 Status int64 Error string Message string Body PublishErrorBody URL string }
PublishError is the format of an error message upon publishing a delivery config.
type PublishErrorBody ¶
PublishErrorBody is the embedded error message that will be sent upon publishing a delivery config.
func (*PublishErrorBody) UnmarshalJSON ¶
func (body *PublishErrorBody) UnmarshalJSON(b []byte) error
UnmarshalJSON satisfies the json.Unmarshaller