pquads

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 20

Documentation

Overview

Package pquads implements Cayley-specific protobuf-based quads format.

Index

Constants

View Source
const ContentType = "application/x-protobuf"

Variables

View Source
var (
	ErrInvalidLengthQuads = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuads   = fmt.Errorf("proto: integer overflow")
)
View Source
var DefaultMaxSize = 1024 * 1024

Functions

func MarshalValue

func MarshalValue(v quad.Value) ([]byte, error)

MarshalValue is a helper for serialization of quad.Value.

func UnmarshalValue

func UnmarshalValue(data []byte) (quad.Value, error)

UnmarshalValue is a helper for deserialization of quad.Value.

Types

type Header struct {
	// Full is set if encoder always writes every quad directions instead of
	// skipping duplicated values on each direction (except label) for subsequent quads.
	Full bool `protobuf:"varint,1,opt,name=full,proto3" json:"full,omitempty"`
	// NotStrict is set if encoder emits WireQuad instead of StrictQuad messages.
	NotStrict            bool     `protobuf:"varint,2,opt,name=not_strict,json=notStrict,proto3" json:"not_strict,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Header) Descriptor

func (*Header) Descriptor() ([]byte, []int)

func (*Header) GetFull

func (m *Header) GetFull() bool

func (*Header) GetNotStrict

func (m *Header) GetNotStrict() bool

func (*Header) Marshal

func (m *Header) Marshal() (dAtA []byte, err error)

func (*Header) MarshalTo

func (m *Header) MarshalTo(dAtA []byte) (int, error)

func (*Header) MarshalToSizedBuffer

func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoSize

func (m *Header) ProtoSize() (n int)

func (*Header) Reset

func (m *Header) Reset()

func (*Header) String

func (m *Header) String() string

func (*Header) Unmarshal

func (m *Header) Unmarshal(dAtA []byte) error

func (*Header) XXX_DiscardUnknown

func (m *Header) XXX_DiscardUnknown()

func (*Header) XXX_Marshal

func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Header) XXX_Merge

func (m *Header) XXX_Merge(src proto.Message)

func (*Header) XXX_Size

func (m *Header) XXX_Size() int

func (*Header) XXX_Unmarshal

func (m *Header) XXX_Unmarshal(b []byte) error

type Options

type Options struct {
	// Full can be set to disable quad values compaction.
	//
	// This will increase files size, but skip will work faster by omitting unmarshal entirely.
	Full bool
	// Strict can be set to only marshal quads allowed by RDF spec.
	Strict bool
}

type Quad

type Quad struct {
	Subject              string   `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Predicate            string   `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
	Object               string   `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
	Label                string   `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	SubjectValue         *Value   `protobuf:"bytes,5,opt,name=subject_value,json=subjectValue,proto3" json:"subject_value,omitempty"`
	PredicateValue       *Value   `protobuf:"bytes,6,opt,name=predicate_value,json=predicateValue,proto3" json:"predicate_value,omitempty"`
	ObjectValue          *Value   `protobuf:"bytes,7,opt,name=object_value,json=objectValue,proto3" json:"object_value,omitempty"`
	LabelValue           *Value   `protobuf:"bytes,8,opt,name=label_value,json=labelValue,proto3" json:"label_value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Quad is in internal representation of quad used by Cayley.

func MakeQuad

func MakeQuad(q quad.Quad) *Quad

MakeQuad converts quad.Quad to its protobuf representation.

func (*Quad) Descriptor

func (*Quad) Descriptor() ([]byte, []int)

func (*Quad) GetLabel

func (m *Quad) GetLabel() string

func (*Quad) GetLabelValue

func (m *Quad) GetLabelValue() *Value

func (*Quad) GetObject

func (m *Quad) GetObject() string

func (*Quad) GetObjectValue

func (m *Quad) GetObjectValue() *Value

func (*Quad) GetPredicate

func (m *Quad) GetPredicate() string

func (*Quad) GetPredicateValue

func (m *Quad) GetPredicateValue() *Value

func (*Quad) GetSubject

func (m *Quad) GetSubject() string

func (*Quad) GetSubjectValue

func (m *Quad) GetSubjectValue() *Value

func (*Quad) Marshal

func (m *Quad) Marshal() (dAtA []byte, err error)

func (*Quad) MarshalTo

func (m *Quad) MarshalTo(dAtA []byte) (int, error)

func (*Quad) MarshalToSizedBuffer

func (m *Quad) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Quad) ProtoMessage

