client

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpTimeOut = time.Second * 15
)

Variables

View Source
var (
	ErrInvalidProtoData = fmt.Errorf("invalid proto data")
	ErrNotFound         = fmt.Errorf("not found")
)
View Source
var (
	ErrUnknownMsg    = fmt.Errorf("unknown websocket message")
	ErrNoMsgCallback = fmt.Errorf("no message reciver")
	ErrNoValidNode   = fmt.Errorf("no valid service node")
)

Functions

func GetValidBootNodeIP added in v1.2.2

func GetValidBootNodeIP() (string, error)

func StatusCheck

func StatusCheck(ip string) error

Types

type ChainClient added in v1.2.2

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

func NewChainClient added in v1.2.2

func NewChainClient(base string) *ChainClient

func (*ChainClient) GetAccountMeta added in v1.2.2

func (cc *ChainClient) GetAccountMeta(userAddr string) (*account.Account, error)

func (*ChainClient) GetBlockByIdx added in v1.2.2

func (cc *ChainClient) GetBlockByIdx(nonce *big.Int) (*block.Block, error)

func (*ChainClient) GetFriendsOf added in v1.2.2

func (cc *ChainClient) GetFriendsOf(userAddr string) (*account.FriendRelation, error)

func (*ChainClient) GetGroupMeta added in v1.2.2

func (cc *ChainClient) GetGroupMeta(gid string) (*account.ChatGroup, error)

func (*ChainClient) GetGroupsOf added in v1.2.2

func (cc *ChainClient) GetGroupsOf(userAddr string) (*account.GroupRelation, error)

func (*ChainClient) GetLatestBlock added in v1.2.2

func (cc *ChainClient) GetLatestBlock() (*block.Block, error)

func (*ChainClient) GetOneFriendOf added in v1.2.2

func (cc *ChainClient) GetOneFriendOf(userAddr, friend string) (*account.Contact, error)

func (*ChainClient) RawChainTransaction added in v1.2.2

func (cc *ChainClient) RawChainTransaction(path string, raw, sig []byte) (string, error)

func (*ChainClient) SetBasUrl added in v1.2.2

func (cc *ChainClient) SetBasUrl(newIP string)

type CliCallBack

type CliCallBack interface {
	ImmediateMessage(msg *pbs.WSCryptoMsg) error
	WebSocketClosed()
	OnlineSuccess()
	NoRightTips(tips *pbs.WSNoRightTips)
}

type WSClient

type WSClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewWSClient

func NewWSClient(nodeIP string, cb CliCallBack) (*WSClient, error)

func (*WSClient) IsOnline

func (cc *WSClient) IsOnline() bool

func (*WSClient) OffLine added in v1.2.2

func (cc *WSClient) OffLine()

func (*WSClient) Online

func (cc *WSClient) Online(onlineData []byte) error

func (*WSClient) PullUnreadMsg

func (cc *WSClient) PullUnreadMsg(startSeq int64, selfID string) error

func (*WSClient) ResetUrl added in v1.2.2

func (cc *WSClient) ResetUrl(newIP string)

func (*WSClient) Write

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

Jump to

Keyboard shortcuts

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