Documentation ¶
Index ¶
- Variables
- func Encode(term Term, b *lib.Buffer, linkAtomCache *AtomCache, ...) (retErr error)
- func NewInvalidTypesError(t reflect.Type, term Term) error
- func ReleaseListAtomCache(l *ListAtomCache)
- func StringTerm(t Term) (s string, ok bool)
- func TermIntoStruct(term Term, dest interface{}) (err error)
- func TermMapIntoStruct(term Term, dest interface{}) (err error)
- func TermProplistIntoStruct(term Term, dest interface{}) (err error)
- type Atom
- type AtomCache
- type CacheItem
- type Export
- type Function
- type InvalidStructKeyError
- type List
- type ListAtomCache
- type Map
- type Pid
- type Port
- type ProplistElement
- type Ref
- type StructPopulatorError
- type Term
- type Tuple
Constants ¶
This section is empty.
Variables ¶
var (
ErrStringTooLong = fmt.Errorf("Encoding error. String too long")
)
Functions ¶
func ReleaseListAtomCache ¶
func ReleaseListAtomCache(l *ListAtomCache)
func StringTerm ¶
func TermIntoStruct ¶
TermIntoStruct transforms 'term' (etf.Term, etf.List, etf.Tuple, etf.Map) into the given 'dest' (could be a struct, map, slice or array). Its a pretty expencive operation in terms of CPU usage so you shouldn't use it on highload parts of your code. Use manual type casting instead.
func TermMapIntoStruct ¶ added in v1.2.0
TermMapIntoSturct transforms etf.Map into the given 'dest'. There are limitations to use this helper. A key of the given etf.Map must be a string or etf.Atom. 'dest' must be a structure with specified tag 'etf' and the name of a key for every single field.
func TermProplistIntoStruct ¶ added in v1.2.0
ProplistIntoStruct transorms given term into the provided struct 'dest'. Proplist is the list of Tuple values with two items { Name , Value }, where Name can be string or Atom and Value must be the same type as it has the field of 'dest' struct with the equivalent name. Its also accepts []ProplistElement as a 'term' value
Types ¶
type AtomCache ¶
func NewAtomCache ¶
type InvalidStructKeyError ¶
type InvalidStructKeyError struct {
Term Term
}
func (*InvalidStructKeyError) Error ¶
func (s *InvalidStructKeyError) Error() string
type ListAtomCache ¶
type ListAtomCache struct { L []CacheItem HasLongAtom bool // contains filtered or unexported fields }
func TakeListAtomCache ¶
func TakeListAtomCache() *ListAtomCache
func (*ListAtomCache) Append ¶
func (l *ListAtomCache) Append(a CacheItem)
func (*ListAtomCache) Len ¶
func (l *ListAtomCache) Len() int
func (*ListAtomCache) Reset ¶
func (l *ListAtomCache) Reset()
type ProplistElement ¶ added in v1.2.0
type StructPopulatorError ¶
func (*StructPopulatorError) Error ¶
func (s *StructPopulatorError) Error() string