func (*Quad) ProtoMessage()

func (*Quad) ProtoSize

func (m *Quad) ProtoSize() (n int)

func (*Quad) Reset

func (m *Quad) Reset()

func (*Quad) String

func (m *Quad) String() string

func (*Quad) ToNative

func (m *Quad) ToNative() (q quad.Quad)

ToNative converts protobuf Quad to quad.Quad.

func (*Quad) Unmarshal

func (m *Quad) Unmarshal(dAtA []byte) error

func (*Quad) Upgrade

func (m *Quad) Upgrade()

func (*Quad) XXX_DiscardUnknown

func (m *Quad) XXX_DiscardUnknown()

func (*Quad) XXX_Marshal

func (m *Quad) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Quad) XXX_Merge

func (m *Quad) XXX_Merge(src proto.Message)

func (*Quad) XXX_Size

func (m *Quad) XXX_Size() int

func (*Quad) XXX_Unmarshal

func (m *Quad) XXX_Unmarshal(b []byte) error

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader, maxSize int) *Reader

NewReader creates protobuf quads decoder.

MaxSize argument limits maximal size of the buffer used to read quads.

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) ReadQuad

func (r *Reader) ReadQuad() (quad.Quad, error)

func (*Reader) SetCloser

func (r *Reader) SetCloser(c io.Closer)

func (*Reader) SkipQuad

func (r *Reader) SkipQuad() error

type StrictQuad

type StrictQuad struct {
	Subject              *StrictQuad_Ref `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Predicate            *StrictQuad_Ref `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
	Object               *Value          `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
	Label                *StrictQuad_Ref `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

StrictQuad is a quad as described by RDF spec.

func (*StrictQuad) Descriptor

func (*StrictQuad) Descriptor() ([]byte, []int)

func (*StrictQuad) GetLabel

func (m *StrictQuad) GetLabel() *StrictQuad_Ref

func (*StrictQuad) GetObject

func (m *StrictQuad) GetObject() *Value

func (*StrictQuad) GetPredicate

func (m *StrictQuad) GetPredicate() *StrictQuad_Ref

func (*StrictQuad) GetSubject

func (m *StrictQuad) GetSubject() *StrictQuad_Ref

func (*StrictQuad) Marshal

func (m *StrictQuad) Marshal() (dAtA []byte, err error)

func (*StrictQuad) MarshalTo

func (m *StrictQuad) MarshalTo(dAtA []byte) (int, error)

func (*StrictQuad) MarshalToSizedBuffer

func (m *StrictQuad) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StrictQuad) ProtoMessage

func (*StrictQuad) ProtoMessage()

func (*StrictQuad) ProtoSize

func (m *StrictQuad) ProtoSize() (n int)

func (*StrictQuad) Reset

func (m *StrictQuad) Reset()

func (*StrictQuad) String

func (m *StrictQuad) String() string

func (*StrictQuad) ToNative

func (m *StrictQuad) ToNative() (q quad.Quad)

ToNative converts protobuf StrictQuad to quad.Quad.

func (*StrictQuad) Unmarshal

func (m *StrictQuad) Unmarshal(dAtA []byte) error

func (*StrictQuad) XXX_DiscardUnknown

func (m *StrictQuad) XXX_DiscardUnknown()

func (*StrictQuad) XXX_Marshal

func (m *StrictQuad) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StrictQuad) XXX_Merge

