http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSSEStream added in v1.1.0

func IsSSEStream(resp *http.Response) bool

IsSSEStream check if the response is a SSE stream

func IsStreamableResponse added in v1.1.0

func IsStreamableResponse(resp *http.Response) bool

IsStreamableResponse check if the response is streamable Determine whether it is a streaming response based on the following conditions: 1. Using Transfer-Encoding: chunked 2. The content type indicates that this is a streamable response (e.g. text/event-stream, application/json, etc.)

Types

type Client

type Client struct{}

Client client to generic invoke dubbo

func NewHTTPClient

func NewHTTPClient() *Client

NewHTTPClient create dubbo client

func SingletonHTTPClient

func SingletonHTTPClient() *Client

SingletonHTTPClient singleton HTTP Client

func (*Client) Apply added in v1.1.0

func (dc *Client) Apply() error

Apply only init dubbo, config mapping can do here

func (*Client) Call

func (dc *Client) Call(req *client.Request) (resp any, err error)

Call invoke service

func (*Client) Close

func (dc *Client) Close() error

Close close

func (*Client) MapParams

func (dc *Client) MapParams(req *client.Request) (reqData any, err error)

MapParams param mapping to api.

type RestMetadata

type RestMetadata struct {
	ApplicationName      string   `yaml:"application_name" json:"application_name" mapstructure:"application_name"`
	Group                string   `yaml:"group" json:"group" mapstructure:"group"`
	Version              string   `yaml:"version" json:"version" mapstructure:"version"`
	Interface            string   `yaml:"interface" json:"interface" mapstructure:"interface"`
	Method               string   `yaml:"method" json:"method" mapstructure:"method"`
	Types                []string `yaml:"type" json:"types" mapstructure:"types"`
	Retries              string   `yaml:"retries"  json:"retries,omitempty" property:"retries"`
	ClusterName          string   `yaml:"cluster_name"  json:"cluster_name,omitempty" property:"cluster_name"`
	ProtocolTypeStr      string   `yaml:"protocol_type"  json:"protocol_type,omitempty" property:"protocol_type"`
	SerializationTypeStr string   `yaml:"serialization_type"  json:"serialization_type,omitempty" property:"serialization_type"`
}

RestMetadata http metadata, api config

Jump to

Keyboard shortcuts

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