config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloud

type GoogleCloud struct {
	AccountFileBase64 string `envconfig:"GOOGLE_CLOUD_ACCOUNT_FILE_BASE64" required:"true"`
	ProjectID         string `envconfig:"GOOGLE_CLOUD_PROJECT_ID" required:"true"`
	Zone              string `envconfig:"GOOGLE_CLOUD_ZONE" default:"-"`
}

GoogleCloud contains the Google cloud related configuration, including credentials and project info

type GoogleCloudAccountFile

type GoogleCloudAccountFile struct {
	// PrivateKeyID is the private key ID given in the account file
	PrivateKeyID string `json:"private_key_id"`
	// PrivateKey is the private key given in the account file
	PrivateKey string `json:"private_key"`
	// ClientEmail is the client email given in the account file
	ClientEmail string `json:"client_email"`
	// ClientID is the client ID given in the account file
	ClientID string `json:"client_id"`
}

GoogleCloudAccountFile represents the structure of the account file JSON file. this struct was adapted from the Terraform project (https://github.com/hashicorp/terraform/blob/master/builtin/providers/google/config.go)

func GoogleCloudAccountInfo

func GoogleCloudAccountInfo(fileBase64 string) (*GoogleCloudAccountFile, error)

GoogleCloudAccountInfo parses the file at fileLoc into a GoogleCloudAccountFile and returns it. Returns nil and an appropriate error if any error occurred in reading or decoding.

type Server

type Server struct {
	BindHost        string `envconfig:"BIND_HOST" default:"0.0.0.0"`
	BindPort        int    `envconfig:"BIND_PORT" default:"8080"`
	Namespace       string `envconfig:"NAMESPACE" default:"k8s-claimer"`
	ServiceName     string `envconfig:"SERVICE_NAME" default:"k8s-claimer"`
	AuthToken       string `envconfig:"AUTH_TOKEN" required:"true"`
	ClearNamespaces bool   `envconfig:"CLEAR_NAMESPACES" default:"false"`
}

Server represents the envconfig-compatible server configuration

func (Server) HostStr

func (s Server) HostStr() string

HostStr returns the full host string for the server, based on s.BindHost and s.BindPort

Jump to

Keyboard shortcuts

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