host

package
v0.16.2-gitlab.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSSHClientCreator

func SetSSHClientCreator(creator SSHClientCreator)

func ValidateHostName

func ValidateHostName(name string) bool

Types

type AuthOptionsV1

type AuthOptionsV1 struct {
	StorePath            string
	CaCertPath           string
	CaCertRemotePath     string
	ServerCertPath       string
	ServerKeyPath        string
	ClientKeyPath        string
	ServerCertRemotePath string
	ServerKeyRemotePath  string
	PrivateKeyPath       string
	ClientCertPath       string
}

type Host

type Host struct {
	ConfigVersion int
	Driver        drivers.Driver
	DriverName    string
	HostOptions   *Options
	Name          string
	RawDriver     []byte `json:"-"`
}

func MigrateHost

func MigrateHost(h *Host, data []byte) (*Host, bool, error)

func MigrateHostV2ToHostV3

func MigrateHostV2ToHostV3(hostV2 *V2, data []byte, storePath string) *Host

func (*Host) AuthOptions

func (h *Host) AuthOptions() *auth.Options

func (*Host) ConfigureAllAuth

func (h *Host) ConfigureAllAuth() error

func (*Host) ConfigureAuth

func (h *Host) ConfigureAuth() error

func (*Host) CreateSSHClient

func (h *Host) CreateSSHClient() (ssh.Client, error)

func (*Host) DockerVersion

func (h *Host) DockerVersion() (string, error)

func (*Host) Kill

func (h *Host) Kill() error

func (*Host) Provision

func (h *Host) Provision() error

func (*Host) Restart

func (h *Host) Restart() error

func (*Host) RunSSHCommand

func (h *Host) RunSSHCommand(command string) (string, error)

func (*Host) Start

func (h *Host) Start() error

func (*Host) Stop

func (h *Host) Stop() error

func (*Host) URL

func (h *Host) URL() (string, error)

func (*Host) Upgrade

func (h *Host) Upgrade() error

func (*Host) WaitForDocker

func (h *Host) WaitForDocker() error

type Metadata

type Metadata struct {
	ConfigVersion int
	DriverName    string
	HostOptions   Options
}

func MigrateHostMetadataV0ToHostMetadataV1

func MigrateHostMetadataV0ToHostMetadataV1(m *MetadataV0) *Metadata

MigrateHostMetadataV0ToHostMetadataV1 fills nested host metadata and modifies if needed this is used for configuration updates

type MetadataV0

type MetadataV0 struct {
	HostOptions Options
	DriverName  string

	ConfigVersion  int
	StorePath      string
	CaCertPath     string
	PrivateKeyPath string
	ServerCertPath string
	ServerKeyPath  string
	ClientCertPath string
}

type Options

type Options struct {
	Driver        string
	Memory        int
	Disk          int
	EngineOptions *engine.Options
	SwarmOptions  *swarm.Options
	AuthOptions   *auth.Options
}

type OptionsV1

type OptionsV1 struct {
	Driver        string
	Memory        int
	Disk          int
	EngineOptions *engine.Options
	SwarmOptions  *swarm.Options
	AuthOptions   *AuthOptionsV1
}

type RawDataDriver

type RawDataDriver struct {
	*none.Driver
	Data []byte // passed directly back when invoking json.Marshal on this type
}

func (*RawDataDriver) MarshalJSON

func (r *RawDataDriver) MarshalJSON() ([]byte, error)

func (*RawDataDriver) UnmarshalJSON

func (r *RawDataDriver) UnmarshalJSON(data []byte) error

type RawHost

type RawHost struct {
	Driver *json.RawMessage
}

type SSHClientCreator

type SSHClientCreator interface {
	CreateSSHClient(d drivers.Driver) (ssh.Client, error)
}

type StandardSSHClientCreator

type StandardSSHClientCreator struct {
	drivers.Driver
}

func (*StandardSSHClientCreator) CreateSSHClient

func (creator *StandardSSHClientCreator) CreateSSHClient(d drivers.Driver) (ssh.Client, error)

type V0

type V0 struct {
	Name          string `json:"-"`
	Driver        drivers.Driver
	DriverName    string
	ConfigVersion int
	HostOptions   *Options

	StorePath      string
	CaCertPath     string
	PrivateKeyPath string
	ServerCertPath string
	ServerKeyPath  string
	ClientCertPath string
	SwarmHost      string
	SwarmMaster    bool
	SwarmDiscovery string
	ClientKeyPath  string
}

type V1

type V1 struct {
	ConfigVersion int
	Driver        drivers.Driver
	DriverName    string
	HostOptions   *OptionsV1
	Name          string `json:"-"`
	StorePath     string
}

func MigrateHostV0ToHostV1

func MigrateHostV0ToHostV1(hostV0 *V0) *V1

MigrateHostV0ToHostV1 validates host config and modifies if needed this is used for configuration updates

type V2

type V2 struct {
	ConfigVersion int
	Driver        drivers.Driver
	DriverName    string
	HostOptions   *Options
	Name          string
}

func MigrateHostV1ToHostV2

func MigrateHostV1ToHostV2(hostV1 *V1) *V2

Jump to

Keyboard shortcuts

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