client

package
v1.6.12 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest       = &SClientError{"bad request"}
	ErrDecodeResponse   = &SClientError{"decode response"}
	ErrInvalidResponse  = &SClientError{"invalid response"}
	ErrInvalidHexFormat = &SClientError{"invalid hex format"}
	ErrInvalidTitle     = &SClientError{"invalid title"}
	ErrDecodeMessage    = &SClientError{"decode message"}
)

Functions

This section is empty.

Types

type IBuilder

type IBuilder interface {
	PutMessage(net_message.IMessage) string
}

func NewBuilder

func NewBuilder() IBuilder

type IClient

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

	GetPointer(context.Context) (uint64, error)
	GetHash(context.Context, uint64) (string, error)

	GetMessage(context.Context, string) (net_message.IMessage, error)
	PutMessage(context.Context, net_message.IMessage) error
}

func NewClient

func NewClient(pBuilder IBuilder, pRequester IRequester) IClient

type IRequester

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

	GetPointer(context.Context) (uint64, error)
	GetHash(context.Context, uint64) (string, error)

	GetMessage(context.Context, string) (net_message.IMessage, error)
	PutMessage(context.Context, string) error
}

func NewRequester

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

type SClientError added in v1.6.8

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

func (*SClientError) Error added in v1.6.8

func (err *SClientError) Error() string

Jump to

Keyboard shortcuts

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