config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config config of fx

func New

func New(dir string) *Config

New create a config

func (*Config) AddMachine

func (c *Config) AddMachine(name string, host Host) error

AddMachine add host

func (*Config) DisableMachine

func (c *Config) DisableMachine(name string) error

DisableMachine disable a machine, after machine disabled, function will not be deployed onto it

func (*Config) EnableMachine

func (c *Config) EnableMachine(name string) error

EnableMachine enable a machine, after machine enabled, function will be deployed onto it when ever `fx up` invoked

func (*Config) GetMachine

func (c *Config) GetMachine(name string) (Host, error)

GetMachine get host by name

func (*Config) Init

func (c *Config) Init() error

Init config

func (*Config) IsMachineProvisioned

func (c *Config) IsMachineProvisioned(name string) bool

IsMachineProvisioned check if machine provisioned

func (*Config) ListActiveMachines

func (c *Config) ListActiveMachines() (map[string]Host, error)

ListActiveMachines list enabled machines

func (*Config) ListMachines

func (c *Config) ListMachines() (map[string]Host, error)

ListMachines list hosts

func (*Config) RemoveHost

func (c *Config) RemoveHost(name string) error

RemoveHost remote a host

func (*Config) UpdateProvisionedStatus

func (c *Config) UpdateProvisionedStatus(name string, ok bool) error

UpdateProvisionedStatus update provisioned status

type Configer

type Configer interface {
	GetMachine(name string) (Host, error)
	AddMachine(name string, host Host) error
	RemoveHost(name string) error
	ListActiveMachines() (map[string]Host, error)
	ListMachines() (map[string]Host, error)
	EnableMachine(name string) error
	DisableMachine(name string) error
	UpdateProvisionedStatus(name string, ok bool) error
}

Configer interface

type Host

type Host struct {
	Host        string
	User        string
	Password    string
	Enabled     bool
	Provisioned bool
}

Host host entity

func NewHost

func NewHost(addr, user, password string) Host

NewHost new a host

func (Host) IsLocal

func (h Host) IsLocal() bool

IsLocal if host is localhost

func (Host) IsRemote

func (h Host) IsRemote() bool

IsRemote is host is remote

func (Host) Valid

func (h Host) Valid() bool

Valid if host is valid

Directories

Path Synopsis
Package mock_config is a generated GoMock package.
Package mock_config is a generated GoMock package.

Jump to

Keyboard shortcuts

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