utils

package
v0.0.0-...-4c99fb1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: Apache-2.0, MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func FindAndReadFile

func FindAndReadFile(fileName string, fileDesc string) (string, error)

FindAndReadFile loads the specified file from disk

func NewAppConfig

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

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

func NewConfig

func NewConfig(cmd *cobra.Command, defaultConfig interface{}, cfg interface{}) error

func NewHystrixHelper

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

func StartUpMessage

func StartUpMessage(cfg certMgr.AppConfig)

Types

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