topicrelation

package
v0.0.0-...-153d94f Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package topicrelation is a generated protocol buffer package.

It is generated from these files:

model.proto

It has these top-level messages:

EntityInfo
StoredTopicData
TopicRelationQuery

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowModel   = fmt.Errorf("proto: integer overflow")
)
View Source
var FetchType_name = map[int32]string{
	0: "FetchType_Invalid",
	1: "ID",
	2: "Relation",
	3: "RelationWithoutData",
	4: "Topic",
	5: "TopicWithoutData",
	6: "Natural",
}
View Source
var FetchType_value = map[string]int32{
	"FetchType_Invalid":   0,
	"ID":                  1,
	"Relation":            2,
	"RelationWithoutData": 3,
	"Topic":               4,
	"TopicWithoutData":    5,
	"Natural":             6,
}
View Source
var RelationDirection_name = map[int32]string{
	0: "RelationDirection_Invalid",
	1: "Out",
	2: "In",
	3: "InOut",
	4: "And",
	5: "Or",
}
View Source
var RelationDirection_value = map[string]int32{
	"RelationDirection_Invalid": 0,
	"Out":                       1,
	"In":                        2,
	"InOut":                     3,
	"And":                       4,
	"Or":                        5,
}

Functions

func DataElementGettersToIDsAndBaseTopicTypes

func DataElementGettersToIDsAndBaseTopicTypes(dgs []DataElementGetter) (ids, topicTypes []uint64)

func RelatedStoredTopicDatasIDs

func RelatedStoredTopicDatasIDs(sts []StoredTopicData) (ids []uint64)

RelatedStoredTopicDatasIDs returns the ids of sts.

func StoredTopicDatasIDs

func StoredTopicDatasIDs(sts []StoredTopicData) (ids []uint64)

StoredTopicDatasIDs returns the ids of sts.

func StoredTopicDatasIsIDsEqualSequence

func StoredTopicDatasIsIDsEqualSequence(
	sts []StoredTopicData, ids []uint64,
) bool

StoredTopicDatasIsIDsEqualSequence returns whether sts.IDs have the same sequence as ids.

func StoredTopicDatasNames

func StoredTopicDatasNames(sts []StoredTopicData) (names []string)

StoredTopicDataNames returns the names of sts.

func StoredTopicDatasSetID

func StoredTopicDatasSetID(id uint64, sts []StoredTopicData)

func StoredTopicDatasSetOwnerID

func StoredTopicDatasSetOwnerID(ownerID uint64, sts []StoredTopicData)

Types

type CommandStore

type CommandStore interface {
	Insert(st StoredTopicDataGetter) (err error)
	// InsertMulti inserts all topics under des with a single
	// transaction.
	InsertMulti(sts []StoredTopicData) (err error)
	// InsertUpdate = insert on duplicate key update data = st.data, st.version += 1
	// semantic.
	InsertUpdate(
		updatedTime int64,
		st StoredTopicDataGetterUpdater) (err error)
	// InsertUpdateMulti = insert on duplicate key update data = st.data, st.version += 1
	// semantic. For each sts with a single transaction.
	InsertUpdateMulti(
		updatedTime int64,
		sts []StoredTopicData) (err error)

	// UpdateVersionedWhereIDAndVersion update a single entry where id = st.GetID()
	// and version = st.GetVersion(), sets data = st.data, st.version += 1
	// on success. = "Atomic" updates via versions.
	UpdateVersionedWhereIDAndVersion(
		updatedTime int64,
		st StoredTopicDataGetterUpdater,
	) (cntUpdated uint64, err error)
}

CommandStore

type DataElementGetter

type DataElementGetter interface {
	EntityInfoGetter
	GetData() []byte
}

type DataElementSetter

type DataElementSetter interface {
	EntityInfoSetter
	SetData(data []byte)
}

type DeepRelatedStoredTopicElementGetter

type DeepRelatedStoredTopicElementGetter interface {
	RelatedDataStoredTopicGetter
	GetToDeepRelations() []DeepRelatedStoredTopicElementGetter
}

