Documentation ¶
Overview ¶
Package gp is a generated protocol buffer package.
It is generated from these files:
group.proto
It has these top-level messages:
BaseGroupInfo BaseGroup BaseGroupMember
Index ¶
- Variables
- func GroupMembersIDs(members []GroupMember) (ids []uint64)
- func GroupMembersIDsUniqueIDHashNameString(sortedIDs ...uint64) (hashString string, err error)
- func GroupMembersUniqueIDHashNameString(sortedCps []GroupMember) (hashString string, err error)
- func GroupRelationTypeToStorable(t GroupRelationType, offs uint64) (relationID uint64)
- func GroupToRelatedStoredTopicData(g Group, membersHash string, ...) (d StoredTopicData, err error)
- func IsSaneStorableGroup(g Group) (err error)
- func SortGroupMembersAsc(gps []GroupMember)
- func UnmarshalSingleBaseGroupFromStoredTopicData(bg *BaseGroup, st *StoredTopicData) (err error)
- type BaseGroup
- func (*BaseGroup) Descriptor() ([]byte, []int)
- func (m *BaseGroup) GetGroupMembers() []BaseGroupMember
- func (self *BaseGroup) GetMembers() (members []GroupMember)
- func (self *BaseGroup) GetNoMembersGroup() NoMembersGroup
- func (m *BaseGroup) Marshal() (dAtA []byte, err error)
- func (m *BaseGroup) MarshalTo(dAtA []byte) (int, error)
- func (*BaseGroup) ProtoMessage()
- func (m *BaseGroup) Reset()
- func (m *BaseGroup) Size() (n int)
- func (m *BaseGroup) String() string
- func (m *BaseGroup) Unmarshal(dAtA []byte) error
- type BaseGroupInfo
- func (*BaseGroupInfo) Descriptor() ([]byte, []int)
- func (m *BaseGroupInfo) Marshal() (dAtA []byte, err error)
- func (m *BaseGroupInfo) MarshalTo(dAtA []byte) (int, error)
- func (*BaseGroupInfo) ProtoMessage()
- func (m *BaseGroupInfo) Reset()
- func (m *BaseGroupInfo) Size() (n int)
- func (m *BaseGroupInfo) String() string
- func (m *BaseGroupInfo) Unmarshal(dAtA []byte) error
- type BaseGroupMember
- func (*BaseGroupMember) Descriptor() ([]byte, []int)
- func (m *BaseGroupMember) Marshal() (dAtA []byte, err error)
- func (m *BaseGroupMember) MarshalTo(dAtA []byte) (int, error)
- func (*BaseGroupMember) ProtoMessage()
- func (m *BaseGroupMember) Reset()
- func (m *BaseGroupMember) Size() (n int)
- func (m *BaseGroupMember) String() string
- func (m *BaseGroupMember) Unmarshal(dAtA []byte) error
- type BaseGroupUnmarshalHandle
- type ExternalGroupMember
- type Group
- type GroupErrorCode
- type GroupMember
- type GroupMembersAsc
- type GroupRelationType
- type GroupStore
- type MemberStatus
- type NoMembersGroup
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthGroup = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGroup = fmt.Errorf("proto: integer overflow") )
var GroupErrorCode_name = map[int32]string{
0: "GroupErrorCode_INVALID",
1: "NoMembers",
2: "NoMemberID",
3: "DuplicateMember",
}
var GroupErrorCode_value = map[string]int32{
"GroupErrorCode_INVALID": 0,
"NoMembers": 1,
"NoMemberID": 2,
"DuplicateMember": 3,
}
var GroupRelationType_name = map[int32]string{
0: "ConversationRelationType_INVALID",
1: "Member",
2: "AllMembersHash",
3: "Tag",
4: "AllTags",
}
var GroupRelationType_value = map[string]int32{
"ConversationRelationType_INVALID": 0,
"Member": 1,
"AllMembersHash": 2,
"Tag": 3,
"AllTags": 4,
}
var MemberStatus_name = map[int32]string{
0: "PartiticipationStatus_INVALID",
1: "Active",
2: "Inactive",
3: "Blocked",
}
var MemberStatus_value = map[string]int32{
"PartiticipationStatus_INVALID": 0,
"Active": 1,
"Inactive": 2,
"Blocked": 3,
}
Functions ¶
func GroupMembersIDs ¶
func GroupMembersIDs(members []GroupMember) (ids []uint64)
func GroupMembersIDsUniqueIDHashNameString ¶
GroupMembersIDsUniqueIDHashNameString hashes sortedIDs and returns a hash string on success.
func GroupMembersUniqueIDHashNameString ¶
func GroupMembersUniqueIDHashNameString( sortedCps []GroupMember, ) (hashString string, err error)
GroupMembersUniqueIDHashNameString hashes the ids of sortedCps and returns a hash string on success.
func GroupRelationTypeToStorable ¶
func GroupRelationTypeToStorable( t GroupRelationType, offs uint64, ) (relationID uint64)
GroupRelationTypeToStorable returns the id used in relation store for type t
func GroupToRelatedStoredTopicData ¶
func GroupToRelatedStoredTopicData( g Group, membersHash string, fnOffsetter func(t GroupRelationType) (relationID uint64), ) (d StoredTopicData, err error)
GroupToRelatedStoredTopicData marshales Group g into StoredTopicData d
func IsSaneStorableGroup ¶
IsSaneStorableGroup checks whether this group can be stored in this form. Could be extended
func UnmarshalSingleBaseGroupFromStoredTopicData ¶
UnmarshalSingleBaseGroupFromStoredTopicData unmarshals a single BaseGroup bg from a single StoredTopicData st.
Types ¶
type BaseGroup ¶
type BaseGroup struct { BaseGroupInfo `protobuf:"bytes,1,opt,name=BaseGroupInfo,embedded=BaseGroupInfo" json:",embedded" bson:",inline"` GroupMembers []BaseGroupMember `protobuf:"bytes,2,rep,name=groupMembers" json:"groupMembers"` }
BaseGroup holds a single group for interaction between certain members. Could be extended for more functionality.
func (*BaseGroup) Descriptor ¶
func (*BaseGroup) GetGroupMembers ¶
func (m *BaseGroup) GetGroupMembers() []BaseGroupMember
func (*BaseGroup) GetMembers ¶
func (self *BaseGroup) GetMembers() (members []GroupMember)
func (*BaseGroup) GetNoMembersGroup ¶
func (self *BaseGroup) GetNoMembersGroup() NoMembersGroup
func (*BaseGroup) ProtoMessage ¶
func (*BaseGroup) ProtoMessage()
type BaseGroupInfo ¶
type BaseGroupInfo struct { topicrelation.EntityInfo `protobuf:"bytes,1,opt,name=EntityInfo,embedded=EntityInfo" json:",embedded" bson:",inline"` TopicName string `protobuf:"bytes,2,opt,name=topicName,proto3" json:"topicName,omitempty"` DescriptionName string `protobuf:"bytes,3,opt,name=descriptionName,proto3" json:"descriptionName,omitempty"` Descriptions string `protobuf:"bytes,4,opt,name=descriptions,proto3" json:"descriptions,omitempty"` Tags []string `protobuf:"bytes,5,rep,name=tags" json:"tags,omitempty"` }
BaseGroupInfo defines the basic information used for a group.
func (*BaseGroupInfo) Descriptor ¶
func (*BaseGroupInfo) Descriptor() ([]byte, []int)
func (*BaseGroupInfo) Marshal ¶
func (m *BaseGroupInfo) Marshal() (dAtA []byte, err error)
func (*BaseGroupInfo) ProtoMessage ¶
func (*BaseGroupInfo) ProtoMessage()
func (*BaseGroupInfo) Reset ¶
func (m *BaseGroupInfo) Reset()
func (*BaseGroupInfo) Size ¶
func (m *BaseGroupInfo) Size() (n int)
func (*BaseGroupInfo) String ¶
func (m *BaseGroupInfo) String() string
func (*BaseGroupInfo) Unmarshal ¶
func (m *BaseGroupInfo) Unmarshal(dAtA []byte) error
type BaseGroupMember ¶
type BaseGroupMember struct { topicrelation.EntityInfo `protobuf:"bytes,1,opt,name=EntityInfo,embedded=EntityInfo" json:",embedded" bson:",inline"` LeftAtTime int64 `protobuf:"varint,2,opt,name=leftAtTime,proto3" json:"leftAtTime,omitempty"` }
BaseGroupMember is a single participant/member of a group.
func (*BaseGroupMember) Descriptor ¶
func (*BaseGroupMember) Descriptor() ([]byte, []int)
func (*BaseGroupMember) Marshal ¶
func (m *BaseGroupMember) Marshal() (dAtA []byte, err error)
func (*BaseGroupMember) ProtoMessage ¶
func (*BaseGroupMember) ProtoMessage()
func (*BaseGroupMember) Reset ¶
func (m *BaseGroupMember) Reset()
func (*BaseGroupMember) Size ¶
func (m *BaseGroupMember) Size() (n int)
func (*BaseGroupMember) String ¶
func (m *BaseGroupMember) String() string
func (*BaseGroupMember) Unmarshal ¶
func (m *BaseGroupMember) Unmarshal(dAtA []byte) error
type BaseGroupUnmarshalHandle ¶
type BaseGroupUnmarshalHandle struct {
// contains filtered or unexported fields
}
BaseGroupUnmarshalHandle implements UnmarshalHandle and thus it unmarshals StoredTopicDatas into BaseGroups.
func NewBaseGroupUnmarshalHandle ¶
func NewBaseGroupUnmarshalHandle() (self *BaseGroupUnmarshalHandle)
NewBaseGroupUnmarshalHandle returns a newly allocated BaseGroupUnmarshalHandle.
func (*BaseGroupUnmarshalHandle) BaseGroups ¶
func (self *BaseGroupUnmarshalHandle) BaseGroups() (baseGroups []BaseGroup)
BaseGroups returns the BaseGroups generated by UnmarshalAndAddFromStoredTopicData.
func (*BaseGroupUnmarshalHandle) Reset ¶
func (self *BaseGroupUnmarshalHandle) Reset()
Reset resets.
func (*BaseGroupUnmarshalHandle) UnmarshalAndAddFromStoredTopicData ¶
func (self *BaseGroupUnmarshalHandle) UnmarshalAndAddFromStoredTopicData( sts ...StoredTopicData, ) (err error)
UnmarshalAndAddFromStoredTopicData implements UnmarshalHandle and thus unmarshals sts into BaseGroups.
type ExternalGroupMember ¶
type ExternalGroupMember interface {
EntityInfoGetter
GetGroupID() (groupID uint64)
}
ExternalGroupMember describes a GroupMember for separate usage outside of the group.
type Group ¶
type Group interface { MarshalSerializer EntityInfoGetter EntityInfoSetter GetNoMembersGroup() NoMembersGroup GetMembers() []GroupMember }
Group describes a basic group type with members. It is marshal and unmarshalable and holds an EntityInfo and is a "topic".
type GroupErrorCode ¶
type GroupErrorCode int32
GroupErrorCode defines the codes of errors related to group.
const ( GroupErrorCode_GroupErrorCode_INVALID GroupErrorCode = 0 GroupErrorCode_NoMembers GroupErrorCode = 1 GroupErrorCode_NoMemberID GroupErrorCode = 2 GroupErrorCode_DuplicateMember GroupErrorCode = 3 )
func (GroupErrorCode) EnumDescriptor ¶
func (GroupErrorCode) EnumDescriptor() ([]byte, []int)
func (GroupErrorCode) String ¶
func (x GroupErrorCode) String() string
type GroupMember ¶
type GroupMember interface { MarshalSerializer EntityInfoGetter }
GroupMember describes the basic member type within a group. It is marshal and unmarshalable and holds an EntityInfo and is a "topic" stored within a relation.
type GroupMembersAsc ¶
type GroupMembersAsc []GroupMember
GroupMembersAsc is used to order GroupMembers by ID ascending.
func (GroupMembersAsc) Len ¶
func (a GroupMembersAsc) Len() int
func (GroupMembersAsc) Less ¶
func (a GroupMembersAsc) Less(i, j int) bool
func (GroupMembersAsc) Swap ¶
func (a GroupMembersAsc) Swap(i, j int)
type GroupRelationType ¶
type GroupRelationType int32
GroupRelationType defines the types of relations which are used for groups in the RelationStore.
const ( GroupRelationType_ConversationRelationType_INVALID GroupRelationType = 0 GroupRelationType_Member GroupRelationType = 1 GroupRelationType_AllMembersHash GroupRelationType = 2 GroupRelationType_Tag GroupRelationType = 3 GroupRelationType_AllTags GroupRelationType = 4 )
func (GroupRelationType) EnumDescriptor ¶
func (GroupRelationType) EnumDescriptor() ([]byte, []int)
func (GroupRelationType) String ¶
func (x GroupRelationType) String() string
type GroupStore ¶
type GroupStore interface { // InsertGroup inserts a new group. // Neither the ID nor the name of the group may exist. // An ID is generated for the group. // The group is stored in TopicStore and all the ConversationMembers // are stored again separately in RelationStore. // There is an additional relation which relates to a hash of all Member ids. // This makes the query GetConversationsForMembersIDsExact very easy and fast. // Tags could be stored in RelationStore as well but are not atm. InsertGroup(g Group) (err error) // GetGroupsByIDs gets Groups each with its members from the underlying // topic store and relation store. // A more efficient approach must be implemented // by the TopicRelationStore GetGroupsByIDs( withMembers bool, h UnmarshalHandle, ids ...uint64, ) (err error) // GetGroupsByNames gets Groups each with its members from the underlying // topic store and relation store. // A more efficient approach must be implemented // by the TopicRelationStore GetGroupsByNames( withMembers bool, h UnmarshalHandle, names ...string, ) (err error) // GetGroupsForMemberID returns the group where // exact this MembersID participates. GetGroupsForMemberID( memberID uint64, withMembers bool, offset, limit uint64, h UnmarshalHandle, ) (err error) // GetGroupsForMembersIDs returns all conversations where // these MembersIDs participate. GetGroupsForMembersIDs( membersIDs []uint64, withMembers bool, offset, limit uint64, h UnmarshalHandle, ) (err error) // GetGroupsForMembersIDsExact returns all groups where // exact these MembersIDs participate, not more, not less. // sortedMembersIDs must be sorted in ascending order. GetGroupsForMembersIDsExact( membersIDs []uint64, withMembers bool, offset, limit uint64, h UnmarshalHandle, ) (err error) }
GroupStore.
type MemberStatus ¶
type MemberStatus int32
MemberStatus is hereby used as visibility.
const ( MemberStatus_PartiticipationStatus_INVALID MemberStatus = 0 MemberStatus_Active MemberStatus = 1 MemberStatus_Inactive MemberStatus = 2 MemberStatus_Blocked MemberStatus = 3 )
func (MemberStatus) EnumDescriptor ¶
func (MemberStatus) EnumDescriptor() ([]byte, []int)
func (MemberStatus) String ¶
func (x MemberStatus) String() string
type NoMembersGroup ¶
type NoMembersGroup interface { MarshalSerializer }
NoMembersGroup describes a helper for the group to be marshaled and unmarshaled without members.