func (m *StrictQuad) XXX_Merge(src proto.Message)

func (*StrictQuad) XXX_Size

func (m *StrictQuad) XXX_Size() int

func (*StrictQuad) XXX_Unmarshal

func (m *StrictQuad) XXX_Unmarshal(b []byte) error

type StrictQuadRaw

type StrictQuadRaw struct {
	Subject              []byte   `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Predicate            []byte   `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
	Object               []byte   `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
	Label                []byte   `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StrictQuadRaw is the same as StrictQuad, but doesn't decode underlying values.

func (*StrictQuadRaw) Descriptor

func (*StrictQuadRaw) Descriptor() ([]byte, []int)

func (*StrictQuadRaw) GetLabel

func (m *StrictQuadRaw) GetLabel() []byte

func (*StrictQuadRaw) GetObject

func (m *StrictQuadRaw) GetObject() []byte

func (*StrictQuadRaw) GetPredicate

func (m *StrictQuadRaw) GetPredicate() []byte

func (*StrictQuadRaw) GetSubject

func (m *StrictQuadRaw) GetSubject() []byte

func (*StrictQuadRaw) Marshal

func (m *StrictQuadRaw) Marshal() (dAtA []byte, err error)

func (*StrictQuadRaw) MarshalTo

func (m *StrictQuadRaw) MarshalTo(dAtA []byte) (int, error)

func (*StrictQuadRaw) MarshalToSizedBuffer

func (m *StrictQuadRaw) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StrictQuadRaw) ProtoMessage

func (*StrictQuadRaw) ProtoMessage()

func (*StrictQuadRaw) ProtoSize

func (m *StrictQuadRaw) ProtoSize() (n int)

func (*StrictQuadRaw) Reset

func (m *StrictQuadRaw) Reset()

func (*StrictQuadRaw) String

func (m *StrictQuadRaw) String() string

func (*StrictQuadRaw) Unmarshal

func (m *StrictQuadRaw) Unmarshal(dAtA []byte) error

func (*StrictQuadRaw) XXX_DiscardUnknown

func (m *StrictQuadRaw) XXX_DiscardUnknown()

func (*StrictQuadRaw) XXX_Marshal

func (m *StrictQuadRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StrictQuadRaw) XXX_Merge

func (m *StrictQuadRaw) XXX_Merge(src proto.Message)

func (*StrictQuadRaw) XXX_Size

func (m *StrictQuadRaw) XXX_Size() int

func (*StrictQuadRaw) XXX_Unmarshal

func (m *StrictQuadRaw) XXX_Unmarshal(b []byte) error

type StrictQuad_Ref