type EntityInfo

type EntityInfo struct {
	ID            uint64 `protobuf:"fixed64,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Name          string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	BaseTopicType uint64 `protobuf:"fixed64,3,opt,name=baseTopicType,proto3" json:"baseTopicType,omitempty"`
	OwnerID       uint64 `protobuf:"fixed64,4,opt,name=ownerID,proto3" json:"ownerID,omitempty"`
	CreatedTime   int64  `protobuf:"varint,5,opt,name=createdTime,proto3" json:"createdTime,omitempty"`
	UpdatedTime   int64  `protobuf:"varint,6,opt,name=updatedTime,proto3" json:"updatedTime,omitempty"`
	Version       uint64 `protobuf:"fixed64,7,opt,name=version,proto3" json:"version,omitempty"`
	Visibility    uint64 `protobuf:"fixed64,8,opt,name=visibility,proto3" json:"visibility,omitempty"`
}

EntityInfo represents the basic model stored in the database without data.

func (*EntityInfo) Descriptor

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

func (*EntityInfo) GetBaseTopicType

func (self *EntityInfo) GetBaseTopicType() uint64

func (*EntityInfo) GetCreatedTime

func (self *EntityInfo) GetCreatedTime() int64

func (*EntityInfo) GetEntityInfo

func (self *EntityInfo) GetEntityInfo() *EntityInfo

func (*EntityInfo) GetID

func (self *EntityInfo) GetID() uint64

func (*EntityInfo) GetName

func (self *EntityInfo) GetName() string

func (*EntityInfo) GetOwnerID

func (self *EntityInfo) GetOwnerID() uint64

func (*EntityInfo) GetUpdatedTime

func (self *EntityInfo) GetUpdatedTime() int64

func (*EntityInfo) GetVersion

func (self *EntityInfo) GetVersion() uint64

func (*EntityInfo) GetVisibility

func (self *EntityInfo) GetVisibility() uint64

func (*EntityInfo) Marshal

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

func (*EntityInfo) MarshalTo

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

func (*EntityInfo) ProtoMessage

func (*EntityInfo) ProtoMessage()

func (*EntityInfo) Reset

func (m *EntityInfo) Reset()

func (*EntityInfo) SetBaseTopicType

func (self *EntityInfo) SetBaseTopicType(baseTopicType uint64)

func (*EntityInfo) SetCreatedTime

func (self *EntityInfo) SetCreatedTime(createdTime int64)

func (*EntityInfo) SetID

func (self *EntityInfo) SetID(id uint64)

func (*EntityInfo) SetName

func (self *EntityInfo) SetName(name string)

func (*EntityInfo) SetOwnerID

func (self *EntityInfo) SetOwnerID(ownerID uint64)

func (*EntityInfo) SetUpdatedTime

func (self *EntityInfo) SetUpdatedTime(updatedTime int64)

func (*EntityInfo) SetVersion

func (self *EntityInfo) SetVersion(version uint64)

func (*EntityInfo) SetVisibility

func (self *EntityInfo) SetVisibility(visibility uint64)

func (*EntityInfo) Size

func (m *EntityInfo) Size() (n int)

func (*EntityInfo) String

func (m *EntityInfo) String() string

func (*EntityInfo) Unmarshal

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

type EntityInfoGetter

type EntityInfoGetter interface {
	GetID() uint64
	GetName() string
	GetBaseTopicType() uint64
	GetOwnerID() uint64
	GetCreatedTime() int64
	GetUpdatedTime() int64
	GetVersion() uint64
	GetVisibility() uint64
	GetEntityInfo() *EntityInfo
}

type EntityInfoSetter

type EntityInfoSetter interface {
	SetID(id uint64)
	SetName(name string)
	SetBaseTopicType(baseTopicType uint64)
	SetOwnerID(ownerID uint64)
	SetCreatedTime(createdTime int64)
	SetUpdatedTime(updatedTime int64)
	SetVersion(version uint64)
	SetVisibility(visibility uint64)
}

type FetchType

type FetchType int32
const (
	FetchType_FetchType_Invalid   FetchType = 0
	FetchType_ID                  FetchType = 1
	FetchType_Relation            FetchType = 2
	FetchType_RelationWithoutData FetchType = 3
	FetchType_Topic               FetchType = 4
	FetchType_TopicWithoutData    FetchType = 5
	FetchType_Natural             FetchType = 6
)

func (FetchType) EnumDescriptor

func (FetchType) EnumDescriptor() ([]byte, []int)

func (FetchType) String

func (x FetchType) String() string

type QueryStore

type QueryStore interface {
	// GetByID get where id = id.
	GetByID(id uint64, st *StoredTopicData) (err error)
	// GetByName get where name = name.
	GetByName(name string, st *StoredTopicData) (err error)
	// GetByOwnerIDIN get where owner_id IN(ownerIDs)
	GetByOwnerIDIN(ownerIDs ...uint64) (sts []StoredTopicData, err error)
	// GetByTopicTypeIN get where topic_type IN(topicTypes)
	GetByTopicTypeIN(topicTypes ...uint64) (sts []StoredTopicData, err error)
	// GetByOwnerIDAndTopicType get
	// where owner_id = ownerID and topic_type = topicType.
	GetByOwnerIDAndTopicType(
		ownerID, topicType uint64) (sts []StoredTopicData, err error)
}

QueryStore

type RelatedDataStoredTopicGetter

type RelatedDataStoredTopicGetter interface {
	StoredTopicDataGetter
	GetRelatedStoredTopicData() *StoredTopicData
	SetUpdatedTimeDeep(updatedTime int64)
}

type RelatedDataStoredTopicGetterUpdater

type RelatedDataStoredTopicGetterUpdater interface {
	RelatedDataStoredTopicGetter
	SetVersion(version uint64)
	SetUpdatedTime(createdTimeMs int64)
}

type RelatedDataStoredTopicProvider

type RelatedDataStoredTopicProvider interface {
	StoredTopicDataGetter
	GetToRelations() []RelatedDataStoredTopicProvider
	ForBreadthFirstRelations(depth int, fn func(depth int, rel RelatedDataStoredTopicProvider))
	ForDepthFirstRelations(depth int, fn func(depth int, rel RelatedDataStoredTopicProvider))
}

type RelationDirection

type RelationDirection int32
const (
	RelationDirection_RelationDirection_Invalid RelationDirection = 0
	RelationDirection_Out                       RelationDirection = 1
	RelationDirection_In                        RelationDirection = 2
	RelationDirection_InOut                     RelationDirection = 3
	RelationDirection_And                       RelationDirection = 4
	RelationDirection_Or                        RelationDirection = 5
)

func (RelationDirection) EnumDescriptor

func (RelationDirection) EnumDescriptor() ([]byte, []int)

func (RelationDirection) String

func (x RelationDirection) String() string

type RelationQueryStore

type RelationQueryStore interface {
	// GetOut returns out relations or the corresponding topics.
	// matches each id to the relationType (same index)
	// Example: gimme topics that have all out/to relations
	// id IN(toIDsFilters[0]), topic_type IN(relationTypesFilters[0]), owner_id IN(topicIDs) AND has
	// id IN(toIDsFilters[1]), topic_type IN(relationTypesFilters[1]), owner_id IN(topicIDs)
	// ...
	GetOut(
		topicIDs []uint64,
		relationTypesFilter [][]uint64,
		toIDsFilter [][]uint64,
		fetchType FetchType,
		offset, limit uint64,
	) (sts []StoredTopicData, err error)
	// GetIn returns in relations or the corresponding topics.
	// Example: gimme topics that have all in/from relations
	// owner_id IN(fromIDsFilters[0]), topic_type IN(relationTypesFilters[0]), id IN(topicIDs) AND has
	// owner_id IN(fromIDsFilters[1]), topic_type IN(relationTypesFilters[1]), id IN(topicIDs)
	// ...
	GetIn(
		topicIDs []uint64,
		relationTypesFilter [][]uint64,
		fromIDsFilter [][]uint64,
		fetchType FetchType,
		offset, limit uint64,
	) (sts []StoredTopicData, err error)
	// GetInAndOut returns in and out relations or the corresponding topics.
	GetInAndOut(
		topicIDs []uint64,
		toRelationTypesFilter []uint64,
		fromRelationTypesFilter []uint64,
		fetchType FetchType,
		offset, limit uint64,
	) (sts []StoredTopicData, err error)
}

type StoredTopic

type StoredTopic interface {
	StoredTopicDataGetter
	StoredTopicDataSetter
}

type StoredTopicData

type StoredTopicData struct {
	EntityInfo `protobuf:"bytes,1,opt,name=EntityInfo,embedded=EntityInfo" json:",embedded" bson:",inline"`
	Data       []byte            `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Relations  []StoredTopicData `protobuf:"bytes,3,rep,name=relations" json:"relations"`
}

StoredTopicData represents the basic model stored in the database.

func StoredTopicDatasByID

func StoredTopicDatasByID(
	ownerID uint64, sts []StoredTopicData) (res []StoredTopicData)

func StoredTopicDatasByIDAndOwnerID

func StoredTopicDatasByIDAndOwnerID(
	id, ownerID uint64, sts []StoredTopicData,
) (res []StoredTopicData)

func StoredTopicDatasByIDBaseTopicTypeAndOwnerID

func StoredTopicDatasByIDBaseTopicTypeAndOwnerID(
	id, baseTopicType, ownerID uint64, sts []StoredTopicData,
) (res []StoredTopicData)

func StoredTopicDatasByOwnerID

func StoredTopicDatasByOwnerID(
	ownerID uint64, sts []StoredTopicData,
) (res []StoredTopicData)

func (*StoredTopicData) Descriptor

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

func (*StoredTopicData) ForBreadthFirstRelations

func (self *StoredTopicData) ForBreadthFirstRelations(depth int, fn func(depth int, rel RelatedDataStoredTopicProvider))

func (*StoredTopicData) ForDepthFirstRelations

func (self *StoredTopicData) ForDepthFirstRelations(depth int, fn func(depth int, rel RelatedDataStoredTopicProvider))

func (*StoredTopicData) GetData

