metadata

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithMetadata

func ContextWithMetadata(ctx context.Context, m *Metadata) context.Context

ContextWithMetadata returns a new Context that carries metadata ptr.

Types

type Metadata

type Metadata struct {
	Now        time.Time `json:"-"`
	TraceID    string    `json:"traceId"`
	StatusCode int       `json:"statusCode"`
}

Metadata represent state for each request.

func FromContext

func FromContext(ctx context.Context) (*Metadata, bool)

FromContext returns the Identity value stored in ctx, if any.

func New

func New() *Metadata

Jump to

Keyboard shortcuts

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