Documentation ¶
Index ¶
- Variables
- func BootAndExit(name string, endpointSet EndpointSet)
- func GetClientID(ctx context.Context) string
- func GetRemoteAddr(ctx context.Context) string
- func NewServer(endpointSet EndpointSet) nacelle.Process
- func NewStatsHandler(handler stats.Handler) stats.Handler
- func PopulateClientIDField(ctx context.Context, fields nacelle.LogFields)
- func PopulateRemoteAddrField(ctx context.Context, fields nacelle.LogFields)
- type EndpointSet
- type Middleware
- type StatsHandler
- func (h *StatsHandler) HandleConn(ctx context.Context, stats stats.ConnStats)
- func (h *StatsHandler) HandleRPC(ctx context.Context, stats stats.RPCStats)
- func (h *StatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
- func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TokenClientID = tokenClientID("scarf.client_id") TokenRemoteAddr = tokenRemoteAddr("scarf.remote_addr") )
View Source
var DefaultExtractors = []logging.LogFieldExtractor{ PopulateClientIDField, PopulateRemoteAddrField, }
Functions ¶
func BootAndExit ¶
func BootAndExit(name string, endpointSet EndpointSet)
BootAndExit creates a nacelle Bootstrapper with the given name and initializes and starts a gRPC server with the given endpoint set. This method does not return.
func GetClientID ¶
func GetRemoteAddr ¶
func NewServer ¶
func NewServer(endpointSet EndpointSet) nacelle.Process
func PopulateClientIDField ¶
Types ¶
type EndpointSet ¶
type Middleware ¶
type Middleware interface { Init() error // ApplyUnary decorates a UnaryHandler. ApplyUnary(grpc.UnaryHandler, *grpc.UnaryServerInfo) (grpc.UnaryHandler, error) // ApplyStream decorates a UnaryHandler. ApplyStream(grpc.StreamHandler, *grpc.StreamServerInfo) (grpc.StreamHandler, error) }
Middleware transforms unary and stream handlers into a decorated handler.
type StatsHandler ¶
type StatsHandler struct {
// contains filtered or unexported fields
}
func (*StatsHandler) HandleConn ¶
func (h *StatsHandler) HandleConn(ctx context.Context, stats stats.ConnStats)
func (*StatsHandler) HandleRPC ¶
func (h *StatsHandler) HandleRPC(ctx context.Context, stats stats.RPCStats)
func (*StatsHandler) TagConn ¶
func (h *StatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
func (*StatsHandler) TagRPC ¶
func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
simple/proto
Package proto is a generated protocol buffer package.
|
Package proto is a generated protocol buffer package. |
stream/proto
Package proto is a generated protocol buffer package.
|
Package proto is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.