type StrictQuad_Ref struct {
	// Types that are valid to be assigned to Value:
	//	*StrictQuad_Ref_BnodeLabel
	//	*StrictQuad_Ref_Iri
	Value                isStrictQuad_Ref_Value `protobuf_oneof:"value"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*StrictQuad_Ref) Descriptor

func (*StrictQuad_Ref) Descriptor() ([]byte, []int)

func (*StrictQuad_Ref) GetBnodeLabel

func (m *StrictQuad_Ref) GetBnodeLabel() string

func (*StrictQuad_Ref) GetIri

func (m *StrictQuad_Ref) GetIri() string

func (*StrictQuad_Ref) GetValue

func (m *StrictQuad_Ref) GetValue() isStrictQuad_Ref_Value

func (*StrictQuad_Ref) Marshal

func (m *StrictQuad_Ref) Marshal() (dAtA []byte, err error)

func (*StrictQuad_Ref) MarshalTo

func (m *StrictQuad_Ref) MarshalTo(dAtA []byte) (int, error)

func (*StrictQuad_Ref) MarshalToSizedBuffer

func (m *StrictQuad_Ref) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StrictQuad_Ref) ProtoMessage

func (*StrictQuad_Ref) ProtoMessage()

func (*StrictQuad_Ref) ProtoSize

func (m *StrictQuad_Ref) ProtoSize() (n int)

func (*StrictQuad_Ref) Reset

func (m *StrictQuad_Ref) Reset()

func (*StrictQuad_Ref) String

func (m *StrictQuad_Ref) String() string

func (*StrictQuad_Ref) ToNative

func (m *StrictQuad_Ref) ToNative() (qv quad.Value)

ToNative converts protobuf Value to quad.Value.

func (*StrictQuad_Ref) Unmarshal

func (m *StrictQuad_Ref) Unmarshal(dAtA []byte) error

func (*StrictQuad_Ref) XXX_DiscardUnknown

func (m *StrictQuad_Ref) XXX_DiscardUnknown()

func (*StrictQuad_Ref) XXX_Marshal

func (m *StrictQuad_Ref) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StrictQuad_Ref) XXX_Merge

func (m *StrictQuad_Ref) XXX_Merge(src proto.Message)

func (*StrictQuad_Ref) XXX_OneofFuncs

func (*StrictQuad_Ref) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*StrictQuad_Ref) XXX_Size

func (m *StrictQuad_Ref) XXX_Size() int

func (*StrictQuad_Ref) XXX_Unmarshal

func (m *StrictQuad_Ref) XXX_Unmarshal(b []byte) error

type StrictQuad_Ref_BnodeLabel

type StrictQuad_Ref_BnodeLabel struct {
	BnodeLabel string `protobuf:"bytes,2,opt,name=bnode_label,json=bnodeLabel,proto3,oneof"`
}

func (*StrictQuad_Ref_BnodeLabel) MarshalTo

func (m *StrictQuad_Ref_BnodeLabel) MarshalTo(dAtA []byte) (int, error)

func (*StrictQuad_Ref_BnodeLabel) MarshalToSizedBuffer

func (m *StrictQuad_Ref_BnodeLabel) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StrictQuad_Ref_BnodeLabel) ProtoSize

func (m *StrictQuad_Ref_BnodeLabel) ProtoSize() (n int)

type StrictQuad_Ref_Iri

type StrictQuad_Ref_Iri struct {
	Iri string `protobuf:"bytes,3,opt,name=iri,proto3,oneof"`
}

func (*StrictQuad_Ref_Iri) MarshalTo

func (m *StrictQuad_Ref_Iri) MarshalTo(dAtA []byte) (int, error)

func (*StrictQuad_Ref_Iri) MarshalToSizedBuffer

func (m *StrictQuad_Ref_Iri) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StrictQuad_Ref_Iri) ProtoSize

func (m *StrictQuad_Ref_Iri) ProtoSize() (n int)

type Value

type Value struct {
	// Types that are valid to be assigned to Value:
	//	*Value_Raw
	//	*Value_Str
	//	*Value_Iri
	//	*Value_Bnode
	//	*Value_TypedStr
	//	*Value_LangStr
	//	*Value_Int
	//	*Value_Float
	//	*Value_Boolean
	//	*Value_Time
	Value                isValue_Value `protobuf_oneof:"value"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func MakeValue

func MakeValue(qv quad.Value) *Value

MakeValue converts quad.Value to its protobuf representation.

func (*Value) Descriptor

func (*Value) Descriptor() ([]byte, []int)

func (*Value) GetBnode

func (m *Value) GetBnode() string

func (*Value) GetBoolean

func (m *Value) GetBoolean() bool

func (*Value) GetFloat

func (m *Value) GetFloat() float64

func (*Value) GetInt

func (m *Value) GetInt() int64

func (*Value) GetIri

func (m *Value) GetIri() string

func (*Value) GetLangStr

func (m *Value) GetLangStr() *Value_LangString

func (*Value) GetRaw

func (m *Value) GetRaw() []byte

func (*Value) GetStr

func (m *Value) GetStr() string

func (*Value) GetTime

func (m *Value) GetTime() *Value_Timestamp

func (*Value) GetTypedStr

func (m *Value) GetTypedStr() *Value_TypedString

func (*Value) GetValue

func (m *Value) GetValue() isValue_Value

func (*Value) Marshal

func (m *Value) Marshal() (dAtA []byte, err error)

func (*Value) MarshalTo

func (m *Value) MarshalTo(dAtA []byte) (int, error)

func (*Value) MarshalToSizedBuffer

func (m *Value) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoSize

func (m *Value) ProtoSize() (n int)

func (*Value) Reset

func (m *Value) Reset()

func (*Value) String

func (m *Value) String() string

func (*Value) ToNative

func (m *Value) ToNative() (qv quad.Value)

ToNative converts protobuf Value to quad.Value.

func (*Value) Unmarshal

func (m *Value) Unmarshal(dAtA []byte) error

func (*Value) XXX_DiscardUnknown

func (m *Value) XXX_DiscardUnknown()

func (*Value) XXX_Marshal

func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value) XXX_Merge

