conventions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgentHeader web requests
	UserAgentHeader = "user-agent"

	// HostNameHeader remote host name going from grpc-client
	HostNameHeader = "host-name"
)
View Source
const (
	//LoggerLevelHeader notes to change log level in current context of operation
	LoggerLevelHeader = SysHeaderPrefix + "log-lvl"

	//AppNameHeader holds application name for incoming outgoing requests
	AppNameHeader = SysHeaderPrefix + "app-name"

	//AppVersionHeader holds application version for incoming outgoing requests
	AppVersionHeader = SysHeaderPrefix + "app-ver"
)
View Source
const (
	//SysHeaderPrefix common of system GRPC metadata and HTTP headers
	SysHeaderPrefix = "x-sys-"
)

Variables

View Source
var ClientName clientNameExtractor

ClientName user agent extractor

Functions

func GetAppName

func GetAppName(md metadata.MD, defVal string) string

GetAppName -

func GetHostName

func GetHostName(md metadata.MD, defVal string) string

GetHostName -

func GetUserAgent

func GetUserAgent(md metadata.MD, defVal string) string

GetUserAgent -

Types

type GrpcMethodInfo

type GrpcMethodInfo struct {
	ServiceFQN string
	Method     string
	Service    string
	Package    string
}

GrpcMethodInfo ...

func (*GrpcMethodInfo) FromContext

func (m *GrpcMethodInfo) FromContext(ctx context.Context) bool

FromContext ...

func (*GrpcMethodInfo) Init

func (m *GrpcMethodInfo) Init(source string) error

Init ...

func (GrpcMethodInfo) String

func (m GrpcMethodInfo) String() string

func (*GrpcMethodInfo) WrapContext

func (m *GrpcMethodInfo) WrapContext(ctx context.Context) context.Context

WrapContext ...

Jump to

Keyboard shortcuts

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