context

package
v0.0.0-...-a26ebea Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Context  context.Context   `json:"-"`
	Metadata metadata.Metadata `json:"metadata"`
	Headers  headers.Headers   `json:"headers"`
	Clock    clock.Clock       `json:"-"`
}

func Generate

func Generate(rand *rand.Rand) Context

Generate a random Context value.

func New

New creates and validates a new Context from the given metadata/headers.

func (Context) Check

func (c Context) Check() validation.ErrorGroup

Check runs default validation checks for the Context.

func (Context) Equals

func (c Context) Equals(v any) bool

Equals compares two Context instances for equality.

Interface: comparison.Equaler

func (Context) Generate

func (Context) Generate(rand *rand.Rand, size int) reflect.Value

Generate random Context values.

Interface: quick.Generator

func (Context) MarshalBinary

func (c Context) MarshalBinary() (data []byte, err error)

MarshalBinary coverts the Context instance to binary form.

Interface: encoding.BinaryMarshaler

func (Context) MarshalBinaryWriter

func (c Context) MarshalBinaryWriter(w io.Writer) error

MarshalBinaryWriter populates the io.Writer with Context fields in its binary form.

func (Context) String

func (c Context) String() string

String value of the Context.

Interface: fmt.Stringer.

func (*Context) UnmarshalBinary

func (c *Context) UnmarshalBinary(data []byte) error

UnmarshalBinary converts the binary form to a Context instance.

Interface: encoding.BinaryUnmarshaler

func (*Context) UnmarshalBinaryReader

func (c *Context) UnmarshalBinaryReader(r io.Reader) error

UnmarshalBinaryReader populates Context fields from an io.Reader returning the binary form.

Jump to

Keyboard shortcuts

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