func (m *Value) XXX_Merge(src proto.Message)

func (*Value) XXX_OneofFuncs

func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Value) XXX_Size

func (m *Value) XXX_Size() int

func (*Value) XXX_Unmarshal

func (m *Value) XXX_Unmarshal(b []byte) error

type Value_Bnode

type Value_Bnode struct {
	Bnode string `protobuf:"bytes,4,opt,name=bnode,proto3,oneof"`
}

func (*Value_Bnode) MarshalTo

func (m *Value_Bnode) MarshalTo(dAtA []byte) (int, error)

func (*Value_Bnode) MarshalToSizedBuffer

func (m *Value_Bnode) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Bnode) ProtoSize

func (m *Value_Bnode) ProtoSize() (n int)

type Value_Boolean

type Value_Boolean struct {
	Boolean bool `protobuf:"varint,9,opt,name=boolean,proto3,oneof"`
}

func (*Value_Boolean) MarshalTo

func (m *Value_Boolean) MarshalTo(dAtA []byte) (int, error)

func (*Value_Boolean) MarshalToSizedBuffer

func (m *Value_Boolean) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Boolean) ProtoSize

func (m *Value_Boolean) ProtoSize() (n int)

type Value_Float

type Value_Float struct {
	Float float64 `protobuf:"fixed64,8,opt,name=float,proto3,oneof"`
}

func (*Value_Float) MarshalTo

func (m *Value_Float) MarshalTo(dAtA []byte) (int, error)

func (*Value_Float) MarshalToSizedBuffer

func (m *Value_Float) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Float) ProtoSize

func (m *Value_Float) ProtoSize() (n int)

type Value_Int

type Value_Int struct {
	Int int64 `protobuf:"varint,7,opt,name=int,proto3,oneof"`
}

func (*Value_Int) MarshalTo

func (m *Value_Int) MarshalTo(dAtA []byte) (int, error)

func (*Value_Int) MarshalToSizedBuffer

func (m *Value_Int) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Int) ProtoSize

func (m *Value_Int) ProtoSize() (n int)

type Value_Iri

type Value_Iri struct {
	Iri string `protobuf:"bytes,3,opt,name=iri,proto3,oneof"`
}

func (*Value_Iri) MarshalTo

func (m *Value_Iri) MarshalTo(dAtA []byte) (int, error)

func (*Value_Iri) MarshalToSizedBuffer

func (m *Value_Iri) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Iri) ProtoSize

func (m *Value_Iri) ProtoSize() (n int)

type Value_LangStr

type Value_LangStr struct {
	LangStr *Value_LangString `protobuf:"bytes,6,opt,name=lang_str,json=langStr,proto3,oneof"`
}

func (*Value_LangStr) MarshalTo

func (m *Value_LangStr) MarshalTo(dAtA []byte) (int, error)

func (*Value_LangStr) MarshalToSizedBuffer

func (m *Value_LangStr) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_LangStr) ProtoSize

