client

package
Version: v0.0.0-...-f3c1660 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBootWsService = []string{
		"202.182.101.145:6666",
		"167.179.78.33:6666",
		"198.13.44.159:6666",
	}

	ErrUnknownMsg    = fmt.Errorf("unknown websocket message")
	ErrNoMsgCallback = fmt.Errorf("no message reciver")
)

Functions

func RandomBootNode

func RandomBootNode() string

Types

type CliCallBack

type CliCallBack interface {
	ImmediateMessage(*pbs.WSCryptoMsg) error
	WebSocketClosed()
	UnreadMsg(*pbs.WSUnreadAck) error
	OnlineSuccess()
}

type ContactCli

type ContactCli struct {
	// contains filtered or unexported fields
}

func NewContactCli

func NewContactCli(addr string, key *wallet.Key) (*ContactCli, error)

func (*ContactCli) AddContact

func (cc *ContactCli) AddContact(cid, nickName, remarks string) error

func (*ContactCli) DelContact

func (cc *ContactCli) DelContact(cid string) error

func (*ContactCli) SyncContact

func (cc *ContactCli) SyncContact() ([]*pbs.ContactItem, error)

func (*ContactCli) UpdateContact

func (cc *ContactCli) UpdateContact(cid, nickName, remarks string) error

type WSClient

type WSClient struct {
	IsOnline bool
	// contains filtered or unexported fields
}

func NewWSClient

func NewWSClient(addr string, key *wallet.Key, cb CliCallBack) (*WSClient, error)

func (*WSClient) Online

func (cc *WSClient) Online() error

func (*WSClient) PullUnreadMsg

func (cc *WSClient) PullUnreadMsg(startSeq int64) error

func (*WSClient) ShutDown

func (cc *WSClient) ShutDown()

func (*WSClient) Write

func (cc *WSClient) Write(to string, body []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL