basehertz

package module
v0.0.0-...-5c2c970 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package basehertz contains a base transport which is used by hertz transports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(name string, logger log.Logger, scheme string, clientCreator TransportClientCreator,
) (orb.TransportType, error)

NewTransport creates a Transport with a custom http.Client.

Types

type Transport

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

Transport is a go-orb/plugins/client/orb compatible transport.

func (*Transport) Call

func (t *Transport) Call(ctx context.Context, req *client.Request[any, any], opts *client.CallOptions,
) (*client.RawResponse, error)

Call does the actual rpc call to the server.

func (*Transport) CallNoCodec

func (t *Transport) CallNoCodec(_ context.Context, _ *client.Request[any, any], _ any, _ *client.CallOptions) error

CallNoCodec is a noop for http based transports.

func (*Transport) NeedsCodec

func (t *Transport) NeedsCodec() bool

NeedsCodec is always true for http based transports.

func (*Transport) Start

func (t *Transport) Start() error

Start starts the transport.

func (*Transport) Stop

func (t *Transport) Stop(_ context.Context) error

Stop stop the transport.

func (*Transport) String

func (t *Transport) String() string

type TransportClientCreator

type TransportClientCreator func() (*hclient.Client, error)

TransportClientCreator is a factory for a client transport.

Jump to

Keyboard shortcuts

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