Documentation ¶
Index ¶
- Variables
- func AddStdCoders(m *MultiCoder) (err error)
- func DecodeSection(dec Decoder, r io.Reader, name string, v interface{}) (err error)
- func GetSection(dec Decoder, r io.Reader, name string) (s string, err error)
- func StdJSONFunc(req Request) error
- type Coder
- type CoderCallback
- type CoderID
- type CoderKind
- type CoderNames
- type Coders
- type DecodeRequest
- type Decoder
- type Deps
- type EncodeRequest
- type Encoder
- type Enum
- type EnumDecode
- type EnumDecodeRequest
- type EnumDecoder
- type EnumEncodeRequest
- type EnumMethods
- type HandlerFunc
- type LogDecoder
- type MultiCoder
- func (m MultiCoder) AvailableCoders() (names CoderNames)
- func (m MultiCoder) GetCoder(kind CoderKind) (c Coder, err error)
- func (m *MultiCoder) SetCoder(kind CoderKind, c Coder) (err error)
- func (m *MultiCoder) SetCoders(c Coders) (err error)
- func (m MultiCoder) TryAllCoders(cb CoderCallback) (err error)
- func (m MultiCoder) UseCoder(kind CoderKind, cb CoderCallback) (err error)
- type MultiSetupFn
- type PartDecoder
- type Request
- type RequestKind
- type StdJsonDecoder
- type StdJsonEncoder
- type StdXmlDecoder
- type StdXmlEncoder
- type TagToAny
- type TagToType
- type TypeTags
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StdCoders = Coders{ JsonCoder: Json, XmlCoder: Xml, } StdCoderMap = map[CoderID]HandlerFunc{ CoderStdJSON: StdJSONFunc, } )
View Source
var Json = Coder{ Decoder: NewStdJsonDecoder(), Encoder: NewStdJsonEncoder(), }
View Source
var Xml = Coder{ Decoder: NewStdXmlDecoder(), Encoder: NewStdXmlEncoder(), }
Functions ¶
func AddStdCoders ¶
func AddStdCoders(m *MultiCoder) (err error)
func DecodeSection ¶
func StdJSONFunc ¶
Types ¶
type CoderCallback ¶
type CoderNames ¶
type CoderNames []string
type DecodeRequest ¶
func (DecodeRequest) RequestKind ¶
func (DecodeRequest) RequestKind() RequestKind
func (DecodeRequest) ToEnumRequest ¶
func (d DecodeRequest) ToEnumRequest(t TagToType) EnumDecodeRequest
type EncodeRequest ¶
func (EncodeRequest) RequestKind ¶
func (EncodeRequest) RequestKind() RequestKind
func (EncodeRequest) ToEnumRequest ¶
func (e EncodeRequest) ToEnumRequest(t TagToType) EnumEncodeRequest
type Enum ¶
type Enum struct { Tag string `json:"tag"` Data json.RawMessage `json:"data"` }
func EnumFromBytes ¶
func EnumFromString ¶
type EnumDecodeRequest ¶
type EnumDecodeRequest struct { DecodeRequest DecodeRequest TagToType TagToType }
type EnumDecoder ¶
type EnumDecoder struct {
// contains filtered or unexported fields
}
func NewEnumDecoder ¶
func NewEnumDecoder(dec Decoder) EnumDecoder
func (EnumDecoder) EnumDecode ¶
type EnumEncodeRequest ¶
type EnumEncodeRequest struct { EncodeRequest EncodeRequest TagToType TagToType }
type EnumMethods ¶
type EnumMethods struct { AsTagToType func(TagToAny) TagToType Decode func(Deps, EnumDecodeRequest) error Encode func(Deps, EnumEncodeRequest) error }
type HandlerFunc ¶
type LogDecoder ¶
type LogDecoder struct {
// contains filtered or unexported fields
}
type MultiCoder ¶
type MultiCoder struct {
// contains filtered or unexported fields
}
func MustSetupMultiCoder ¶
func MustSetupMultiCoder(fn MultiSetupFn) (m MultiCoder)
func SetupMultiCoder ¶
func SetupMultiCoder(fn MultiSetupFn) (m MultiCoder, err error)
func StdMultiCoder ¶
func StdMultiCoder() (m MultiCoder, err error)
func (MultiCoder) AvailableCoders ¶
func (m MultiCoder) AvailableCoders() (names CoderNames)
func (*MultiCoder) SetCoders ¶
func (m *MultiCoder) SetCoders(c Coders) (err error)
func (MultiCoder) TryAllCoders ¶
func (m MultiCoder) TryAllCoders(cb CoderCallback) (err error)
func (MultiCoder) UseCoder ¶
func (m MultiCoder) UseCoder(kind CoderKind, cb CoderCallback) (err error)
type MultiSetupFn ¶
type MultiSetupFn func(m *MultiCoder) (err error)
type PartDecoder ¶
type Request ¶
type Request interface {
RequestKind() RequestKind
}
type StdJsonDecoder ¶
type StdJsonDecoder struct{}
func NewStdJsonDecoder ¶
func NewStdJsonDecoder() (s *StdJsonDecoder)
type StdJsonEncoder ¶
type StdJsonEncoder struct{}
func NewStdJsonEncoder ¶
func NewStdJsonEncoder() (s *StdJsonEncoder)
type StdXmlDecoder ¶
type StdXmlDecoder struct{}
func NewStdXmlDecoder ¶
func NewStdXmlDecoder() (s *StdXmlDecoder)
type StdXmlEncoder ¶
type StdXmlEncoder struct{}
func NewStdXmlEncoder ¶
func NewStdXmlEncoder() (s *StdXmlEncoder)
type TagToAny ¶
func (TagToAny) AsTagToType ¶
Click to show internal directories.
Click to hide internal directories.