env

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Protect

func Protect(h http.Handler, APIAccessToken string) http.Handler

Protect using: curl -H 'Authorization: Bearer secret' style Modelled after https://github.com/apex/up-examples/blob/master/oss/golang-basic-auth/main.go#L16

func Towr

func Towr(h http.Handler) func(http.ResponseWriter, *http.Request)

Towr is a workaround for gorilla/pat: https://stackoverflow.com/questions/50753049/ Wish I could make this simpler

Types

type Env

type Env struct {
	Code      EnvCode
	Cfg       aws.Config
	AccountID string
}

Env is how we manage our differing {dev,demo,prod} AWS accounts

func New

func New(cfg aws.Config) (e Env, err error)

func (Env) Bucket

func (e Env) Bucket(svc string) string

func (Env) BugzillaDSN

func (e Env) BugzillaDSN() string

func (Env) GetSecret

func (e Env) GetSecret(key string) string

func (Env) SNS

func (e Env) SNS(name, region string) string

func (Env) Udomain

func (e Env) Udomain(service string) string

type EnvCode

type EnvCode int
const (
	EnvUnknown EnvCode = iota // Oops
	EnvDev                    // Development aka Staging
	EnvProd                   // Production
	EnvDemo                   // Demo, which is like Production, for prospective customers to try
)

https://github.com/unee-t/processInvitations/blob/master/sql/1_process_one_invitation_all_scenario_v3.0.sql#L12-L16

Jump to

Keyboard shortcuts

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