infrastructure

package
v2.240.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultiSettingsSource

func NewMultiSettingsSource(sources ...boshsettings.Source) (boshsettings.Source, error)

Types

type CDROMSettingsSource

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

func NewCDROMSettingsSource

func NewCDROMSettingsSource(
	settingsFileName string,
	platform boshplatform.Platform,
	logger boshlog.Logger,
) *CDROMSettingsSource

func (CDROMSettingsSource) PublicSSHKeyForUsername

func (s CDROMSettingsSource) PublicSSHKeyForUsername(string) (string, error)

func (*CDROMSettingsSource) Settings

type CDROMSourceOptions

type CDROMSourceOptions struct {
	FileName string
}

type ComplexSettingsSource

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

func NewComplexSettingsSource

func NewComplexSettingsSource(
	metadataService MetadataService,
	registryProvider RegistryProvider,
	logger boshlog.Logger,
) ComplexSettingsSource

func (ComplexSettingsSource) GetMetadataService

func (s ComplexSettingsSource) GetMetadataService() MetadataService

func (ComplexSettingsSource) PublicSSHKeyForUsername

func (s ComplexSettingsSource) PublicSSHKeyForUsername(string) (string, error)

func (ComplexSettingsSource) Settings

type ConfigDriveSettingsSource

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

func NewConfigDriveSettingsSource

func NewConfigDriveSettingsSource(
	diskPaths []string,
	metadataPath string,
	settingsPath string,
	platform boshplatform.Platform,
	logger boshlog.Logger,
) *ConfigDriveSettingsSource

func (*ConfigDriveSettingsSource) PublicSSHKeyForUsername

func (s *ConfigDriveSettingsSource) PublicSSHKeyForUsername(string) (string, error)

func (*ConfigDriveSettingsSource) Settings

type ConfigDriveSourceOptions

type ConfigDriveSourceOptions struct {
	DiskPaths []string

	MetaDataPath string
	UserDataPath string

	SettingsPath string
}

type DNSResolver

type DNSResolver interface {
	LookupHost(dnsServers []string, endpoint string) (string, error)
}

func NewRegistryEndpointResolver

func NewRegistryEndpointResolver(resolver DNSResolver) DNSResolver

type DigDNSResolver

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

func NewDigDNSResolver

func NewDigDNSResolver(runner boshsys.CmdRunner, logger boshlog.Logger) DigDNSResolver

func (DigDNSResolver) LookupHost

func (res DigDNSResolver) LookupHost(dnsServers []string, host string) (string, error)

type DynamicMetadataService

type DynamicMetadataService interface {
	MetadataService
	GetValueAtPath(string) (string, error)
}

func NewHTTPMetadataService

func NewHTTPMetadataService(
	metadataHost string,
	metadataHeaders map[string]string,
	userdataPath string,
	instanceIDPath string,
	sshKeysPath string,
	resolver DNSResolver,
	platform boshplat.Platform,
	logger boshlog.Logger,
) DynamicMetadataService

func NewHTTPMetadataServiceWithCustomRetryDelay

func NewHTTPMetadataServiceWithCustomRetryDelay(
	metadataHost string,
	metadataHeaders map[string]string,
	userdataPath string,
	instanceIDPath string,
	sshKeysPath string,
	resolver DNSResolver,
	platform boshplat.Platform,
	logger boshlog.Logger,
	retryDelay time.Duration,
) DynamicMetadataService

type FileSettingsSource

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

func NewFileSettingsSource

func NewFileSettingsSource(
	settingsFilePath string,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) *FileSettingsSource

func (*FileSettingsSource) PublicSSHKeyForUsername

func (s *FileSettingsSource) PublicSSHKeyForUsername(string) (string, error)

func (*FileSettingsSource) Settings

func (s *FileSettingsSource) Settings() (boshsettings.Settings, error)

type FileSourceOptions

type FileSourceOptions struct {
	MetaDataPath string
	UserDataPath string

	SettingsPath string
}

type HTTPMetadataService

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

func (HTTPMetadataService) GetInstanceID

func (ms HTTPMetadataService) GetInstanceID() (string, error)

func (HTTPMetadataService) GetNetworks

func (ms HTTPMetadataService) GetNetworks() (boshsettings.Networks, error)

func (HTTPMetadataService) GetPublicKey

func (ms HTTPMetadataService) GetPublicKey() (string, error)

func (HTTPMetadataService) GetRegistryEndpoint

func (ms HTTPMetadataService) GetRegistryEndpoint() (string, error)

func (HTTPMetadataService) GetServerName

func (ms HTTPMetadataService) GetServerName() (string, error)

func (HTTPMetadataService) GetSettings

func (ms HTTPMetadataService) GetSettings() (boshsettings.Settings, error)

func (HTTPMetadataService) GetValueAtPath

func (ms HTTPMetadataService) GetValueAtPath(path string) (string, error)

func (HTTPMetadataService) IsAvailable

func (ms HTTPMetadataService) IsAvailable() bool

func (HTTPMetadataService) Load

func (ms HTTPMetadataService) Load() error

type HTTPSourceOptions

type HTTPSourceOptions struct {
	URI            string
	Headers        map[string]string
	UserDataPath   string
	InstanceIDPath string
	SSHKeysPath    string
}

type InstanceMetadataSettingsSource

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

func NewInstanceMetadataSettingsSource

func NewInstanceMetadataSettingsSource(
	metadataHost string,
	metadataHeaders map[string]string,
	settingsPath string,
	platform boshplatform.Platform,
	logger boshlog.Logger,
) *InstanceMetadataSettingsSource