func (m *Value_LangStr) ProtoSize() (n int)

type Value_LangString

type Value_LangString struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Lang                 string   `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Value_LangString) Descriptor

func (*Value_LangString) Descriptor() ([]byte, []int)

func (*Value_LangString) GetLang

func (m *Value_LangString) GetLang() string

func (*Value_LangString) GetValue

func (m *Value_LangString) GetValue() string

func (*Value_LangString) Marshal

func (m *Value_LangString) Marshal() (dAtA []byte, err error)

func (*Value_LangString) MarshalTo

func (m *Value_LangString) MarshalTo(dAtA []byte) (int, error)

func (*Value_LangString) MarshalToSizedBuffer

func (m *Value_LangString) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_LangString) ProtoMessage

func (*Value_LangString) ProtoMessage()

func (*Value_LangString) ProtoSize

func (m *Value_LangString) ProtoSize() (n int)

func (*Value_LangString) Reset

func (m *Value_LangString) Reset()

func (*Value_LangString) String

func (m *Value_LangString) String() string

func (*Value_LangString) Unmarshal

func (m *Value_LangString) Unmarshal(dAtA []byte) error

func (*Value_LangString) XXX_DiscardUnknown

func (m *Value_LangString) XXX_DiscardUnknown()

func (*Value_LangString) XXX_Marshal

func (m *Value_LangString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value_LangString) XXX_Merge

func (m *Value_LangString) XXX_Merge(src proto.Message)

func (*Value_LangString) XXX_Size

func (m *Value_LangString) XXX_Size() int

func (*Value_LangString) XXX_Unmarshal

func (m *Value_LangString) XXX_Unmarshal(b []byte) error

type Value_Raw

type Value_Raw struct {
	Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"`
}

func (*Value_Raw) MarshalTo

func (m *Value_Raw) MarshalTo(dAtA []byte) (int, error)

func (*Value_Raw) MarshalToSizedBuffer

func (m *Value_Raw) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Raw) ProtoSize

func (m *Value_Raw) ProtoSize() (n int)

type Value_Str

type Value_Str struct {
	Str string `protobuf:"bytes,2,opt,name=str,proto3,oneof"`
}

func (*Value_Str) MarshalTo

func (m *Value_Str) MarshalTo(dAtA []byte) (int, error)

func (*Value_Str) MarshalToSizedBuffer

func (m *Value_Str) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Str) ProtoSize

func (m *Value_Str) ProtoSize() (n int)

type Value_Time

type Value_Time struct {
	Time *Value_Timestamp `protobuf:"bytes,10,opt,name=time,proto3,oneof"`
}

func (*Value_Time) MarshalTo

func (m *Value_Time) MarshalTo(dAtA []byte) (int, error)

func (*Value_Time) MarshalToSizedBuffer

func (m *Value_Time) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Time) ProtoSize

func (m *Value_Time) ProtoSize() (n int)

type Value_Timestamp