func (self *StoredTopicData) GetData() []byte

func (*StoredTopicData) GetRelatedStoredTopicData

func (self *StoredTopicData) GetRelatedStoredTopicData() *StoredTopicData

func (*StoredTopicData) GetRelations

func (m *StoredTopicData) GetRelations() []StoredTopicData

func (*StoredTopicData) GetToRelations

func (self *StoredTopicData) GetToRelations() (relations []RelatedDataStoredTopicProvider)

func (*StoredTopicData) Marshal

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

func (*StoredTopicData) MarshalTo

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

func (*StoredTopicData) ProtoMessage

func (*StoredTopicData) ProtoMessage()

func (*StoredTopicData) Reset

func (m *StoredTopicData) Reset()

func (*StoredTopicData) SetData

func (self *StoredTopicData) SetData(data []byte)

func (*StoredTopicData) SetUpdatedTime

func (self *StoredTopicData) SetUpdatedTime(updatedTime int64)

func (*StoredTopicData) SetUpdatedTimeDeep

func (self *StoredTopicData) SetUpdatedTimeDeep(updatedTime int64)

func (*StoredTopicData) Size

func (m *StoredTopicData) Size() (n int)

func (*StoredTopicData) String

func (m *StoredTopicData) String() string

func (*StoredTopicData) Unmarshal

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

type StoredTopicDataGetter

type StoredTopicDataGetter interface {
	DataElementGetter
}

type StoredTopicDataGetterUpdater

type StoredTopicDataGetterUpdater interface {
	StoredTopicDataGetter
	SetVersion(version uint64)
	SetUpdatedTime(createdTime int64)
}

