Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type ChatGroup
- type Contact
- type FriendRelation
- type FriendsDemo
- type GroupRelation
- type Manager
- func (am *Manager) BalanceByBlockChain(uid string, b int64) error
- func (am *Manager) FriendOperate(isLocal bool, meta *pbs.FriendMeta) error
- func (am *Manager) GetAccount(addr string) *Account
- func (am *Manager) GetGroupByID(gid string) *ChatGroup
- func (am *Manager) GetOneOfFriendRelation(owner, fid string) *FriendsDemo
- func (am *Manager) GetOrCreateFriendRelation(addr string, create bool) *FriendRelation
- func (am *Manager) GetOrCreateGrpRelations(addr string, create bool) *GroupRelation
- func (am *Manager) GroupOperate(isLocal bool, meta *pbs.GroupMeta) error
- func (am *Manager) StoreWorker(stop chan struct{})
- func (am *Manager) UpdateAccount(isLocal bool, meta *pbs.AccountMeta) error
- func (am *Manager) UpdateAccountBySyncedData(data []byte) error
- func (am *Manager) UpdateFriRelBySyncedData(data []byte) error
- func (am *Manager) UpdateGroupBySyncedData(data []byte) error
- func (am *Manager) UpdateGrpRelBySyncedData(data []byte) error
Constants ¶
View Source
const ( MaxAvatarSize = 1 << 16 TouchInterval = time.Minute * 15 AccDbKeyHead = "account_0" AccDbKeyEnd = "account_1" )
View Source
const ( FriDbKeyStart = "account_friend_0" FriDbKeyEnd = "account_friend_1" )
View Source
const ( GrpRelationDbKeyStart = "account_group_0" GrpRelationDbKeyEnd = "account_group_1" )
View Source
const ( StorageTaskSize = 1024 DirOfAccountData = "account" MetaDelFlag = '-' )
View Source
const ( GrpDbKeyStart = "group_0" GrpDbKeyEnd = "group_1" )
Variables ¶
View Source
var ( ErrInvalidMeta = fmt.Errorf("invalid meta data") ErrAvatarTooBig = fmt.Errorf("avatar size is out of limitation") ErrGasLow = fmt.Errorf("insufficient funds") ErrNotFound = fmt.Errorf("not found") ErrGrpNoRight = fmt.Errorf("group no right") ErrGrpUnknown = fmt.Errorf("group operation unknown") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type ChatGroup ¶
type Contact ¶
type Contact struct { *Account `json:"account,omitempty"` *FriendsDemo `json:"demo,omitempty"` }
type FriendRelation ¶
type FriendRelation struct { Addr string `json:"address"` Friends map[string]*FriendsDemo `json:"demo"` }
func (*FriendRelation) RawData ¶
func (fr *FriendRelation) RawData() []byte
func (*FriendRelation) String ¶
func (fr *FriendRelation) String() string
type FriendsDemo ¶
func (*FriendsDemo) RawData ¶
func (fd *FriendsDemo) RawData() []byte
func (*FriendsDemo) String ¶
func (fd *FriendsDemo) String() string
type GroupRelation ¶
func (*GroupRelation) RawData ¶
func (gr *GroupRelation) RawData() []byte
func (*GroupRelation) String ¶
func (gr *GroupRelation) String() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) BalanceByBlockChain ¶
func (*Manager) FriendOperate ¶
func (am *Manager) FriendOperate(isLocal bool, meta *pbs.FriendMeta) error
func (*Manager) GetAccount ¶
func (*Manager) GetGroupByID ¶
func (*Manager) GetOneOfFriendRelation ¶
func (am *Manager) GetOneOfFriendRelation(owner, fid string) *FriendsDemo
func (*Manager) GetOrCreateFriendRelation ¶
func (am *Manager) GetOrCreateFriendRelation(addr string, create bool) *FriendRelation
func (*Manager) GetOrCreateGrpRelations ¶
func (am *Manager) GetOrCreateGrpRelations(addr string, create bool) *GroupRelation
func (*Manager) GroupOperate ¶
func (*Manager) StoreWorker ¶
func (am *Manager) StoreWorker(stop chan struct{})
func (*Manager) UpdateAccount ¶
func (am *Manager) UpdateAccount(isLocal bool, meta *pbs.AccountMeta) error
func (*Manager) UpdateAccountBySyncedData ¶
func (*Manager) UpdateFriRelBySyncedData ¶
func (*Manager) UpdateGroupBySyncedData ¶
func (*Manager) UpdateGrpRelBySyncedData ¶
Click to show internal directories.
Click to hide internal directories.