client

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBuilder

type IBuilder interface {
	Request(string, request.IRequest) *pkg_settings.SRequest
	Friend(string, asymmetric.IPubKey) *pkg_settings.SFriend
}

func NewBuilder

func NewBuilder() IBuilder

type IClient

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

	SetNetworkKey(string) error
	GetPubKey() (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

	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)

	SetNetworkKey(string) error
	GetPubKey() (asymmetric.IPubKey, 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

	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