func NewInstanceMetadataSettingsSourceWithoutRetryDelay

func NewInstanceMetadataSettingsSourceWithoutRetryDelay(
	metadataHost string,
	metadataHeaders map[string]string,
	settingsPath string,
	platform boshplatform.Platform,
	logger boshlog.Logger,
) *InstanceMetadataSettingsSource

func (InstanceMetadataSettingsSource) PublicSSHKeyForUsername

func (s InstanceMetadataSettingsSource) PublicSSHKeyForUsername(string) (string, error)

func (*InstanceMetadataSettingsSource) Settings

type InstanceMetadataSourceOptions

type InstanceMetadataSourceOptions struct {
	URI          string
	Headers      map[string]string
	SettingsPath string
}

type MetadataContentsType

type MetadataContentsType struct {
	PublicKeys map[string]PublicKeyType `json:"public-keys"`
	InstanceID string                   `json:"instance-id"` // todo remove
}

type MetadataService

type MetadataService interface {
	IsAvailable() bool
	GetPublicKey() (string, error)
	GetInstanceID() (string, error)
	GetServerName() (string, error)
	GetRegistryEndpoint() (string, error)
	GetNetworks() (boshsettings.Networks, error)
	GetSettings() (boshsettings.Settings, error)
}

func NewConfigDriveMetadataService

func NewConfigDriveMetadataService(
	resolver DNSResolver,
	platform boshplatform.Platform,
	diskPaths []string,
	metaDataFilePath string,
	userDataFilePath string,
	logger boshlog.Logger,
) MetadataService

func NewFileMetadataService

func NewFileMetadataService(
	metaDataFilePath string,
	userDataFilePath string,
	settingsFilePath string,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) MetadataService

func NewMultiSourceMetadataService

func NewMultiSourceMetadataService(services ...MetadataService) MetadataService

type MetadataServiceOptions

type MetadataServiceOptions struct {
	UseConfigDrive bool
}

type MetadataServiceProvider

type MetadataServiceProvider interface {
	Get() MetadataService
}

type MultiSettingsSource

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

func (*MultiSettingsSource) PublicSSHKeyForUsername

func (s *MultiSettingsSource) PublicSSHKeyForUsername(username string) (string, error)

func (*MultiSettingsSource) Settings

type MultiSourceMetadataService

type MultiSourceMetadataService struct {
	Services []MetadataService
	// contains filtered or unexported fields
}

func (*MultiSourceMetadataService) GetInstanceID

func (ms *MultiSourceMetadataService) GetInstanceID() (string, error)

func (*MultiSourceMetadataService) GetNetworks

func (*MultiSourceMetadataService) GetPublicKey

func (ms *MultiSourceMetadataService) GetPublicKey() (string, error)

func (*MultiSourceMetadataService) GetRegistryEndpoint

func (ms *MultiSourceMetadataService) GetRegistryEndpoint() (string, error)

func (*MultiSourceMetadataService) GetServerName

func (ms *MultiSourceMetadataService) GetServerName() (string, error)

func (*MultiSourceMetadataService) GetSettings

func (*MultiSourceMetadataService) IsAvailable

func (ms *MultiSourceMetadataService) IsAvailable() bool

type Options

type Options struct {
	Settings SettingsOptions
}

type PublicKeyContent

type PublicKeyContent struct {
	PublicKey string `json:"public_key"`
}

type PublicKeyType

type PublicKeyType map[string]string

type Registry

type Registry interface {
	GetSettings() (boshsettings.Settings, error)
}

func NewFileRegistry

func NewFileRegistry(registryFilePath string, fs boshsys.FileSystem) Registry

func NewHTTPRegistry

func NewHTTPRegistry(
	metadataService MetadataService,
	platform boshplat.Platform,
	useServerNameAsID bool,
	logger boshlog.Logger,
) Registry

func NewHTTPRegistryWithCustomDelay

func NewHTTPRegistryWithCustomDelay(
	metadataService MetadataService,
	platform boshplat.Platform,
	useServerNameAsID bool,
	logger boshlog.Logger,
	retryDelay time.Duration,
) Registry

type RegistryProvider

type RegistryProvider interface {
	GetRegistry() (Registry, error)
}

func NewRegistryProvider

func NewRegistryProvider(
	metadataService MetadataService,
	platform boshplat.Platform,
	useServerName bool,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) RegistryProvider

type SettingsOptions

type SettingsOptions struct {
	Sources       SourceOptionsSlice
	UseServerName bool
	UseRegistry   bool
}

type SettingsSourceFactory

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

func NewSettingsSourceFactory

func NewSettingsSourceFactory(
	options SettingsOptions,
	platform boshplat.Platform,
	logger boshlog.Logger,
) SettingsSourceFactory

func (SettingsSourceFactory) New

type SourceOptions

type SourceOptions interface {
	// contains filtered or unexported methods
}

type SourceOptionsSlice

type SourceOptionsSlice []SourceOptions

SourceOptionsSlice is used for unmarshalling different source types

func (*SourceOptionsSlice) UnmarshalJSON

func (s *SourceOptionsSlice) UnmarshalJSON(data []byte) error

type UserDataContentsType

type UserDataContentsType struct {
	boshsettings.Settings

	Registry struct {
		Endpoint string
	}
	Server struct {
		Name string // Name given by CPI e.g. vm-384sd4-r7re9e...
	}
	DNS struct {
		Nameserver []string
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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