nighthawk

package
v0.0.0-...-c8bc4d7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrGRPCDialCode        = "1000"
	ErrInvalidEndpointCode = "1001"
	ErrResponseNilCode     = "1002"
)

Variables

View Source
var (
	ErrInvalidEndpoint = errors.NewDefault(ErrInvalidEndpointCode, "Endpoint is unavailable or endpoint is unreachable")
	ErrResponseNil     = errors.NewDefault(ErrResponseNilCode, "Response is nil from the generator")
)

Functions

func ErrGRPCDial

func ErrGRPCDial(err error) error

func Transform

func Transform(res *nighthawk_client.ExecutionResponse) ([]byte, error)

func Transform transforms nighthawk's json output to fortio compatible json output This implementation is adpated from nighthawk's own transformer https://github.com/envoyproxy/nighthawk/blob/main/source/client/output_formatter_impl.cc

Types

type Client

type Client struct {
	Handler nighthawk_client.NighthawkServiceClient
	// contains filtered or unexported fields
}

Client holds the nighthawk client information

func New

func New(opts Options) (*Client, error)

New creates a new instance of the nighthawk client connection

func (*Client) Close

func (c *Client) Close() error

Close closes the client connection

type Options

type Options struct {
	ServerHost string
	ServerPort int32
}

Options argument for customizing the client

Jump to

Keyboard shortcuts

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