Documentation
¶
Index ¶
- Constants
- func PeekCheck(scanner Scanner, expected ...ScannerCode) bool
- type BasicErrorable
- type Decodable1
- type Decodable2
- type Decoder
- type Decoding
- type Encodable1
- type Encodable2
- type Encoder
- type Encoding
- type Error
- type Errorable
- type Marshaller
- type Renderer
- type RuneReader
- type Scanner
- type ScannerCode
- type SliceableRuneReader
- type Unmarshaller
Constants ¶
View Source
const EndOfText rune = '\u0003'
Variables ¶
This section is empty.
Functions ¶
func PeekCheck ¶
func PeekCheck(scanner Scanner, expected ...ScannerCode) bool
Types ¶
type BasicErrorable ¶
type BasicErrorable struct {
// contains filtered or unexported fields
}
func (*BasicErrorable) Error ¶
func (s *BasicErrorable) Error(err *Error)
func (*BasicErrorable) Recover ¶
func (s *BasicErrorable) Recover(err interface{}) error
func (*BasicErrorable) SetErrorHandler ¶
func (s *BasicErrorable) SetErrorHandler(handler func(*Error))
func (*BasicErrorable) SetRecoverHandler ¶
func (s *BasicErrorable) SetRecoverHandler(handler func(interface{}) error)
type Decodable1 ¶
type Decodable1 interface {
Decoding(Unmarshaller, reflect.Type) Decoder
}
type Decodable2 ¶
type Decoder ¶
func Decodable2Decoding ¶
func Decodable2Decoding(unmarshaller Unmarshaller, theType reflect.Type) Decoder
func ErrorDecoding ¶
func TryIndirectDecoding ¶
type Encodable1 ¶
type Encodable1 interface {
Encoding(Marshaller, reflect.Type) Encoder
}
type Encodable2 ¶
type Error ¶
type Error struct { Class string Value interface{} }
func ErrorPrint ¶
func ErrorPrintf ¶
func ErrorScanning ¶
func ErrorScanning(got ScannerCode, expected ...ScannerCode) *Error
type Marshaller ¶
type Marshaller interface { Marshal(Renderer, interface{}) error MarshalObject(Renderer, interface{}) MarshalValue(Renderer, reflect.Value) FindEncoder(reflect.Type) Encoder IsCached(reflect.Type) bool CacheEncoder(reflect.Type, Encoder) }
func NewMarshaller ¶
func NewMarshaller(encoding Encoding) Marshaller
type Renderer ¶
type Renderer interface { Errorable io.Writer Print(args ...interface{}) int Printf(format string, args ...interface{}) int WriteNil() int PrintString(string) int StartStruct() int StopStruct() int StartMap() int StopMap() int StartArray() int StopArray() int StartElement(id string) int StopElement(id string) int }
type RuneReader ¶
type Scanner ¶
type Scanner interface { Errorable // get the code on the top of the stack Peek() ScannerCode // scan the next rune, returning the appropriate code // this will step through the scanner's state NextCode() ScannerCode // continue scanning until NextValue() doesn't return Scanning Continue() ScannerCode // scan the next value // this will scan the next complete value NextValue() reflect.Value // scan the next value as a string // this will scan the next complete value, returning the data unparsed NextString() string }
type ScannerCode ¶
type ScannerCode uint8
const ( Scanning ScannerCode = iota ScannedKeyBegin ScannedKeyEnd ScannedLiteralBegin ScannedLiteralEnd ScannedStructBegin ScannedStructEnd ScannedMapBegin ScannedMapEnd ScannedArrayBegin ScannedArrayEnd ScannerInitialized ScannedToEnd ScannerError ScannerBadCode )
func (ScannerCode) Matches ¶
func (sc ScannerCode) Matches(codes ...ScannerCode) bool
func (ScannerCode) Reflection ¶
func (sc ScannerCode) Reflection() ScannerCode
func (ScannerCode) ScannedBegin ¶
func (sc ScannerCode) ScannedBegin() bool
func (ScannerCode) ScannedEnd ¶
func (sc ScannerCode) ScannedEnd() bool
func (ScannerCode) String ¶
func (sc ScannerCode) String() string
type SliceableRuneReader ¶
type SliceableRuneReader interface { RuneReader Mark() Slice() SliceableRuneReader }
func ReadBytes ¶
func ReadBytes(slice []byte) SliceableRuneReader
func ReadSlice ¶
func ReadSlice(slice []rune) SliceableRuneReader
func ReadString ¶
func ReadString(data string) SliceableRuneReader
type Unmarshaller ¶
type Unmarshaller interface { Unmarshal(Scanner, interface{}) error UnmarshalObject(Scanner, interface{}) UnmarshalValue(Scanner, reflect.Value) FindDecoder(reflect.Type) Decoder CacheDecoder(reflect.Type, Decoder) }
func NewUnmarshaller ¶
func NewUnmarshaller(decoding Decoding) Unmarshaller
Source Files
¶
Click to show internal directories.
Click to hide internal directories.