client

package
v0.0.0-...-1c24166 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Addr     string
	Weight   int
	Metadata map[string]string
}

type Balancer

type Balancer interface {
	Select() (*Address, error)
	Update([]*Address)
}

type Client

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

func NewClient

func NewClient(opts ...Option) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string, req, rsp any) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, req, rsp any) error

func (*Client) Head

func (c *Client) Head(ctx context.Context, path string, req, rsp any) error

func (*Client) Invoke

func (c *Client) Invoke(ctx context.Context, method, path string, req, rsp any) error

func (*Client) Options

func (c *Client) Options(ctx context.Context, path string, req, rsp any) error

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, req, rsp any) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, req, rsp any) error

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, req, rsp any) error

func (*Client) Use

func (c *Client) Use(mws ...Middleware) *Client

type Handler

type Handler func(ctx context.Context, req interface{}) (interface{}, error)

type Middleware

type Middleware func(Handler) Handler

func Chain

func Chain(m ...Middleware) Middleware

type Option

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

func Registry

func Registry(r registry.Registry) Option

func WithServiceAddr

func WithServiceAddr(addr string) Option

func WithServiceName

func WithServiceName(name string) Option

type Peer

type Peer struct {
	Addr *Address
	// contains filtered or unexported fields
}

type RR

type RR struct {
	Nodes []*Address
	Next  int
}

func (*RR) Select

func (r *RR) Select() (*Address, error)

func (*RR) Update

func (r *RR) Update(addresses []*Address)

type Resolver

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

func (*Resolver) Close

func (r *Resolver) Close()

type Target

type Target struct {
	Scheme    string
	Authority string
	Endpoint  string
}

type Wrr

type Wrr struct {
	Next int
	// contains filtered or unexported fields
}

func (*Wrr) Select

func (w *Wrr) Select() (*Address, error)

func (*Wrr) Update

func (w *Wrr) Update(addresses []*Address)

Jump to

Keyboard shortcuts

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