type Value_Timestamp struct {
	Seconds              int64    `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	Nanos                int32    `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

From https://github.com/golang/protobuf/blob/master/ptypes/timestamp/timestamp.proto

func (*Value_Timestamp) Descriptor

func (*Value_Timestamp) Descriptor() ([]byte, []int)

func (*Value_Timestamp) GetNanos

func (m *Value_Timestamp) GetNanos() int32

func (*Value_Timestamp) GetSeconds

func (m *Value_Timestamp) GetSeconds() int64

func (*Value_Timestamp) Marshal

func (m *Value_Timestamp) Marshal() (dAtA []byte, err error)

func (*Value_Timestamp) MarshalTo

func (m *Value_Timestamp) MarshalTo(dAtA []byte) (int, error)

func (*Value_Timestamp) MarshalToSizedBuffer

func (m *Value_Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_Timestamp) ProtoMessage

func (*Value_Timestamp) ProtoMessage()

func (*Value_Timestamp) ProtoSize

func (m *Value_Timestamp) ProtoSize() (n int)

func (*Value_Timestamp) Reset

func (m *Value_Timestamp) Reset()

func (*Value_Timestamp) String

func (m *Value_Timestamp) String() string

func (*Value_Timestamp) Unmarshal

func (m *Value_Timestamp) Unmarshal(dAtA []byte) error

func (*Value_Timestamp) XXX_DiscardUnknown

func (m *Value_Timestamp) XXX_DiscardUnknown()

func (*Value_Timestamp) XXX_Marshal

func (m *Value_Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value_Timestamp) XXX_Merge

func (m *Value_Timestamp) XXX_Merge(src proto.Message)

func (*Value_Timestamp) XXX_Size

func (m *Value_Timestamp) XXX_Size() int

func (*Value_Timestamp) XXX_Unmarshal

func (m *Value_Timestamp) XXX_Unmarshal(b []byte) error

type Value_TypedStr

type Value_TypedStr struct {
	TypedStr *Value_TypedString `protobuf:"bytes,5,opt,name=typed_str,json=typedStr,proto3,oneof"`
}

func (*Value_TypedStr) MarshalTo

func (m *Value_TypedStr) MarshalTo(dAtA []byte) (int, error)

func (*Value_TypedStr) MarshalToSizedBuffer

func (m *Value_TypedStr) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_TypedStr) ProtoSize

func (m *Value_TypedStr) ProtoSize() (n int)

type Value_TypedString

type Value_TypedString struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Type                 string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Value_TypedString) Descriptor

func (*Value_TypedString) Descriptor() ([]byte, []int)

func (*Value_TypedString) GetType

func (m *Value_TypedString) GetType() string

func (*Value_TypedString) GetValue

func (m *Value_TypedString) GetValue() string

func (*Value_TypedString) Marshal

func (m *Value_TypedString) Marshal() (dAtA []byte, err error)

func (*Value_TypedString) MarshalTo

func (m *Value_TypedString) MarshalTo(dAtA []byte) (int, error)

func (*Value_TypedString) MarshalToSizedBuffer

func (m *Value_TypedString) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Value_TypedString) ProtoMessage

func (*Value_TypedString) ProtoMessage()

func (*Value_TypedString) ProtoSize

func (m *Value_TypedString) ProtoSize() (n int)

func (*Value_TypedString) Reset

func (m *Value_TypedString) Reset()

func (*Value_TypedString) String

func (m *Value_TypedString) String() string

func (*Value_TypedString) Unmarshal

func (m *Value_TypedString) Unmarshal(dAtA []byte) error

func (*Value_TypedString) XXX_DiscardUnknown

func (m *Value_TypedString) XXX_DiscardUnknown()

func (*Value_TypedString) XXX_Marshal

func (m *Value_TypedString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value_TypedString) XXX_Merge

func (m *Value_TypedString) XXX_Merge(src proto.Message)

func (*Value_TypedString) XXX_Size

func (m *Value_TypedString) XXX_Size() int

func (*Value_TypedString) XXX_Unmarshal

func (m *Value_TypedString) XXX_Unmarshal(b []byte) error

type WireQuad

type WireQuad struct {
	Subject              *Value   `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Predicate            *Value   `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
	Object               *Value   `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
	Label                *Value   `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

WireQuad is a quad that allows any value for it's directions.

func (*WireQuad) Descriptor

func (*WireQuad) Descriptor() ([]byte, []int)

func (*WireQuad) GetLabel

func (m *WireQuad) GetLabel() *Value

func (*WireQuad) GetObject

func (m *WireQuad) GetObject() *Value

func (*WireQuad) GetPredicate

func (m *WireQuad) GetPredicate() *Value

func (*WireQuad) GetSubject

func (m *WireQuad) GetSubject() *Value

func (*WireQuad) Marshal

func (m *WireQuad) Marshal() (dAtA []byte, err error)

func (*WireQuad) MarshalTo

func (m *WireQuad) MarshalTo(dAtA []byte) (int, error)

func (*WireQuad) MarshalToSizedBuffer

func (m *WireQuad) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WireQuad) ProtoMessage

