package graphson
import "entgo.io/ent/dialect/gremlin/encoding/graphson"
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
- func (m RawMessage) MarshalGraphson() ([]byte, error)
- func (m *RawMessage) UnmarshalGraphson(data []byte) error
- type Type
- type Typer
- type Types
- func (types Types) CheckType(typ Type) error
- func (types Types) Contains(typ Type) bool
- func (types Types) String() string
- type Unmarshaler
Constants ¶
const ( TypeKey = "@type" ValueKey = "@value" )
graphson encoding type / value keys
Functions ¶
func Marshal ¶
Marshal returns the graphson encoding of v.
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 Decoder ¶
Decoder defines a graphson decoder.
func NewDecoder ¶
NewDecoder create a graphson decoder.
type Encoder ¶
Encoder defines a graphson encoder.
func NewEncoder ¶
NewEncoder create a graphson encoder.
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.
graphson typed value types.
func (Type) CheckType ¶
CheckType implements typeChecker interface.
func (Type) String ¶
String implements fmt.Stringer interface.
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.
func (Types) CheckType ¶
CheckType implements typeChecker interface.
func (Types) Contains ¶
Contains reports whether a slice of types contains a particular type.
func (Types) String ¶
String implements fmt.Stringer interface.
type Unmarshaler ¶
Unmarshaler is the interface implemented by types that can unmarshal a graphson description of themselves.
Source Files ¶
decode.go encode.go error.go extension.go init.go interface.go lazy.go map.go marshaler.go native.go raw.go slice.go struct.go tags.go time.go type.go util.go
- Version
- v0.14.4 (latest)
- Published
- Mar 17, 2025
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 7 hours ago –
Tools for package owners.