Documentation ¶
Index ¶
- Constants
- func Marshal(v any) ([]byte, error)
- func MarshalToString(v any) (string, error)
- func RegisterTypeDecoder(typ string, dec jsoniter.ValDecoder)
- func RegisterTypeEncoder(typ string, enc jsoniter.ValEncoder)
- func Unmarshal(data []byte, v any) error
- func UnmarshalFromString(str string, v any) error
- type Decoder
- type Encoder
- type Marshaler
- type RawMessage
- type Type
- type Typer
- type Types
- type Unmarshaler
Constants ¶
const ( TypeKey = "@type" ValueKey = "@value" )
graphson encoding type / value keys
Variables ¶
This section is empty.
Functions ¶
func MarshalToString ¶
MarshalToString returns the graphson encoding of v as string.
func RegisterTypeDecoder ¶
func RegisterTypeDecoder(typ string, dec jsoniter.ValDecoder)
RegisterTypeDecoder register type decoder for typ.
func RegisterTypeEncoder ¶
func RegisterTypeEncoder(typ string, enc jsoniter.ValEncoder)
RegisterTypeEncoder register type encoder for typ.
func Unmarshal ¶
Unmarshal parses the graphson encoded data and stores the result in the value pointed to by v.
func UnmarshalFromString ¶
UnmarshalFromString parses the graphson encoded str and stores the result in the value pointed to by v.
Types ¶
type Marshaler ¶
Marshaler is the interface implemented by types that can marshal themselves as graphson.
type RawMessage ¶
type RawMessage []byte
RawMessage is a raw encoded graphson value.
func (RawMessage) MarshalGraphson ¶
func (m RawMessage) MarshalGraphson() ([]byte, error)
MarshalGraphson returns m as the graphson encoding of m.
func (*RawMessage) UnmarshalGraphson ¶
func (m *RawMessage) UnmarshalGraphson(data []byte) error
UnmarshalGraphson sets *m to a copy of data.
type Type ¶
type Type string
A Type is a graphson type.
type Typer ¶
type Typer interface {
GraphsonType() Type
}
Typer is the interface implemented by types that define an underlying graphson type.
type Types ¶
type Types []Type
Types is a slice of Type.
type Unmarshaler ¶
Unmarshaler is the interface implemented by types that can unmarshal a graphson description of themselves.