route

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPCMessageSizeMax int = 5000000 // 5MB

)

Variables

View Source
var (
	ErrCaughtPanic         = handlerError{nil, "caught panic", http.StatusInternalServerError, false, false}
	ErrJSONFailed          = handlerError{nil, "failed to parse JSON", http.StatusBadRequest, false, true}
	ErrJSONBuildFailed     = handlerError{nil, "failed to build JSON response", http.StatusInternalServerError, false, true}
	ErrPostBody            = handlerError{nil, "failed to read request body", http.StatusInternalServerError, false, false}
	ErrAuthNeeded          = handlerError{nil, "unknown API key - check your credentials", http.StatusBadRequest, true, true}
	ErrConfigReadFailed    = handlerError{nil, "failed to read config", http.StatusBadRequest, false, false}
	ErrUpstreamFailed      = handlerError{nil, "failed to create upstream request", http.StatusServiceUnavailable, true, true}
	ErrUpstreamUnavailable = handlerError{nil, "upstream target unavailable", http.StatusServiceUnavailable, true, true}
	ErrReqToEvent          = handlerError{nil, "failed to parse event", http.StatusBadRequest, false, true}
	ErrBatchToEvent        = handlerError{nil, "failed to parse event within batch", http.StatusBadRequest, false, true}
	ErrInvalidContentType  = handlerError{nil, husky.ErrInvalidContentType.Message, husky.ErrInvalidContentType.HTTPStatusCode, false, true}
)
View Source
var ErrGenericMessage = "unexpected error!"

Functions

This section is empty.

Types

type AuthInfo added in v1.11.0

type AuthInfo struct {
	APIKeyAccess map[string]bool `json:"api_key_access"`
	Team         TeamInfo        `json:"team"`
	Environment  EnvironmentInfo `json:"environment"`
}

type BatchResponse

type BatchResponse struct {
	Status int    `json:"status"`
	Error  string `json:"error,omitempty"`
}

type EnvironmentInfo added in v1.12.0

type EnvironmentInfo struct {
	Slug string `json:"slug"`
	Name string `json:"name"`
}

type MockGRPCHealthWatchServer added in v1.16.0

type MockGRPCHealthWatchServer struct {
	grpc_health_v1.Health_WatchServer
	// contains filtered or unexported fields
}

func (*MockGRPCHealthWatchServer) GetSentMessages added in v1.16.0

func (*MockGRPCHealthWatchServer) Send added in v1.16.0

type Router

type Router struct {
	Config               config.Config         `inject:""`
	Logger               logger.Logger         `inject:""`
	HTTPTransport        *http.Transport       `inject:"upstreamTransport"`
	UpstreamTransmission transmit.Transmission `inject:"upstreamTransmission"`
	PeerTransmission     transmit.Transmission `inject:"peerTransmission"`
	Sharder              sharder.Sharder       `inject:""`
	Collector            collect.Collector     `inject:""`
	Metrics              metrics.Metrics       `inject:"genericMetrics"`
	// contains filtered or unexported fields
}

func (*Router) Check added in v1.16.0

func (*Router) LnS

func (r *Router) LnS(incomingOrPeer string)

LnS spins up the Listen and Serve portion of the router. A router is initialized as being for either incoming traffic from clients or traffic from a peer. They listen on different addresses so peer traffic can be prioritized.

func (*Router) SetEnvironmentCache added in v1.11.0

func (r *Router) SetEnvironmentCache(ttl time.Duration, getFn func(string) (string, error))

func (*Router) SetVersion

func (r *Router) SetVersion(ver string)

func (*Router) Stop

func (r *Router) Stop() error

func (*Router) Watch added in v1.16.0

type TeamInfo added in v1.12.0

type TeamInfo struct {
	Slug string `json:"slug"`
}

type TraceServer added in v1.20.0

type TraceServer struct {
	collectortrace.UnimplementedTraceServiceServer
	// contains filtered or unexported fields
}

func NewTraceServer added in v1.20.0

func NewTraceServer(router *Router) *TraceServer

func (*TraceServer) Export added in v1.20.0

Jump to

Keyboard shortcuts

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