common

package
v0.0.0-...-4f00c3a Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2020 Lars Eric Scheidler

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name    string
	Version string

	SuccessfulInstances []*Instance
	FailedInstances     []*Instance

	Errors []*Error
}

func NewApplication

func NewApplication(name string, version string) *Application

func (*Application) Close

func (application *Application) Close()

func (*Application) GetInstances

func (application *Application) GetInstances(slog *zap.SugaredLogger, conf *conf.Config, environment string, dryrun bool) error

func (*Application) InstanceCompleted

func (application *Application) InstanceCompleted(function func(string, bool) string) []func() string

func (*Application) InstanceHostnames

func (application *Application) InstanceHostnames() []func() string

func (*Application) Load

func (application *Application) Load(slog *zap.SugaredLogger, config *conf.Config, environment string, dryrun bool) error

func (*Application) Prefetch

func (application *Application) Prefetch(slog *zap.SugaredLogger, environment string) error

func (*Application) Switch

func (application *Application) Switch(slog *zap.SugaredLogger) error

type Applications

type Applications []*Application

func (*Applications) Close

func (applications *Applications) Close()

func (*Applications) Set

func (i *Applications) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.

func (*Applications) String

func (i *Applications) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

type Command

type Command struct {
	Command     string
	Description string

	Stdout       *bytes.Buffer
	StdoutWriter io.Writer
	Stderr       *bytes.Buffer
	StderrWriter io.Writer
	Combined     *bytes.Buffer

	Error error
}

type Error

type Error struct {
	Message string
	Command *Command
}

func (*Error) String

func (e *Error) String() string

type Instance

type Instance struct {
	Commands []*Command
	Errors   []*Error
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(slog *zap.SugaredLogger, hostname string, port string, username string, dryrun bool) *Instance

func (*Instance) Close

func (instance *Instance) Close()

func (*Instance) Completed

func (instance *Instance) Completed(function func(string, bool) string) func() string

func (*Instance) Connect

func (instance *Instance) Connect() error

func (*Instance) Connected

func (instance *Instance) Connected() bool

func (*Instance) CurrentVersion

func (instance *Instance) CurrentVersion() *Version

func (*Instance) Dns

func (instance *Instance) Dns() bool

func (*Instance) GetVersion

func (instance *Instance) GetVersion(application string) *Command

func (*Instance) Hostname

func (instance *Instance) Hostname() string

func (*Instance) NewCommand

func (instance *Instance) NewCommand(command string, description string) *Command

func (*Instance) Prefetch

func (instance *Instance) Prefetch(application string, version string) *Command

func (*Instance) Switch

func (instance *Instance) Switch(application string, version string) *Command

type Version

type Version struct {
	CurrentVersion      string `json:"currentVersion"`
	CurrentVersionMtime string `json:"currentVersionMtime"`
}

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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