ent: github.com/facebookincubator/ent/dialect/gremlin/encoding/graphson Index | Files

package graphson

import "github.com/facebookincubator/ent/dialect/gremlin/encoding/graphson"

Index

Package 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

Constants

const (
    TypeKey  = "@type"
    ValueKey = "@value"
)

graphson encoding type / value keys

func Marshal Uses

func Marshal(v interface{}) ([]byte, error)

Marshal returns the graphson encoding of v.

func MarshalToString Uses

func MarshalToString(v interface{}) (string, error)

MarshalToString returns the graphson encoding of v as string.

func RegisterTypeDecoder Uses

func RegisterTypeDecoder(typ string, dec jsoniter.ValDecoder)

RegisterTypeDecoder register type decoder for typ.

func RegisterTypeEncoder Uses

func RegisterTypeEncoder(typ string, enc jsoniter.ValEncoder)

RegisterTypeEncoder register type encoder for typ.

func Unmarshal Uses

func Unmarshal(data []byte, v interface{}) error

Unmarshal parses the graphson encoded data and stores the result in the value pointed to by v.

func UnmarshalFromString Uses

func UnmarshalFromString(str string, v interface{}) error

UnmarshalFromString parses the graphson encoded str and stores the result in the value pointed to by v.

type Decoder Uses

type Decoder interface {
    Decode(interface{}) error
}

Decoder defines a graphson decoder.

func NewDecoder Uses

func NewDecoder(r io.Reader) Decoder

NewDecoder create a graphson decoder.

type Encoder Uses

type Encoder interface {
    Encode(interface{}) error
}

Encoder defines a graphson encoder.

func NewEncoder Uses

func NewEncoder(w io.Writer) Encoder

NewEncoder create a graphson encoder.

type Marshaler Uses

type Marshaler interface {
    MarshalGraphson() ([]byte, error)
}

Marshaler is the interface implemented by types that can marshal themselves as graphson.

type RawMessage Uses

type RawMessage []byte

RawMessage is a raw encoded graphson value.

func (RawMessage) MarshalGraphson Uses

func (m RawMessage) MarshalGraphson() ([]byte, error)

MarshalGraphson returns m as the graphson encoding of m.

func (*RawMessage) UnmarshalGraphson Uses

func (m *RawMessage) UnmarshalGraphson(data []byte) error

UnmarshalGraphson sets *m to a copy of data.

type Type Uses

type Type string

A Type is a graphson type.

const (
    Timestamp Type = "g:Timestamp"
    Date      Type = "g:Date"
)

graphson typed value types.

func (Type) CheckType Uses

func (typ Type) CheckType(other Type) error

CheckType implements typeChecker interface.

func (Type) String Uses

func (typ Type) String() string

String implements fmt.Stringer interface.

type Typer Uses

type Typer interface {
    GraphsonType() Type
}

Typer is the interface implemented by types that define an underlying graphson type.

type Types Uses

type Types []Type

Types is a slice of Type.

func (Types) CheckType Uses

func (types Types) CheckType(typ Type) error

CheckType implements typeChecker interface.

func (Types) Contains Uses

func (types Types) Contains(typ Type) bool

Contains reports whether a slice of types contains a particular type.

func (Types) String Uses

func (types Types) String() string

String implements fmt.Stringer interface.

type Unmarshaler Uses

type Unmarshaler interface {
    UnmarshalGraphson([]byte) error
}

Unmarshaler is the interface implemented by types that can unmarshal a graphson description of themselves.

Package graphson imports 12 packages (graph) and is imported by 3 packages. Updated 2019-10-15. Refresh now. Tools for package owners.