op

package
v0.0.0-...-f94be1b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, op *Operation) context.Context

NewContext returns a new context with the given Operation.

Types

type Operation

type Operation int

Operation defines an operation type.

const (
	Read Operation = iota
	Write
	Delete
)

Operations

func FromContext

func FromContext(ctx context.Context) (*Operation, error)

FromContext retrieves the *op.Action stored against the op.CtxKey from the context.

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the Marshaler interface for marshaling op.Action type.

func (Operation) String

func (o Operation) String() string

String is the implementation of Stringer interface that returns the string representation of op.Action.

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(bytes []byte) error

UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling op.Action type.

Jump to

Keyboard shortcuts

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