Documentation
¶
Index ¶
- Variables
- func Feature(config ...func(*Installer)) setup.Feature
- type Either
- type Installer
- type Mapper
- func (m *Mapper) FromBytes(_ ..., byt []byte, _ ..., options Options, _ ..., apiOptions api.Options, ...) (any, error)
- func (m *Mapper) FromReader(_ ..., reader io.Reader, _ ..., options Options, _ ..., apiOptions api.Options, ...) (any, error)
- func (m *Mapper) ToJson(_ ..., it *maps.It, _ ..., options Options, _ ..., apiOptions api.Options, ...) (js any, err error)
- type MessageSurrogate
- type Options
- type ScheduledResult
- type SurrogateMapper
- func (m *SurrogateMapper) DecodeMessage(_ ..., reader io.Reader, it *maps.It, ctx miruken.HandleContext) (msg api.Message, err error)
- func (m *SurrogateMapper) EncodeMessage(_ ..., msg api.Message, it *maps.It, ctx miruken.HandleContext) (io.Writer, error)
- func (m *SurrogateMapper) New(_ ..., create *creates.It) any
- func (m *SurrogateMapper) ReplaceScheduledResult(_ ..., result api.ScheduledResult, ctx miruken.HandleContext) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // KnownTypeFields holds the list of json property names // that can contain type discriminators. KnownTypeFields = []string{"$type", "@type"} // KnownValuesFields holds the list of json property names // that can contain values for discriminated arrays. KnownValuesFields = []string{"$values", "@values"} )
View Source
var ( // CamelCase directs the json encoding of keys to use camelcase notation. CamelCase = miruken.Options(Options{ Transformers: []transform.Transformer{ transform.OnlyForDirection( transform.Marshal, transform.CamelCaseKeys(false)), }, }) )
Functions ¶
Types ¶
type Either ¶
type Either[L, R any] struct { Left bool `json:"left"` Value json.RawMessage `json:"value"` }
Either is a surrogate for either.Monad using standard json.
type Mapper ¶
type Mapper struct{}
Mapper formats to and from json using encoding/json.
func (*Mapper) FromReader ¶
type MessageSurrogate ¶
type MessageSurrogate struct {
Payload json.RawMessage `json:"payload"`
}
MessageSurrogate is a json standard surrogate for api.Message.
type Options ¶
type Options struct { Prefix string Indent string EscapeHTML miruken.Option[bool] Transformers []transform.Transformer }
Options provide options for controlling json encoding.
type ScheduledResult ¶
ScheduledResult is a surrogate for api.ScheduledResult over json.
type SurrogateMapper ¶
type SurrogateMapper struct{}
SurrogateMapper maps concepts to values that are more suitable for transmission over a standard polymorphic json api.
func (*SurrogateMapper) DecodeMessage ¶
func (*SurrogateMapper) EncodeMessage ¶
func (*SurrogateMapper) ReplaceScheduledResult ¶
func (m *SurrogateMapper) ReplaceScheduledResult( _ *struct { maps.It maps.Format `to:"application/json"` }, result api.ScheduledResult, ctx miruken.HandleContext, ) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.