pd

package
v0.0.0-...-0119d12 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNS = errorx.NewNamespace("error.pd")
View Source
var ErrPDClientRequestFailed = ErrNS.NewType("client_request_failed")

Functions

func NewEtcdClient

func NewEtcdClient(lc fx.Lifecycle, config *config.Config) (*clientv3.Client, error)

Types

type Client

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

func NewPDClient

func NewPDClient(lc fx.Lifecycle, httpClient *httpc.Client, config *config.Config) *Client

func (Client) AddRequestHeader

func (c Client) AddRequestHeader(key, value string) *Client

func (*Client) Get

func (c *Client) Get(relativeURI string) (*httpc.Response, error)

func (*Client) SendGetRequest

func (c *Client) SendGetRequest(relativeURI string) ([]byte, error)

func (*Client) SendPostRequest

func (c *Client) SendPostRequest(relativeURI string, body io.Reader) ([]byte, error)

func (Client) WithAddress

func (c Client) WithAddress(host string, port int) *Client

func (Client) WithBaseURL

func (c Client) WithBaseURL(baseURL string) *Client

func (Client) WithTimeout

func (c Client) WithTimeout(timeout time.Duration) *Client

func (Client) WithoutPrefix

func (c Client) WithoutPrefix() *Client

Jump to

Keyboard shortcuts

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