settings

package
Version: v0.0.0-...-9a89ba0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2014 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

func NewServiceProvider

func NewServiceProvider() concreteServiceProvider

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 DefaultNetworkDelegate

type DefaultNetworkDelegate interface {
	GetDefaultNetwork() (Network, error)
}

type Disks

type Disks struct {
	System     string            `json:"system"`
	Ephemeral  string            `json:"ephemeral"`
	Persistent map[string]string `json:"persistent"`
}

func (Disks) PersistentDiskPath

func (d Disks) PersistentDiskPath() (path string)

type Env

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

func (Env) GetPassword

func (e Env) GetPassword() string

type Fetcher

type Fetcher func() (Settings, error)

type Network

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

	IP      string `json:"ip"`
	Netmask string `json:"netmask"`
	Gateway string `json:"gateway"`

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

	Mac string `json:"mac"`
}

func (Network) IsDynamic

func (n Network) IsDynamic() bool

type NetworkType

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

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 Network, found bool)

func (Networks) IPs

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

type Service

type Service interface {
	LoadSettings() error

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

	InvalidateSettings() error
}

func NewService

func NewService(
	fs boshsys.FileSystem,
	settingsPath string,
	settingsFetcher Fetcher,
	defaultNetworkDelegate DefaultNetworkDelegate,
	logger boshlog.Logger,
) (service Service)

type ServiceProvider

type ServiceProvider interface {
	NewService(
		boshsys.FileSystem,
		string,
		Fetcher,
		DefaultNetworkDelegate,
		boshlog.Logger,
	) 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"`
}

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