Documentation ¶
Index ¶
- type Context
- func (c Context) Check() validation.ErrorGroup
- func (c Context) Equals(v any) bool
- func (Context) Generate(rand *rand.Rand, size int) reflect.Value
- func (c Context) MarshalBinary() (data []byte, err error)
- func (c Context) MarshalBinaryWriter(w io.Writer) error
- func (c Context) String() string
- func (c *Context) UnmarshalBinary(data []byte) error
- func (c *Context) UnmarshalBinaryReader(r io.Reader) error
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 New ¶
func New(ctx context.Context, m metadata.Metadata, h headers.Headers) (Context, validation.ErrorGroup)
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 ¶
Equals compares two Context instances for equality.
Interface: comparison.Equaler
func (Context) MarshalBinary ¶
MarshalBinary coverts the Context instance to binary form.
Interface: encoding.BinaryMarshaler
func (Context) MarshalBinaryWriter ¶
MarshalBinaryWriter populates the io.Writer with Context fields in its binary form.
func (*Context) UnmarshalBinary ¶
UnmarshalBinary converts the binary form to a Context instance.
Interface: encoding.BinaryUnmarshaler
Click to show internal directories.
Click to hide internal directories.