httpis

package
v0.0.0-...-9c04300 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-3-Clause Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(req, resp interface{}) error

func Get

func Get(req, resp interface{}) error

func Post

func Post(req, resp interface{}) error

func Put

func Put(req, resp interface{}) error

Types

type Acceptor

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

func NewAcceptor

func NewAcceptor(option *AcceptorOption) (*Acceptor, error)

func (*Acceptor) Run

func (acceptor *Acceptor) Run()

func (*Acceptor) State

func (acceptor *Acceptor) State() network.State

func (*Acceptor) Stop

func (acceptor *Acceptor) Stop()

type AcceptorOption

type AcceptorOption struct {
	Name     string        // 名称
	Addr     string        // 侦听地址
	Nodes    []*Node       // 接口
	Params   []interface{} // 注入参数
	Creators []interface{} // 参数生成器
	Level    logis.Level   // 日志等级
}

type Connector

type Connector struct {
	// contains filtered or unexported fields
}
func Header(header http.Header) *Connector

func NewConnector

func NewConnector(client *http.Client) *Connector

func URL

func URL(url string) *Connector

func (*Connector) Delete

func (connector *Connector) Delete(req, resp interface{}) error

func (*Connector) Do

func (connector *Connector) Do(req, resp interface{}) error

func (*Connector) Get

func (connector *Connector) Get(req, resp interface{}) error

func (*Connector) Header

func (connector *Connector) Header(header http.Header) *Connector

func (*Connector) Method

func (connector *Connector) Method(method string) *Connector

func (*Connector) Post

func (connector *Connector) Post(req, resp interface{}) error

func (*Connector) Put

func (connector *Connector) Put(req, resp interface{}) error

func (*Connector) URL

func (connector *Connector) URL(url string) *Connector

type Invoker

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

func NewInvoker

func NewInvoker(logger logis.Logger) *Invoker

func (*Invoker) Creators

func (invoker *Invoker) Creators(creators ...interface{}) *Invoker

func (*Invoker) Handle

func (invoker *Invoker) Handle(node *Node, handler ioc.Invoker) gin.HandlerFunc

func (*Invoker) Params

func (invoker *Invoker) Params(params ...interface{}) *Invoker

func (*Invoker) Register

func (invoker *Invoker) Register(router gin.IRouter, nodes []*Node) error

func (*Invoker) RegisterEx

func (invoker *Invoker) RegisterEx(router gin.IRouter, node *Node) error

type Node

type Node struct {
	Path    string      // 路径
	Method  string      // 方法
	Handler interface{} // 接口
	Log     bool        // 日志
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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