http2

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

README

Http2 server for FNS

Install

go get github.com/aacfactory/fns-contrib/http/http2

Usage

Make sure tls is used.

app := fns.New(
    fns.Server(http2.Server()),
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Server

func Server() service.Http

Types

type Client

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

func NewClient

func NewClient(address string, cliTLS *tls.Config, opts *ClientOptions) (client *Client, err error)

func (*Client) Close

func (client *Client) Close()

func (*Client) Get

func (client *Client) Get(ctx context.Context, path string, header http.Header) (status int, respHeader http.Header, respBody []byte, err error)

func (*Client) Key

func (client *Client) Key() (key string)

func (*Client) Post

func (client *Client) Post(ctx context.Context, path string, header http.Header, body []byte) (status int, respHeader http.Header, respBody []byte, err error)

type ClientOptions

type ClientOptions struct {
	MaxConns                  int
	MaxConnDuration           time.Duration
	MaxIdleConnDuration       time.Duration
	MaxIdemponentCallAttempts int
	ReadBufferSize            int
	WriteBufferSize           int
	ReadTimeout               time.Duration
	WriteTimeout              time.Duration
	MaxResponseBodySize       int
	MaxConnWaitTimeout        time.Duration
}

func NewClientOptions

func NewClientOptions(opt *service.FastHttpClientOptions) (v *ClientOptions, err error)

type Dialer

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

func NewDialer

func NewDialer(cliTLS *tls.Config, config *service.FastHttpClientOptions) (dialer *Dialer, err error)

func (*Dialer) Close

func (dialer *Dialer) Close()

func (*Dialer) Dial

func (dialer *Dialer) Dial(address string) (client service.HttpClient, err error)

Jump to

Keyboard shortcuts

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