http

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

*------------------------------------------------------------**

  • @filename http/xxx.go
  • @author jinycoo - caojingyin@jinycoo.com
  • @version 1.0.0
  • @date 2019/10/24 11:03
  • @desc dean - http - summary **------------------------------------------------------------*

*------------------------------------------------------------**

  • @filename http/xxx.go
  • @author jinycoo - caojingyin@jinycoo.com
  • @version 1.0.0
  • @date 2019/10/24 11:06
  • @desc dean - http - summary **------------------------------------------------------------*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// FollowRedirects instructs the client to follow 301/302 redirects when idempotent.
	FollowRedirects bool
	// contains filtered or unexported fields
}

func (*Client) Delete

func (c *Client) Delete(url string, headers map[string][]string) (client.Status, map[string][]string, io.ReadCloser, error)

Delete sends a DELETE request. If the response body is non nil it must be closed.

func (*Client) Do

func (c *Client) Do(method, url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error)

func (*Client) Get

func (c *Client) Get(url string, headers map[string][]string) (client.Status, map[string][]string, io.ReadCloser, error)

Get sends a GET request. If the response body is non nil it must be closed.

func (*Client) Patch

func (c *Client) Patch(url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error)

Patch sends a PATCH request, suppling the contents of the reader as the request body.

func (*Client) Post

func (c *Client) Post(url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error)

Post sends a POST request, suppling the contents of the reader as the request body.

func (*Client) Put

func (c *Client) Put(url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error)

Put sends a PUT request, suppling the contents of the reader as the request body.

type Conn

type Conn interface {
	client.Client
	io.Closer

	SetDeadline(time.Time) error
	SetReadDeadline(time.Time) error
	SetWriteDeadline(time.Time) error

	// Release returns the Conn to the Dialer for reuse.
	Release()
}

Conn represnts a connection which can be used to communicate with a remote HTTP server.

type Dialer

type Dialer interface {
	// Dial dials a remote http server returning a Conn.
	Dial(network, addr string) (Conn, error)
}

type StatusError

type StatusError struct {
	client.Status
}

StatusError reprents a client.Status as an error.

func (*StatusError) Error

func (s *StatusError) Error() string

Directories

Path Synopsis
*------------------------------------------------------------** * @filename client/client.go * @author jinycoo * @version 1.0.0 * @date 2019-07-23 10:47 * @desc go.jinycoo.com:medusa - client - api client **------------------------------------------------------------* *------------------------------------------------------------** * @filename client/ * @author jinycoo * @version 1.0.0 * @date 2019-06-25 15:42 * @desc go.easytech.co - client - **------------------------------------------------------------*
*------------------------------------------------------------** * @filename client/client.go * @author jinycoo * @version 1.0.0 * @date 2019-07-23 10:47 * @desc go.jinycoo.com:medusa - client - api client **------------------------------------------------------------* *------------------------------------------------------------** * @filename client/ * @author jinycoo * @version 1.0.0 * @date 2019-06-25 15:42 * @desc go.easytech.co - client - **------------------------------------------------------------*
*------------------------------------------------------------** * @filename jiny/client.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:00 * @desc jiny - api client **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/csrf.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 10:11 * @desc jiny - csrf header validate **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/jiny.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 09:41 * @desc jiny - http server **------------------------------------------------------------* *------------------------------------------------------------** * @filename auth/jwt.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 14:15 * @desc auth - jwt token **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/metadata.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:14 * @desc jiny - metadata **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/trace.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:09 * @desc jiny - trace **------------------------------------------------------------*
*------------------------------------------------------------** * @filename jiny/client.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:00 * @desc jiny - api client **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/csrf.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 10:11 * @desc jiny - csrf header validate **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/jiny.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 09:41 * @desc jiny - http server **------------------------------------------------------------* *------------------------------------------------------------** * @filename auth/jwt.go * @author jinycoo * @version 1.0.0 * @date 2019-07-24 14:15 * @desc auth - jwt token **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/metadata.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:14 * @desc jiny - metadata **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/trace.go * @author jinycoo * @version 1.0.0 * @date 2019-09-19 10:09 * @desc jiny - trace **------------------------------------------------------------*
debug
*------------------------------------------------------------** * @filename debug/pprof.go * @author jinycoo * @version 1.0.0 * @date 2019-07-25 13:10 * @desc debug - pprof 性能优化 **------------------------------------------------------------*
*------------------------------------------------------------** * @filename debug/pprof.go * @author jinycoo * @version 1.0.0 * @date 2019-07-25 13:10 * @desc debug - pprof 性能优化 **------------------------------------------------------------*
server
*------------------------------------------------------------** * @filename jiny/context.go * @author jinycoo * @version 1.0.0 * @date 2019-07-25 09:56 * @desc jiny - context **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/params.go * @author jinycoo * @version 1.0.0 * @date 2019-08-01 13:58 * @desc jiny - params **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/jiny.go * @author jinycoo * @version 1.0.0 * @date 2019-07-23 10:47 * @desc jiny - entry framework **------------------------------------------------------------*
*------------------------------------------------------------** * @filename jiny/context.go * @author jinycoo * @version 1.0.0 * @date 2019-07-25 09:56 * @desc jiny - context **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/params.go * @author jinycoo * @version 1.0.0 * @date 2019-08-01 13:58 * @desc jiny - params **------------------------------------------------------------* *------------------------------------------------------------** * @filename jiny/jiny.go * @author jinycoo * @version 1.0.0 * @date 2019-07-23 10:47 * @desc jiny - entry framework **------------------------------------------------------------*
_examples/6_middleware
Package main will explore the helpers for middleware(s) that Muxie has to offer, but they are totally optional, you can still use your favourite pattern to wrap route handlers.
Package main will explore the helpers for middleware(s) that Muxie has to offer, but they are totally optional, you can still use your favourite pattern to wrap route handlers.

Jump to

Keyboard shortcuts

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