func (*WireQuad) ProtoMessage()

func (*WireQuad) ProtoSize

func (m *WireQuad) ProtoSize() (n int)

func (*WireQuad) Reset

func (m *WireQuad) Reset()

func (*WireQuad) String

func (m *WireQuad) String() string

func (*WireQuad) ToNative

func (m *WireQuad) ToNative() (q quad.Quad)

ToNative converts protobuf WireQuad to quad.Quad.

func (*WireQuad) Unmarshal

func (m *WireQuad) Unmarshal(dAtA []byte) error

func (*WireQuad) XXX_DiscardUnknown

func (m *WireQuad) XXX_DiscardUnknown()

func (*WireQuad) XXX_Marshal

func (m *WireQuad) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WireQuad) XXX_Merge

func (m *WireQuad) XXX_Merge(src proto.Message)

func (*WireQuad) XXX_Size

func (m *WireQuad) XXX_Size() int

func (*WireQuad) XXX_Unmarshal

func (m *WireQuad) XXX_Unmarshal(b []byte) error

type WireQuadRaw

type WireQuadRaw struct {
	Subject              []byte   `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	Predicate            []byte   `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"`
	Object               []byte   `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
	Label                []byte   `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

WireQuadRaw is the same as WireQuad, but doesn't decode underlying values.

func (*WireQuadRaw) Descriptor

func (*WireQuadRaw) Descriptor() ([]byte, []int)

func (*WireQuadRaw) GetLabel

func (m *WireQuadRaw) GetLabel() []byte

func (*WireQuadRaw) GetObject

func (m *WireQuadRaw) GetObject() []byte

func (*WireQuadRaw) GetPredicate

func (m *WireQuadRaw) GetPredicate() []byte

func (*WireQuadRaw) GetSubject

func (m *WireQuadRaw) GetSubject() []byte

func (*WireQuadRaw) Marshal

func (m *WireQuadRaw) Marshal() (dAtA []byte, err error)

func (*WireQuadRaw) MarshalTo

func (m *WireQuadRaw) MarshalTo(dAtA []byte) (int, error)

func (*WireQuadRaw) MarshalToSizedBuffer

func (m *WireQuadRaw) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WireQuadRaw) ProtoMessage

func (*WireQuadRaw) ProtoMessage()

func (*WireQuadRaw) ProtoSize

func (m *WireQuadRaw) ProtoSize() (n int)

func (*WireQuadRaw) Reset

func (m *WireQuadRaw) Reset()

func (*WireQuadRaw) String

func (m *WireQuadRaw) String() string

func (*WireQuadRaw) Unmarshal

func (m *WireQuadRaw) Unmarshal(dAtA []byte) error

func (*WireQuadRaw) XXX_DiscardUnknown

func (m *WireQuadRaw) XXX_DiscardUnknown()

func (*WireQuadRaw) XXX_Marshal

func (m *WireQuadRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WireQuadRaw) XXX_Merge

func (m *WireQuadRaw) XXX_Merge(src proto.Message)

func (*WireQuadRaw) XXX_Size

func (m *WireQuadRaw) XXX_Size() int

func (*WireQuadRaw) XXX_Unmarshal

func (m *WireQuadRaw) XXX_Unmarshal(b []byte) error

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer, opts *Options) *Writer

NewWriter creates protobuf quads encoder.

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) MaxSize

func (w *Writer) MaxSize() int

MaxSize returns a maximal message size written.

func (*Writer) SetCloser

func (w *Writer) SetCloser(c io.Closer)

func (*Writer) WriteQuad

func (w *Writer) WriteQuad(q quad.Quad) error

func (*Writer) WriteQuads

func (w *Writer) WriteQuads(buf []quad.Quad) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL