service_http

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorStructType      = errors.New("error struct type")
	ErrorNeedUpstream    = errors.New("need upstream")
	ErrorInvalidUpstream = errors.New("not upstream")
)
View Source
var DriverName = "service_http"

Functions

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建service_http驱动工厂

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册service_http驱动工厂

Types

type AnonymousConfig

type AnonymousConfig struct {
	Type   string `json:"type"`
	Config string `json:"config"`
}

type Config

type Config struct {
	Name        string `json:"name"`
	Driver      string `json:"driver"`
	Desc        string `json:"desc"`
	Timeout     int64  `json:"timeout"`
	Retry       int    `json:"retry"`
	Scheme      string `json:"scheme"`
	ProxyMethod string `json:"proxy_method"`

	Upstream          eosc.RequireId   `json:"upstream" skill:"github.com/eolinker/apinto/upstream.upstream.IUpstream" require:"false"`
	UpstreamAnonymous *AnonymousConfig `json:"anonymous"`

	PluginConfig map[string]*plugin.Config `json:"plugins"`
	// contains filtered or unexported fields
}

Config service_http驱动配置

type Handlers

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

func NewHandlers

func NewHandlers() *Handlers

func (*Handlers) Del

func (h *Handlers) Del(id string) (*ServiceHandler, bool)

func (*Handlers) List

func (h *Handlers) List() []*ServiceHandler

func (*Handlers) Set

func (h *Handlers) Set(id string, handler *ServiceHandler)

type IHandlers

type IHandlers interface {
	Set(id string, handler *ServiceHandler)
	Del(id string) (*ServiceHandler, bool)
	List() []*ServiceHandler
}

type Service

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

func (*Service) Create

func (s *Service) Create(id string, configs map[string]*plugin.Config) service.IService

func (*Service) Merge

func (s *Service) Merge(config map[string]*plugin.Config) map[string]*plugin.Config

type ServiceHandler

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

func (*ServiceHandler) Destroy

func (s *ServiceHandler) Destroy()

func (*ServiceHandler) DoChain

func (*ServiceHandler) DoFilter

func (s *ServiceHandler) DoFilter(ctx http_service.IHttpContext, next http_service.IChain) (err error)

Jump to

Keyboard shortcuts

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