reshifter: github.com/mhausenblas/reshifter/pkg/util Index | Files

package util

import "github.com/mhausenblas/reshifter/pkg/util"

Package util contains various helper functions for ReShifter.

Index

Package Files

cat.go common.go doc.go etcd2.go etcd3.go

func CACertFromEnv Uses

func CACertFromEnv() (string, error)

CACertFromEnv loads the CA cert filepath from the respective environment variable RS_ETCD_CA_CERT.

func Certsdir Uses

func Certsdir() string

Certsdir returns the absolute path to the directory where the pre-generated certs and keys are.

func ClientCertAndKeyFromEnv Uses

func ClientCertAndKeyFromEnv() (string, string, error)

ClientCertAndKeyFromEnv loads the client cert and key filepaths from the respective environment variables RS_ETCD_CLIENT_CERT and RS_ETCD_CLIENT_KEY.

func EtcdDown Uses

func EtcdDown() error

EtcdDown tears down an etcd server.

func ExternalIP Uses

func ExternalIP() (string, error)

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 Uses

func IsBackupID(id string) bool

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 Uses

func LaunchEtcd2(tetcd, port string) (bool, error)

LaunchEtcd2 launches etcd in v2 on port, either in secure or in insecure mode, depending on the scheme used in tetcd.

func LaunchEtcd3 Uses

func LaunchEtcd3(tetcd, port string) (bool, error)

LaunchEtcd3 launches etcd in v3 on port, either in secure or in insecure mode, depending on the scheme used in tetcd.

func LookupDistro Uses

func LookupDistro(distrotype types.KubernetesDistro) string

LookupDistro returns a textual description for a Kube distro by type.

func NewClient2 Uses

func NewClient2(endpoint string, secure bool) (client.Client, error)

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 Uses

func NewClient3(endpoint string, secure bool) (*clientv3.Client, error)

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 Uses

func S3CredFromEnv() (string, string, error)

S3CredFromEnv loads S3 access key and secret from the respective environment variable ACCESS_KEY_ID and SECRET_ACCESS_KEY.

func SetKV2 Uses

func SetKV2(kapi client.KeysAPI, key, val string) error

SetKV2 sets the key with val in an etcd2 cluster and iff val is empty, creates a directory key.

Package util imports 20 packages (graph) and is imported by 7 packages. Updated 2017-12-03. Refresh now. Tools for package owners.