Documentation ¶
Index ¶
- func CS2Readable(contents interface{}) (interface{}, error)
- func Content2Readable(content *core.QContent) (map[string]interface{}, error)
- func FBCommunity2Community(uid string, fbc *FBCommunity) (*core.Community, error)
- func FBIndividual2Individual(uid string, fbi *FBIndividual) (*core.Individual, error)
- func FBStruct2Data(fbstruct interface{}) (map[string]interface{}, error)
- type FBCommunity
- type FBContent
- type FBIndividual
- type FBQuantum
- func Data2FBQuantum(d map[string]interface{}) (*FBQuantum, error)
- func NewFBQuantum(q *core.Quantum) (*FBQuantum, error)
- func NewFBQuantumFromDB(sig core.Sig, collect *firestore.CollectionRef, ctx context.Context) (*FBQuantum, error)
- func NewFBQuantumFromSnap(docSnapshot *firestore.DocumentSnapshot) (*FBQuantum, error)
- type FBSig
- type FBUniverse
- func (fbu *FBUniverse) Close() error
- func (fbu *FBUniverse) GetCommunity(sig core.Sig) (*core.Community, error)
- func (fbu *FBUniverse) GetIndividual(address identity.Address) (*core.Individual, error)
- func (fbu *FBUniverse) GetQuantum(sig core.Sig) (*core.Quantum, error)
- func (fbu *FBUniverse) GetQuantums(limit int, skip int, desc bool) ([]*core.Quantum, error)
- func (fbu *FBUniverse) HideProcessedQuantum(sig core.Sig) error
- func (fbu *FBUniverse) JudgeCommunity(sig core.Sig, level int, statement string) error
- func (fbu *FBUniverse) JudgeIndividual(address identity.Address, level int, judgment string, evidence ...[]core.Sig) error
- func (fbu *FBUniverse) ProcessQuantums(limit, skip int) (accept []core.Sig, wait []core.Sig, reject []core.Sig, err error)
- func (fbu *FBUniverse) ProcessSingleQuantum(sig core.Sig) error
- func (fbu *FBUniverse) QueryIndividuals(sig core.Sig, skip int, limit int, desc bool) ([]*core.Individual, error)
- func (fbu *FBUniverse) QueryQuantums(address identity.Address, qType int, skip int, limit int, desc bool) ([]*core.Quantum, error)
- func (fbu *FBUniverse) ReceiveQuantums(quantums []*core.Quantum) (accept []core.Sig, wait []core.Sig, reject []core.Sig, err error)
- type UniverseStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CS2Readable ¶
func CS2Readable(contents interface{}) (interface{}, error)
func Content2Readable ¶
func FBCommunity2Community ¶
func FBCommunity2Community(uid string, fbc *FBCommunity) (*core.Community, error)
func FBIndividual2Individual ¶
func FBIndividual2Individual(uid string, fbi *FBIndividual) (*core.Individual, error)
func FBStruct2Data ¶
Types ¶
type FBCommunity ¶
type FBCommunity struct { Note *core.QContent `json:"note"` DefineSigHex string `json:"define"` CreatorAddrHex string `json:"creator"` MinCosignCnt int `json:"minCosignCnt"` MaxInviteCnt int `json:"maxInviteCnt"` InitMembersHex []string `json:"initMembers"` Members map[string]bool `json:"members"` InviteCnt map[string]int `json:"inviteCnt"` CreateTimestamp int64 `json:"createTime"` UpdateTimestamp int64 `json:"updateTime"` }
func Data2FBCommunity ¶
func Data2FBCommunity(d map[string]interface{}) (*FBCommunity, error)
type FBContent ¶
type FBContent struct { Data interface{} `json:"data,omitempty"` Format int `json:"fmt"` }
type FBIndividual ¶
type FBIndividual struct { AddrHex string `json:"address"` LastSigHex string `json:"last"` // last sig of quantum LastSelfSeq int64 `json:"lseq"` // last self sequance Profile map[string]*core.QContent `json:"profile,omitempty"` ReadableProfile map[string]*FBContent `json:"rp,omitempty"` Attitude *core.Attitude `json:"attitude"` CreateTimestamp int64 `json:"createTime"` UpdateTimestamp int64 `json:"updateTime"` }
func Data2FBIndividual ¶
func Data2FBIndividual(d map[string]interface{}) (*FBIndividual, error)
type FBQuantum ¶
type FBQuantum struct { Received []byte `json:"recv,omitempty"` Origin []byte `json:"origin,omitempty"` Contents []*core.QContent `json:"cs,omitempty"` Type int `json:"type"` FBRef []*FBSig `json:"refs"` Sequence int64 `json:"seq,omitempty"` SelfSeq int64 `json:"sseq,omitempty"` AddrHex string `json:"address,omitempty"` SigHex string `json:"sig,omitempty"` ReadableCS []*FBContent `json:"rcs,omitempty"` CreateTimestamp int64 `json:"createTime"` Trash []byte `json:"trash,omitempty"` Ignore []byte `json:"ignore,omitempty"` ManualIgnore []byte `json:"manualIgnore,omitempty"` }
func Data2FBQuantum ¶
func NewFBQuantumFromDB ¶ added in v0.3.1
func NewFBQuantumFromSnap ¶ added in v0.3.1
func NewFBQuantumFromSnap(docSnapshot *firestore.DocumentSnapshot) (*FBQuantum, error)
type FBUniverse ¶
type FBUniverse struct {
// contains filtered or unexported fields
}
func NewFBUniverse ¶
func (*FBUniverse) Close ¶
func (fbu *FBUniverse) Close() error
func (*FBUniverse) GetCommunity ¶
func (*FBUniverse) GetIndividual ¶
func (fbu *FBUniverse) GetIndividual(address identity.Address) (*core.Individual, error)
func (*FBUniverse) GetQuantum ¶
func (*FBUniverse) GetQuantums ¶ added in v0.3.1
GetQuantums is not belong to interface of core/universe this function can be used to backup data by node owner or download data from node by user
func (*FBUniverse) HideProcessedQuantum ¶ added in v0.3.1
func (fbu *FBUniverse) HideProcessedQuantum(sig core.Sig) error
HideProcessedQuantum is not belong to interface of PDU Universe. In PDU system, each quantum is public and can not be completely removed from system, this function is just for convenience.
func (*FBUniverse) JudgeCommunity ¶
func (*FBUniverse) JudgeIndividual ¶
func (*FBUniverse) ProcessQuantums ¶ added in v0.3.1
func (*FBUniverse) ProcessSingleQuantum ¶
func (fbu *FBUniverse) ProcessSingleQuantum(sig core.Sig) error
func (*FBUniverse) QueryIndividuals ¶ added in v0.3.1
func (fbu *FBUniverse) QueryIndividuals(sig core.Sig, skip int, limit int, desc bool) ([]*core.Individual, error)
func (*FBUniverse) QueryQuantums ¶ added in v0.3.1
type UniverseStatus ¶
Click to show internal directories.
Click to hide internal directories.