config

package
v0.0.0-...-e2c346a Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeploymentRepo

func NewDeploymentRepo(configService DeploymentConfigService) deploymentRepo

func NewDiskRepo

func NewDiskRepo(configService DeploymentConfigService, uuidGenerator boshuuid.Generator) diskRepo

func NewReleaseRepo

func NewReleaseRepo(configService DeploymentConfigService, uuidGenerator boshuuid.Generator) releaseRepo

func NewStemcellRepo

func NewStemcellRepo(configService DeploymentConfigService, uuidGenerator boshuuid.Generator) stemcellRepo

func NewVMRepo

func NewVMRepo(configService DeploymentConfigService) vMRepo

Types

type DeploymentConfigService

type DeploymentConfigService interface {
	Load() (DeploymentFile, error)
	Save(DeploymentFile) error
}

func NewFileSystemDeploymentConfigService

func NewFileSystemDeploymentConfigService(configPath string, fs boshsys.FileSystem, uuidGenerator boshuuid.Generator, logger boshlog.Logger) DeploymentConfigService

type DeploymentFile

type DeploymentFile struct {
	DirectorID          string           `json:"director_id"`
	InstallationID      string           `json:"installation_id"`
	CurrentVMCID        string           `json:"current_vm_cid"`
	CurrentStemcellID   string           `json:"current_stemcell_id"`
	CurrentDiskID       string           `json:"current_disk_id"`
	CurrentReleaseID    string           `json:"current_release_id"`
	CurrentManifestSHA1 string           `json:"current_manifest_sha1"`
	Disks               []DiskRecord     `json:"disks"`
	Stemcells           []StemcellRecord `json:"stemcells"`
	Releases            []ReleaseRecord  `json:"releases"`
}

type DeploymentRepo

type DeploymentRepo interface {
	UpdateCurrent(manifestSHA1 string) error
	FindCurrent() (manifestSHA1 string, found bool, err error)
}

type DiskRecord

type DiskRecord struct {
	ID              string                 `json:"id"`
	CID             string                 `json:"cid"`
	Size            int                    `json:"size"`
	CloudProperties map[string]interface{} `json:"cloud_properties"`
}

type DiskRepo

type DiskRepo interface {
	UpdateCurrent(diskID string) error
	FindCurrent() (DiskRecord, bool, error)
	ClearCurrent() error
	Save(cid string, size int, cloudProperties map[string]interface{}) (DiskRecord, error)
	Find(cid string) (DiskRecord, bool, error)
	All() ([]DiskRecord, error)
	Delete(DiskRecord) error
}

type ReleaseRecord

type ReleaseRecord struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

type ReleaseRepo

type ReleaseRepo interface {
	UpdateCurrent(recordID string) error
	FindCurrent() (ReleaseRecord, bool, error)
	Save(name, version string) (ReleaseRecord, error)
	Find(name, version string) (ReleaseRecord, bool, error)
}

ReleaseRepo persists releases metadata

type StemcellRecord

type StemcellRecord struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
	CID     string `json:"cid"`
}

type StemcellRepo

type StemcellRepo interface {
	UpdateCurrent(recordID string) error
	FindCurrent() (StemcellRecord, bool, error)
	ClearCurrent() error
	Save(name, version, cid string) (StemcellRecord, error)
	Find(name, version string) (StemcellRecord, bool, error)
	All() ([]StemcellRecord, error)
	Delete(StemcellRecord) error
}

StemcellRepo persists stemcells metadata

type UserConfig

type UserConfig struct {
	DeploymentManifestPath string `json:"deployment"`
}

func (UserConfig) DeploymentConfigPath

func (c UserConfig) DeploymentConfigPath() string

type UserConfigService

type UserConfigService interface {
	Load() (UserConfig, error)
	Save(UserConfig) error
}

func NewFileSystemUserConfigService

func NewFileSystemUserConfigService(configPath string, fs boshsys.FileSystem, logger boshlog.Logger) UserConfigService

type VMRepo

type VMRepo interface {
	FindCurrent() (cid string, found bool, err error)
	UpdateCurrent(cid string) error
	ClearCurrent() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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