client

package
v1.5.18 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IClient

type IClient interface {
	GetIndex() (string, error)
	GetSettings() (config.IConfigSettings, error)

	GetNetworkKey() (string, error)
	SetNetworkKey(string) error

	GetPubKey() (asymmetric.IPubKey, asymmetric.IPubKey, error)
	SetPrivKey(asymmetric.IPrivKey, asymmetric.IPubKey) error

	GetOnlines() ([]string, error)
	DelOnline(string) error

	GetFriends() (map[string]asymmetric.IPubKey, error)
	AddFriend(string, asymmetric.IPubKey) error
	DelFriend(string) error

	GetConnections() ([]string, error)
	AddConnection(string) error
	DelConnection(string) error

	HandleMessage(message.IMessage) error

	BroadcastRequest(string, request.IRequest) error
	FetchRequest(string, request.IRequest) (response.IResponse, error)
}

func NewClient

func NewClient(pBuilder IBuilder, pRequester IRequester) IClient

type IRequester

type IRequester interface {
	GetIndex() (string, error)
	GetSettings() (config.IConfigSettings, error)

	GetNetworkKey() (string, error)
	SetNetworkKey(string) error

	GetPubKey() (asymmetric.IPubKey, asymmetric.IPubKey, error)
	SetPrivKey(*pkg_settings.SPrivKey) error

	GetOnlines() ([]string, error)
	DelOnline(string) error

	GetFriends() (map[string]asymmetric.IPubKey, error)
	AddFriend(*pkg_settings.SFriend) error
	DelFriend(*pkg_settings.SFriend) error

	GetConnections() ([]string, error)
	AddConnection(string) error
	DelConnection(string) error

	HandleMessage(string) error

	BroadcastRequest(*pkg_settings.SRequest) error
	FetchRequest(*pkg_settings.SRequest) (response.IResponse, error)
}

func NewRequester

func NewRequester(pHost string, pClient *http.Client) IRequester

Jump to

Keyboard shortcuts

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