define

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: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Client requst type
	OFFLINE = 41
	ONLINE  = 42
)

Variables

View Source
var Config = new(DBConfig)

Functions

func Get_uuid

func Get_uuid() string

func SetKey

func SetKey(addr string)

Types

type Ctrl

type Ctrl struct {
	Id   string
	Auth string
}

type DBConfig

type DBConfig struct {
	DBType string

	UserAddr string // DB addr.
	UserName string // DB name.
	Clients  string
	Ctrls    string
	Salt     string // Sha512's salt.

	MsgAddr     string // DB addr.
	MsgName     string // DB name.
	OfflineName string // Collection name.
	SubName     string // Collection name.
	SubsName    string // Collection name.
	SubMsgName  string // Collection name.

	OfflineMsgs int // The max of the offline msgs.
}

type Msg

type Msg struct {
	Id     string
	Msg_id int    // Msg ID
	Owner  string // Owner
	To_id  string
	Topic  string
	Body   []byte
	Typ    int // Online or Oflline msg

	Dup byte // mqtt dup

	Expired int64

	// sub msgs.
	IsSub bool
}

type Sub

type Sub struct {
	Id  string
	Own string

	Max int // Max of the group members
	Typ int
}

type SubMsgs

type SubMsgs struct {
	Id    string
	Count int64
	Body  []byte
}

type Sub_map

type Sub_map struct {
	Sub_id  string
	User_id string
}

type User

type User struct {
	Id    string
	Psw   string
	Owner string // Owner
}

Jump to

Keyboard shortcuts

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