Documentation ¶
Overview ¶
Package util contains various helper functions for ReShifter.
Index ¶
- func CACertFromEnv() (string, error)
- func Certsdir() string
- func ClientCertAndKeyFromEnv() (string, string, error)
- func EtcdDown() error
- func ExternalIP() (string, error)
- func IsBackupID(id string) bool
- func LaunchEtcd2(tetcd, port string) (bool, error)
- func LaunchEtcd3(tetcd, port string) (bool, error)
- func LookupDistro(distrotype types.KubernetesDistro) string
- func NewClient2(endpoint string, secure bool) (client.Client, error)
- func NewClient3(endpoint string, secure bool) (*clientv3.Client, error)
- func S3CredFromEnv() (string, string, error)
- func SetKV2(kapi client.KeysAPI, key, val string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CACertFromEnv ¶
CACertFromEnv loads the CA cert filepath from the respective environment variable RS_ETCD_CA_CERT.
func Certsdir ¶
func Certsdir() string
Certsdir returns the absolute path to the directory where the pre-generated certs and keys are.
func ClientCertAndKeyFromEnv ¶
ClientCertAndKeyFromEnv loads the client cert and key filepaths from the respective environment variables RS_ETCD_CLIENT_CERT and RS_ETCD_CLIENT_KEY.
func ExternalIP ¶
ExternalIP retrieves the public IP of the host ReShifter is running on, adapted from: https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go
func IsBackupID ¶
IsBackupID tests if a string is a valid backup ID. A valid backup ID is a 10 digit integer, representing a Unix timestamp, for example, 1499588813.
func LaunchEtcd2 ¶
LaunchEtcd2 launches etcd in v2 on port, either in secure or in insecure mode, depending on the scheme used in tetcd.
func LaunchEtcd3 ¶
LaunchEtcd3 launches etcd in v3 on port, either in secure or in insecure mode, depending on the scheme used in tetcd.
func LookupDistro ¶
func LookupDistro(distrotype types.KubernetesDistro) string
LookupDistro returns a textual description for a Kube distro by type.
func NewClient2 ¶
NewClient2 creates an etcd2 client, optionally using SSL/TLS if secure is true. The endpoint is an URL such as http://localhost:2379.
func NewClient3 ¶
NewClient3 creates an etcd3 client, optionally using SSL/TLS if secure is true. The endpoint is an URL such as http://localhost:2379.
func S3CredFromEnv ¶
S3CredFromEnv loads S3 access key and secret from the respective environment variable ACCESS_KEY_ID and SECRET_ACCESS_KEY.
Types ¶
This section is empty.