clients

package
v0.0.0-...-765c7dd Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default, _ = New(WithURL("http://localhost:8080"))
View Source
var (
	ErrEndpointNotGiven = fmt.Errorf("%w: endpoint not given", gbioerr.Err)
)

Functions

func Use

func Use(opts ...Option) error

Types

type Client

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

func New

func New(opts ...Option) (c *Client, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) HttpClient

func (c *Client) HttpClient() *http.Client

func (*Client) Request

func (c *Client) Request(
	epName, path string,
	e encoding.Encoder,
) (*http.Request, error)

type Endpoint

type Endpoint struct {
	endpoints.Endpoint
	Cl    *Client
	Error error
}

type Option

type Option func(c *Client) error

func WithHttpClient

func WithHttpClient(h *http.Client) Option

func WithRegistry

func WithRegistry(
	cfg *etcd.Config,
	opts ...RegistryOption,
) Option

func WithURL

func WithURL(rawUrl string) Option

type RegistryOption

type RegistryOption func(r *registries.CachedRegistry)

func WithContext

func WithContext(ctx context.Context) RegistryOption

func WithPickFirst

func WithPickFirst() RegistryOption

func WithPickRandom

func WithPickRandom() RegistryOption

func WithPrefix

func WithPrefix(p string) RegistryOption

func WithTick

func WithTick(d time.Duration) RegistryOption

Jump to

Keyboard shortcuts

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