type StoredTopicDataHolder

type StoredTopicDataHolder interface {
	GetStoredTopicData() (de StoredTopicData)
	SetStoredTopicData(de StoredTopicData)
}

type StoredTopicDataSetter

type StoredTopicDataSetter interface {
	DataElementSetter
}

type TopicRelationCommandStore

type TopicRelationCommandStore interface {
}

type TopicRelationQuery

type TopicRelationQuery struct {
	IDs               []uint64          `protobuf:"fixed64,1,rep,packed,name=IDs" json:"IDs,omitempty"`
	OwnerIDs          []uint64          `protobuf:"fixed64,2,rep,packed,name=ownerIDs" json:"ownerIDs,omitempty"`
	RelationTypes     []uint64          `protobuf:"fixed64,3,rep,packed,name=relationTypes" json:"relationTypes,omitempty"`
	IdsDimensionCount uint64            `protobuf:"fixed64,23,opt,name=idsDimensionCount,proto3" json:"idsDimensionCount,omitempty"`
	RelationDirection RelationDirection `protobuf:"varint,4,opt,name=relationDirection,proto3,enum=topicrelation.RelationDirection" json:"relationDirection,omitempty"`
	// DoFetchTopic if true topics are fetched at the end
	// if not, only relations are fetched.
	DoFetchTopic   bool `protobuf:"varint,5,opt,name=doFetchTopic,proto3" json:"doFetchTopic,omitempty"`
	DoFetchIDsOnly bool `protobuf:"varint,6,opt,name=doFetchIDsOnly,proto3" json:"doFetchIDsOnly,omitempty"`
	// DoFetchDataColumn whether data column to be fetched.
	DoFetchDataColumn bool `protobuf:"varint,7,opt,name=doFetchDataColumn,proto3" json:"doFetchDataColumn,omitempty"`
	// FetchTopicsDepth is whether and up to which level/depth
	// topics are fetched.
	FetchTopicsDepth uint64 `protobuf:"fixed64,8,opt,name=fetchTopicsDepth,proto3" json:"fetchTopicsDepth,omitempty"`
	// Offset.
	Offset uint64 `protobuf:"fixed64,9,opt,name=offset,proto3" json:"offset,omitempty"`
	// Limit of 0 means int64max.
	Limit uint64 `protobuf:"fixed64,10,opt,name=limit,proto3" json:"limit,omitempty"`
	// Next allows to build nested relations etc.
	Next []TopicRelationQuery `protobuf:"bytes,11,rep,name=next" json:"next"`
}

func (*TopicRelationQuery) Descriptor

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

func (*TopicRelationQuery) GetNext

func (m *TopicRelationQuery) GetNext() []TopicRelationQuery

func (*TopicRelationQuery) Marshal

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

func (*TopicRelationQuery) MarshalTo

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

func (*TopicRelationQuery) ProtoMessage

func (*TopicRelationQuery) ProtoMessage()

func (*TopicRelationQuery) Reset

func (m *TopicRelationQuery) Reset()

func (*TopicRelationQuery) Size

func (m *TopicRelationQuery) Size() (n int)

func (*TopicRelationQuery) String

func (m *TopicRelationQuery) String() string

func (*TopicRelationQuery) Unmarshal

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

type TopicRelationQueryFilter

type TopicRelationQueryFilter struct {
	TopicRelationQuery
}

TopicRelationQueryFilter defines which relations (for a topic) should be included in the query.

type TopicRelationQueryStore

type TopicRelationQueryStore interface {
	RelationQueryStore
}

type TopicRelationStore

type TopicRelationStore interface {
	TopicRelationCommandStore
	TopicRelationQueryStore
}

TopicRelationStore

type UnmarshalHandle

type UnmarshalHandle interface {
	UnmarshalAndAddFromStoredTopicData(sts ...StoredTopicData) (err error)
}

Directories

Path Synopsis
Package gp is a generated protocol buffer package.
Package gp is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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