store

package
v0.0.0-...-e0071fa Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(data []byte) (err error)

Types

type DataStorer

type DataStorer interface {

	// Get the offline msg from the database which you choosed.
	GetOfflineMsg(id string, fin <-chan byte) (<-chan *Msg, <-chan byte)
	// Get the muber of the offline msgs.
	// GetOfflineCount(id string) (int, error)
	// Delete the offline msg.
	DelOfflineMsg(id string) error
	// Insert a msg to the database.
	InsertOfflineMsg(msg *Msg, ip string, etcds []string) error

	// Check the ctrl use login.
	Ctrl_login(id, auth string) (bool, string)
	// Check the user login.
	Client_login(id, psw string) bool
	// Add a client user.
	AddUser(u *User) error
	// Del a client user.
	DelUser(id string, own string) error
	// Check a user wheather belong a ctrl user.
	IsUserExist(uid, oid string) bool
	// Get the whole of the ctrl's users.
	ChanUserID(own string) <-chan string

	// Add a sub.
	AddSub(sub *Sub) error
	// Del a sub.
	DelSub(sub_id, id string) error
	// Add a user into a sub
	AddUserToSub(sm *Sub_map, id string) error
	// Del a user from a sub
	DelUserFromSub(sm *Sub_map, id string) error
	// Check a sub weather exist.
	IsSubExist(sub_id, id string) bool
	// Get a sub all users
	ChanSubUsers(sub_id string) <-chan string
}
var Manager DataStorer

A db manage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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