Documentation ¶
Index ¶
- Constants
- Variables
- func CertsDir(name string) string
- func CreateFolders()
- func CreateKubeConfigPath(name string) (dir, filePath string, dockerPath string)
- func FQDN(name, typeName string) string
- func FQDNVolumeName(name string) string
- func GetBlueprintFolder(blueprint string) (string, error)
- func GetBlueprintLocalFolder(blueprint string) string
- func GetConnectorLogFile() string
- func GetConnectorPIDFile() string
- func GetDataFolder(p string, perms os.FileMode) string
- func GetDockerHost() string
- func GetDockerIP() string
- func GetHelmLocalFolder(chart string) string
- func GetHostname() string
- func GetLocalIPAddresses() []string
- func GetLocalIPAndHostname() (string, string)
- func GetReleasesFolder() string
- func GetShipyardBinaryPath() string
- func HTTPProxyAddress() string
- func HTTPSProxyAddress() string
- func HomeEnvName() string
- func HomeFolder() string
- func ImageCacheLog() string
- func IsHCLFile(path string) bool
- func IsLocalFolder(path string) bool
- func LogsDir() string
- func ReplaceNonURIChars(s string) (string, error)
- func ShipyardHome() string
- func ShipyardTemp() string
- func StateDir() string
- func StatePath() string
- func ValidateName(name string) (bool, error)
- type ClusterConfig
- type Context
Constants ¶
const CacheResourceName string = "docker-cache"
Name of the Cache resource
const ImageVolumeName string = "images"
ImageVolumeName is the name of the volume which stores the images for clusters
const MaxRandomPort = 32767
const MinRandomPort = 30000
const ProxyBypass string = "localhost,127.0.0.1,cluster.local,shipyard.run,svc,consul"
Addresses to bypass when using a HTTP Proxy
Variables ¶
var InvalidBlueprintURIError = fmt.Errorf("Inavlid blueprint URI")
var NameContainsInvalidCharactersError = fmt.Errorf("Name contains invalid characters characters must be either a-z, A-Z, 0-9, -, _")
var NameExceedsMaxLengthError = fmt.Errorf("Name exceeds the max length of 128 characters")
Functions ¶
func CertsDir ¶ added in v0.2.1
CertsDir returns the location of the certificates for the given resource used to secure the Shipyard ingress, usually rooted at $HOME/.shipyard/certs
func CreateFolders ¶ added in v0.1.0
func CreateFolders()
Creates the required file structure in the users Home directory
func CreateKubeConfigPath ¶
CreateKubeConfigPath creates the file path for the KubeConfig file when using Kubernetes cluster
func FQDNVolumeName ¶
FQDNVolumeName creates a full qualified volume name
func GetBlueprintFolder ¶
GetBlueprintFolder parses a blueprint uri and returns the top level blueprint folder if the URI is not a blueprint will return an error
func GetBlueprintLocalFolder ¶
GetBlueprintLocalFolder returns the full storage path for the given blueprint URI
func GetConnectorLogFile ¶ added in v0.2.1
func GetConnectorLogFile() string
GetConnectorLogFile returns the log file used by the connector
func GetConnectorPIDFile ¶ added in v0.2.1
func GetConnectorPIDFile() string
GetConnectorPIDFile returns the connector PID file used by the connector
func GetDataFolder ¶ added in v0.1.0
GetDataFolder creates the data directory used by the application
func GetDockerHost ¶ added in v0.1.18
func GetDockerHost() string
GetDockerHost returns the location of the Docker API depending on the platform
func GetDockerIP ¶ added in v0.1.18
func GetDockerIP() string
GetDockerIP returns the location of the Docker Server IP address
func GetHelmLocalFolder ¶ added in v0.0.20
GetHelmLocalFolder returns the full storage path for the given blueprint URI
func GetHostname ¶ added in v0.2.1
func GetHostname() string
GetHostname returns the hostname for the current machine
func GetLocalIPAddresses ¶ added in v0.2.1
func GetLocalIPAddresses() []string
GetLocalIPAddress returns a list of ip addressses for the local machine
func GetLocalIPAndHostname ¶ added in v0.2.12
GetLocalIPAndHostname returns the IP Address of the machine
func GetReleasesFolder ¶ added in v0.1.0
func GetReleasesFolder() string
GetReleasesFolder return the path of the Shipyard releases
func GetShipyardBinaryPath ¶ added in v0.2.1
func GetShipyardBinaryPath() string
GetShipyardBinaryPath returns the path to the running Shipyard binary
func HTTPProxyAddress ¶ added in v0.3.36
func HTTPProxyAddress() string
HTTPProxyAddress returns the default HTTPProxy used by Nomad and Kubernetes clusters unless the environment variable HTTP_PROXY is set when it returns this value
func HTTPSProxyAddress ¶ added in v0.3.36
func HTTPSProxyAddress() string
HTTPSProxyAddress returns the default HTTPProxy used by Nomad and Kubernetes clusters unless the environment variable HTTPS_PROXY is set when it returns this value
func HomeEnvName ¶ added in v0.2.1
func HomeEnvName() string
HomeEnvName returns the environment variable used to store the home path
func HomeFolder ¶
func HomeFolder() string
HomeFolder returns the users homefolder this will be $HOME on windows and mac and USERPROFILE on windows
func ImageCacheLog ¶ added in v0.0.19
func ImageCacheLog() string
ImageCacheLog returns the location of the image cache log
func IsLocalFolder ¶
IsLocalFolder tests if the given path is a localfolder and can exist in the current filesystem TODO make more robust with error messages to improve UX
func LogsDir ¶ added in v0.2.1
func LogsDir() string
LogsDir returns the location of the logs used to secure the Shipyard ingress, usually $HOME/.shipyard/logs
func ReplaceNonURIChars ¶
ReplaceNonURIChars replaces any characters in the resrouce name which can not be used in a URI
func ShipyardHome ¶
func ShipyardHome() string
ShipyardHome returns the location of the shipyard folder, usually $HOME/.shipyard
func StateDir ¶
func StateDir() string
StateDir returns the location of the shipyard state, usually $HOME/.shipyard/state
func ValidateName ¶
ValidateName ensures that the name for a resource is within certain boundaries Valid characters: [a-z] [A-Z] _ - [0-9] Max length: 128
Types ¶
type ClusterConfig ¶ added in v0.2.16
type ClusterConfig struct { // Location of the Cluster LocalAddress string `json:"local_address"` RemoteAddress string `json:"remote_address"` // Port the API Server is running on APIPort int `json:"api_port"` // Port the API Server is running on reachable from // a remote network RemoteAPIPort int `json:"remote_api_port"` // Port where the connector is running ConnectorPort int `json:"connector_port"` // Number of nodes in the cluster NodeCount int `json:"node_count"` // Does the API use SSL? SSL bool `json:"ssl"` // contains filtered or unexported fields }
ClusterConfig defines a config file which is used to store Nomad cluster connection info
func GetClusterConfig ¶ added in v0.3.2
func GetClusterConfig(name string) (ClusterConfig, string)
GetClusterConfig creates the file path for the Cluster config which stores details such as the API server location
func (*ClusterConfig) APIAddress ¶ added in v0.2.16
func (n *ClusterConfig) APIAddress(context Context) string
APIAddress returns the FQDN for the API server
func (*ClusterConfig) ConnectorAddress ¶ added in v0.2.16
func (n *ClusterConfig) ConnectorAddress(context Context) string
ConnectorAddress returns the FQDN for the gRPC endpoing of the Connector
func (*ClusterConfig) Load ¶ added in v0.2.16
func (n *ClusterConfig) Load(file string) error
Load the config from a file
func (*ClusterConfig) Save ¶ added in v0.2.16
func (n *ClusterConfig) Save(file string) error
Save the config to a file