client

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout is the default value of the thrift client timeout.
	// It is so large because analyzing of a firmware image usually takes
	// few seconds, so we allow up-to 1 minute just in case.
	DefaultTimeout = time.Minute

	// DefaultProtocol is the default protocol used for Thrift
	DefaultProtocol = "binary"
)

Variables

View Source
var (
	// MaxFirmwareImageSize defines the maximum allowed size of a firmware image
	// to be sent.
	MaxFirmwareImageSize = uint(256 * miB)
)

Functions

This section is empty.

Types

type Backend

Backend is just a type-alias to the actual Thrift client, which then being wrapped with the fanciness of this package.

type Client

type Client struct {
	*Backend
	BackendTransport thrift.TTransport
}

Client is just a client for the firmware analyzer service.

func NewClient

func NewClient(ctx context.Context, opts ...Option) (*Client, error)

NewClient constructs a client for the firmware analyzer service.

func (*Client) Close

func (c *Client) Close() error

type ErrEndpointsListEmpty

type ErrEndpointsListEmpty struct{}

ErrEndpointsListEmpty means the Endpoints list is provided, but it is empty; most likely an internal error in the code. If there are no Endpoints then pass nil instead.

func (ErrEndpointsListEmpty) Error

func (err ErrEndpointsListEmpty) Error() string

Error implements interface "error"

type ErrImageTooLarge

type ErrImageTooLarge struct {
	MaxSize      uint
	ReceivedSize uint
}

func (ErrImageTooLarge) Error

func (err ErrImageTooLarge) Error() string

type ErrNoDestination

type ErrNoDestination struct{}

ErrNoDestination means neither Endpoints nor SMC tier is set.

func (ErrNoDestination) Error

func (err ErrNoDestination) Error() string

Error implements interface "error"

type ErrRequestIsNil

type ErrRequestIsNil struct{}

func (ErrRequestIsNil) Error

func (err ErrRequestIsNil) Error() string

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an abstract option for NewClient.

type OptionEndpoints

type OptionEndpoints []string

OptionEndpoints is an option to set an address to connect to instead of SMC tier through SR.

type OptionLogLocalHostname

type OptionLogLocalHostname string

OptionLogLocalHostname is an option to sent local hostname to the server, to get it logged on the serve side

type OptionRemoteLogLevel

type OptionRemoteLogLevel logger.Level

OptionRemoteLogLevel is an option to override logging level on the server.

type OptionTimeout

type OptionTimeout time.Duration

OptionTimeout is an option to set the timeout for the thrift client.

Jump to

Keyboard shortcuts

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