settings

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootUsername        = "root"
	VCAPUsername        = "vcap"
	AdminGroup          = "admin"
	EphemeralUserPrefix = "bosh_"
)
View Source
const (
	BlobstoreTypeDummy = "dummy"
	BlobstoreTypeLocal = "local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blobstore

type Blobstore struct {
	Type    string                 `json:"provider"`
	Options map[string]interface{} `json:"options"`
}

type BoshEnv

type BoshEnv struct {
	Password string `json:"password"`
}

type DefaultNetworkResolver

type DefaultNetworkResolver interface {
	// Ideally we would find a network based on a MAC address
	// but current CPI implementations do not include it
	GetDefaultNetwork() (Network, error)
}

type DiskSettings

type DiskSettings struct {
	ID       string
	VolumeID string
	Path     string
}

type Disks

type Disks struct {
	// e.g "/dev/sda", "1"
	System string `json:"system"`

	// e.g "/dev/sdb", "2"
	Ephemeral string `json:"ephemeral"`

	// Older CPIs returned disk settings as strings
	// e.g {"disk-3845-43758-7243-38754" => "/dev/sdc"}
	//     {"disk-3845-43758-7243-38754" => "3"}
	// Newer CPIs will populate it in a hash:
	// e.g {"disk-3845-43758-7243-38754" => {"path" => "/dev/sdc"}}
	//     {"disk-3845-43758-7243-38754" => {"volume_id" => "3"}}
	Persistent map[string]interface{} `json:"persistent"`
}

type Env

type Env struct {
	Bosh BoshEnv `json:"bosh"`
}

func (Env) GetPassword

func (e Env) GetPassword() string

type Network

type Network struct {
	Type NetworkType `json:"type"`

	IP       string `json:"ip"`
	Netmask  string `json:"netmask"`
	Gateway  string `json:"gateway"`
	Resolved bool   `json:"resolved"` // was resolved via DHCP

	Default []string `json:"default"`
	DNS     []string `json:"dns"`

	Mac string `json:"mac"`
}

func (Network) IsDHCP

func (n Network) IsDHCP() bool

func (Network) IsVIP

func (n Network) IsVIP() bool

func (Network) String

func (n Network) String() string

type NetworkType

type NetworkType string
const (
	NetworkTypeDynamic NetworkType = "dynamic"
	NetworkTypeVIP     NetworkType = "vip"
)

type Networks

type Networks map[string]Network

func (Networks) DefaultIP

func (n Networks) DefaultIP() (ip string, found bool)

func (Networks) DefaultNetworkFor

func (n Networks) DefaultNetworkFor(category string) (Network, bool)

func (Networks) IPs

func (n Networks) IPs() (ips []string)

func (Networks) NetworkForMac

func (n Networks) NetworkForMac(mac string) (Network, bool)

type Service

type Service interface {
	LoadSettings() error

	// GetSettings does not return error because without settings Agent cannot start.
	GetSettings() Settings

	PublicSSHKeyForUsername(string) (string, error)

	InvalidateSettings() error
}

func NewService

func NewService(
	fs boshsys.FileSystem,
	settingsPath string,
	settingsSource Source,
	defaultNetworkResolver DefaultNetworkResolver,
	logger boshlog.Logger,
) (service Service)

type Settings

type Settings struct {
	AgentID   string    `json:"agent_id"`
	Blobstore Blobstore `json:"blobstore"`
	Disks     Disks     `json:"disks"`
	Env       Env       `json:"env"`
	Networks  Networks  `json:"networks"`
	Ntp       []string  `json:"ntp"`
	Mbus      string    `json:"mbus"`
	VM        VM        `json:"vm"`
}

func (Settings) EphemeralDiskSettings

func (s Settings) EphemeralDiskSettings() DiskSettings

func (Settings) PersistentDiskSettings

func (s Settings) PersistentDiskSettings(diskID string) (DiskSettings, bool)

type Source

type Source interface {
	PublicSSHKeyForUsername(string) (string, error)
	Settings() (Settings, error)
}

type VM

type VM struct {
	Name string `json:"name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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