types

package
v0.0.0-...-88878d6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayConfig

type GatewayConfig struct {
	ReadTimeout          time.Duration
	WriteTimeout         time.Duration
	FunctionsProviderURL *url.URL
	NATSAddress          *string
	NATSPort             *int
	PrometheusHost       string
	PrometheusPort       int
}

GatewayConfig for the process.

func (*GatewayConfig) UseExternalProvider

func (g *GatewayConfig) UseExternalProvider() bool

UseExternalProvider decide whether to bypass built-in Docker Swarm engine

func (*GatewayConfig) UseNATS

func (g *GatewayConfig) UseNATS() bool

UseNATS Use NATSor not

type HasEnv

type HasEnv interface {
	Getenv(key string) string
}

HasEnv provides interface for os.Getenv

type HttpResult

type HttpResult struct {
	HeaderCode int
}

type OsEnv

type OsEnv struct {
}

OsEnv implements interface to wrap os.Getenv

func (OsEnv) Getenv

func (OsEnv) Getenv(key string) string

Getenv wraps os.Getenv

type ReadConfig

type ReadConfig struct {
}

ReadConfig constitutes config from env variables

func (ReadConfig) Read

func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig

Read fetches config from environmental variables.

type WriteAdapter

type WriteAdapter struct {
	Writer     http.ResponseWriter
	HttpResult *HttpResult
}

WriteAdapter adapts a ResponseWriter

func NewWriteAdapter

func NewWriteAdapter(w http.ResponseWriter) WriteAdapter

NewWriteAdapter create a new NewWriteAdapter

func (*WriteAdapter) GetHeaderCode

func (w *WriteAdapter) GetHeaderCode() int

GetHeaderCode result from WriteHeader

func (WriteAdapter) Header

func (w WriteAdapter) Header() http.Header

Header adapts Header

func (WriteAdapter) Write

func (w WriteAdapter) Write(data []byte) (int, error)

Write adapts Write

func (WriteAdapter) WriteHeader

func (w WriteAdapter) WriteHeader(i int)

WriteHeader adapts WriteHeader

Jump to

Keyboard shortcuts

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