config

package
v0.0.0-...-e8d4eb1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSshAlias

func AddSshAlias(name, ip string) error

AddSshAlias adds a block to the user's ssh configuration file that provides an ssh alias to (typically of a created GCP node) ip (address).

func LocalNameSpace

func LocalNameSpace(username string) string

LocalNameSpace returns the local namespace string. Not having a user or home directory are treated as fatal errors.

func NewNodeDirectMetadataClient

func NewNodeDirectMetadataClient() *http.Client

func NewNodeProxiedMetadataClient

func NewNodeProxiedMetadataClient(sshtrans http.RoundTripper) *http.Client

func RunningInGcp

func RunningInGcp(client *http.Client) bool

func SafeReplaceFile

func SafeReplaceFile(newpath, oldpath string) error

Copied from wikitools

Types

type InstanceConfig

type InstanceConfig struct {
	Family        string `toml:"family"`
	Hardware      string `toml:"hardware"`
	DiskSize      int64  `toml:"disksize,omitempty"`
	Zone          string `toml:"zone,omitempty"`
	Description   string `toml:"description,omitempty"`
	PostSshConfig string `toml:"postsshconfig,omitempty"`
	GitHost       string `toml:"githost,omitempty"`
	UserData      string `toml:"userdata,omitempty"`
}

type NodeMetadata

type NodeMetadata map[string]string

NodeMetadata is the metadata that we have communicated to the node.

func GetNodeMetadata

func GetNodeMetadata(client *http.Client) (NodeMetadata, error)

type Settings

type Settings struct {
	DefaultZone       string                    `toml:"defaultzone"`
	ProjectId         string                    `toml:"projectid"`
	InstanceTypes     map[string]InstanceConfig `toml:"instance"`
	SshPublicKeyFile  string                    `toml:"sshpublickey,omitempty"`
	SshPrivateKeyFile string                    `toml:"sshprivatekey,omitempty"`
	Credential        string                    `toml:"credential,omitempty"`
	DefaultUserData   string                    `toml:"defaultuserdata,omitempty"`
}

func Read

func Read(path string) (*Settings, error)

func (*Settings) Description

func (s *Settings) Description(instancetype, name string) string

func (*Settings) GitCredential

func (s *Settings) GitCredential() (string, error)

func (*Settings) PrivateKeyFile

func (s *Settings) PrivateKeyFile(home string) string

func (*Settings) PublicKeyFile

func (s *Settings) PublicKeyFile(home string) string

func (*Settings) UniqueFamilies

func (s *Settings) UniqueFamilies() []string

UniqueFamilies returns the unique families used in settings.

func (*Settings) UserData

func (s *Settings) UserData(instancetype string) string

func (*Settings) Zone

func (s *Settings) Zone(instancetype string) string

Zone returns the zone for this instancetype.

Jump to

Keyboard shortcuts

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