client

package
v0.0.0-...-d0e18b1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HUSHCOM - Destination name for the Hushcom Server
	HUSHCOM = "HushComServer"
	// HUSHCOMPKA - ASCII base64 version of Server PubKey
	HUSHCOMPKA = "EuUE0KI4cySH/BkLSHlr7iBAaYikdYAC6M0GhxMk3Ew="
	// HUSHCOMPK - binary version of Server PubKey
	HUSHCOMPK bc.PubKey
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Node api.Node

	CurrentProfileName   string
	CurrentProfilePubKey bc.PubKey

	// Output - Buffered AJAX Output
	Output string
	// contains filtered or unexported fields
}

Client - Hushcom Client

func New

func New(node api.Node) *Client

New : Make a new instance of Hushcom Client

func (*Client) GetName

func (*Client) GetName() string

GetName - Getter for readable name of the module

func (*Client) HCSend

func (modInst *Client) HCSend(
	msgType string, channel bool, to string,
	signKey bc.PubKey, destKey bc.PubKey, hcmsg interface{}) error

HCSend - Send message via this client instance

func (*Client) HandleMsg

func (modInst *Client) HandleMsg(msg api.Msg) error

HandleMsg - handler for messages

func (*Client) NewJoinChanMsg

func (modInst *Client) NewJoinChanMsg(channelName string, channelPubKey bc.PubKey,
	password string) error

NewJoinChanMsg - Create a join channel request

func (*Client) NewJoinChanRespMsg

func (modInst *Client) NewJoinChanRespMsg(channelName string, channelPrivKeyB64 string,
	userName string, destKey bc.PubKey) error

NewJoinChanRespMsg - Create a join channel response

func (*Client) NewListChansMsg

func (modInst *Client) NewListChansMsg() error

NewListChansMsg - Create a "List Public Channels" message for the Hushcom server

func (*Client) NewNewChanMsg

func (modInst *Client) NewNewChanMsg(chanName string, chanPubKey string) error

NewNewChanMsg - Create a "register a new channel" message for the Hushcom server

func (*Client) NewRegisterMsg

func (modInst *Client) NewRegisterMsg() error

NewRegisterMsg - Create a "register a user" message for the Hushcom server

func (*Client) NewUnregisterMsg

func (modInst *Client) NewUnregisterMsg() error

NewUnregisterMsg - Create an "Unregister a user" message for the Hushcom server

type JSONResp

type JSONResp struct {
	From    string
	MsgType string
	Channel string
	Data    interface{}
}

JSONResp - Response Structure to AJAX

Jump to

Keyboard shortcuts

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