Documentation
¶
Index ¶
- type ConcurrentSurrogate
- type ErrorSurrogate
- type OutcomeSurrogate
- type SurrogateMapper
- func (m *SurrogateMapper) New(_ ..., create *creates.It) (any, error)
- func (m *SurrogateMapper) ReplaceConcurrent(_ ..., batch *api.ConcurrentBatch, ctx miruken.HandleContext) (string, error)
- func (m *SurrogateMapper) ReplaceError(_ ..., err error, ctx miruken.HandleContext) (string, error)
- func (m *SurrogateMapper) ReplaceOutcome(_ ..., outcome *validates.Outcome, ctx miruken.HandleContext) (string, error)
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) 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
Click to show internal directories.
Click to hide internal directories.