utils

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	XCorrID = "X-Correlation-ID"
)

Variables

This section is empty.

Functions

func NewHystrixHelper

func NewHystrixHelper(commandName string) (*hystrixHelper, error)

func StartUpMessage

func StartUpMessage()

Types

type AppConfig

type AppConfig struct {
	Config             string `json:"config"`
	HTTPListenAddress  string `json:"http"`
	GRPCListenAddress  string `json:"grpc"`
	AuthServiceAddress string `json:"auth"`
}

AppConfig provides the global configuration of the application.

func NewAppConfig

func NewAppConfig(cmd *cobra.Command) (*AppConfig, error)

NewAppConfig sets up all the basic configuration data from flags, env, etc

type CoreRequest

type CoreRequest struct {
	// contains filtered or unexported fields
}

CoreRequest contains the two fields every request should have: a correlation ID and a user ID.

func NewCoreRequest

func NewCoreRequest() *CoreRequest

func (CoreRequest) CorrelateRequest

func (c CoreRequest) CorrelateRequest(h http.Handler) http.Handler

func (*CoreRequest) CorrelationID

func (c *CoreRequest) CorrelationID() string

CorrelationID supports the Correlator interface

type Correlator

type Correlator interface {
	CorrelationID() string
}

Correlator returns the value of X-Correlation-ID from the HTTP request

Jump to

Keyboard shortcuts

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