json

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 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 ConcurrentSurrogate added in v0.22.0

type ConcurrentSurrogate []any

ConcurrentSurrogate is a surrogate for api.ConcurrentBatch over json.

func (ConcurrentSurrogate) Original added in v0.22.0

func (s ConcurrentSurrogate) Original() any

type ErrorSurrogate added in v0.22.0

type ErrorSurrogate struct {
	Message string
}

ErrorSurrogate is a surrogate for a generic error over json.

func (*ErrorSurrogate) Original added in v0.22.0

func (s *ErrorSurrogate) Original() any

type OutcomeSurrogate added in v0.22.0

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

OutcomeSurrogate is a surrogate for validates.Outcome over json.

func (OutcomeSurrogate) Original added in v0.22.0

func (s OutcomeSurrogate) Original() any

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 {
		o creates.It `key:"json.OutcomeSurrogate"`
		e creates.It `key:"json.ErrorSurrogate"`
	}, create *creates.It,
) (any, error)

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,
) (string, 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,
) (string, 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,
) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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