json

package
v0.30.112 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concurrent added in v0.26.0

type Concurrent []any

Concurrent is a surrogate for api.ConcurrentBatch over json.

func (Concurrent) Original added in v0.26.0

func (c Concurrent) Original(miruken.Handler) (any, error)

type Error added in v0.26.0

type Error struct {
	Message string
}

Error is a surrogate for a generic error over json.

func (*Error) Original added in v0.26.0

func (s *Error) Original(miruken.Handler) (any, error)

type Outcome added in v0.26.0

type Outcome []struct {
	PropertyName string
	Errors       []string
	Nested       Outcome
}

Outcome is a surrogate for validates.Outcome over json.

func (Outcome) Original added in v0.26.0

func (s Outcome) Original(miruken.Handler) (any, error)

type Sequential added in v0.26.0

type Sequential []any

Sequential is a surrogate for api.SequentialBatch over json.

func (Sequential) Original added in v0.26.0

func (s Sequential) Original(miruken.Handler) (any, error)

type SurrogateMapper added in v0.22.0

type SurrogateMapper struct{}

SurrogateMapper maps concepts to values that are more suitable for transmission over a json api. The replacement type usually implements api.Surrogate to allow infrastructure to obtain the original value using the Original() method.

func (*SurrogateMapper) New added in v0.22.0

func (m *SurrogateMapper) New(
	_ *struct {
		_ creates.It `key:"json.Outcome"`
		_ creates.It `key:"json.Error"`
		_ creates.It `key:"json.Concurrent"`
		_ creates.It `key:"json.Sequential"`
	}, create *creates.It,
) any

func (*SurrogateMapper) ReplaceConcurrent added in v0.22.0

func (m *SurrogateMapper) ReplaceConcurrent(
	_ *struct {
		maps.It
		maps.Format `to:"application/json"`
	}, batch api.ConcurrentBatch,
	ctx miruken.HandleContext,
) (byt []byte, err error)

func (*SurrogateMapper) ReplaceError added in v0.22.0

func (m *SurrogateMapper) ReplaceError(
	_ *struct {
		maps.It
		maps.Format `to:"application/json"`
	}, err error,
	ctx miruken.HandleContext,
) ([]byte, error)

func (*SurrogateMapper) ReplaceOutcome added in v0.22.0

func (m *SurrogateMapper) ReplaceOutcome(
	_ *struct {
		maps.It
		maps.Format `to:"application/json"`
	}, outcome *validates.Outcome,
	ctx miruken.HandleContext,
) ([]byte, error)

func (*SurrogateMapper) ReplaceSequential added in v0.25.0

func (m *SurrogateMapper) ReplaceSequential(
	_ *struct {
		maps.It
		maps.Format `to:"application/json"`
	}, batch api.SequentialBatch,
	ctx miruken.HandleContext,
) (byt []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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