http

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 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 AtomMetadata

type AtomMetadata struct {
	ApplicationID string `json:"application.id"`
	ServiceName   string `json:"service.name"`
	InstanceID    string `json:"instance.id"`
	GroupID       string `json:"group.id"`
	LocalIP       string `json:"connection.ip"`
	LocalPort     string `json:"service.port"`
	NamespaceID   string `json:"namespace.id"`
	Interface     string `json:"interface"`
}

type Client

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

func NewClient

func NewClient(optFunc ...Option) *Client

func (*Client) Do

func (c *Client) Do(method string, url string, reqBody interface{}, respBody interface{}) (header http.Header, err error)

Do http do

func (*Client) Get

func (c *Client) Get(url string, respBody interface{}) (header http.Header, err error)

Get http get

func (*Client) Post

func (c *Client) Post(url string, reqBody interface{}, respBody interface{}) (err error)

Post http post

func (*Client) Put

func (c *Client) Put(url string, reqBody interface{}, respBody interface{}) (err error)

Put http put

type Metadata

type Metadata struct {
	ApplicationID      string `json:"ai"`
	ApplicationVersion string `json:"av"`
	ServiceName        string `json:"sn"`
	InstanceID         string `json:"ii"`
	GroupID            string `json:"gi"`
	LocalIP            string `json:"li"`
	NamespaceID        string `json:"ni"`
}

type Option

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

Option configures how we set up the client.

func WithMaxConnPerHost

func WithMaxConnPerHost(max int) Option

WithMaxConnPerHost returns a Option that configures a maxConnsPerHost for dialing a ClientConn initially.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout returns a Option that configures a timeout for dialing a ClientConn initially.

Jump to

Keyboard shortcuts

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