codec

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCcontext added in v0.0.10

func CopyCcontext(in context.Context) context.Context

CopyCcontext will copy the input context of `in` to create a new one

Types

type ClientInfo

type ClientInfo struct {
	IP string `json:"ip"`
	UA string `json:"ua"`
}

type MDKey

type MDKey string
const (
	MDMessage MDKey = "HRPC_MD_MESSAGE"
)

func (MDKey) String

func (m MDKey) String() string

type MSG

type MSG interface {
	Context() context.Context

	TraceID() string
	WithTraceID(s string)

	RequestTimeout() time.Duration
	WithRequestTimeout(t time.Duration)

	Namespace() string
	WithNamespace(n string)

	ServerName() string
	WithServerName(n string)

	Client() ClientInfo
	WithClient(ip, ua string)

	Metadata() metadata.MD
}

func Message

func Message(ctx context.Context) MSG

Jump to

Keyboard shortcuts

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