config

package
v0.0.0-...-3d4bac1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogKeyRID is the key to use for request IDs in logging
	LogKeyRID = "request_id"
)

Variables

View Source
var (
	// Commit is the commit hash of this build
	Commit string
)

Functions

func NewGCPConnectionOptions

func NewGCPConnectionOptions() []option.ClientOption

NewGCPConnectionOptions returns options needed to connect to GCP services

Types

type BuildMeta

type BuildMeta struct {
	Commit string
}

BuildMeta denotes build metadata

func NewBuildMeta

func NewBuildMeta() BuildMeta

NewBuildMeta instantiates a new build metadata struct from the environment. Currently leverages Heroku's Dyno Metadata: https://devcenter.heroku.com/articles/dyno-metadata

func (BuildMeta) AnnotatedCommit

func (b BuildMeta) AnnotatedCommit(dev bool) string

AnnotatedCommit returns a dev-prefixed commit if necessary

type Cloud

type Cloud struct {
	GCP CloudGoogle
}

Cloud denotes configuration for different cloud providers

func NewCloudConfig

func NewCloudConfig() Cloud

NewCloudConfig instantiates cloud configuration from environment

func (Cloud) Provider

func (c Cloud) Provider() CloudProvider

Provider returns the configured cloud provider

type CloudGoogle

type CloudGoogle struct {
	ProjectID string
}

CloudGoogle denotes GCP variables

type CloudProvider

type CloudProvider string

CloudProvider denotes supported providers

const (
	// ProviderNone indicates no cloud provider has been set
	ProviderNone CloudProvider = "none"

	// ProviderGCP indicates Google Cloud configuration has been set
	ProviderGCP CloudProvider = "gcp"
)

type Database

type Database struct {
	Host     string
	Port     string
	Database string

	User     string
	Password string

	Drop bool
	TLS  *tls.Config

	// this has priority
	PostgresConnURL string
}

Database denotes database instantiation options

func NewDatabaseConfig

func NewDatabaseConfig() Database

NewDatabaseConfig loads database configuration from environment

type Store

type Store struct {
	Address  string
	Password string

	TLS *tls.Config

	// this has priority
	RedisConnURL string
}

Store denotes store client instantiation options

func NewStoreConfig

func NewStoreConfig() Store

NewStoreConfig loads store configuration from environment

Jump to

Keyboard shortcuts

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