server

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TARGETAPPID = "hedlzgp1u48kjf50xtcvwdklminbqe9a"

Variables

This section is empty.

Functions

func SendRequest

func SendRequest(requestUrl *url.URL, r *http.Request, RequestParams map[string]string) ([]byte, *http.Response, error)

Types

type ClasterJob

type ClasterJob interface {
	Do()
}

type ClasterTask

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

func NewClasterTask

func NewClasterTask(url *url.URL, r *http.Request, requestParams map[string]string) *ClasterTask

func (*ClasterTask) Do

func (ct *ClasterTask) Do()

type ClasterTaskPool

type ClasterTaskPool struct {
	JobQueue    chan ClasterJob
	WorkerQueue chan chan ClasterJob
	// contains filtered or unexported fields
}

func NewClasterTaskPool

func NewClasterTaskPool(workerlen int) *ClasterTaskPool

func (*ClasterTaskPool) Run

func (ctp *ClasterTaskPool) Run()

type ConcretProxy

type ConcretProxy struct {
	ProxyType       types.ProxyType
	ResponseChannel chan []byte
}

func NewConcretProxy

func NewConcretProxy(pt types.ProxyType) *ConcretProxy

func (*ConcretProxy) Handle

func (cp *ConcretProxy) Handle(r *http.Request, backends []types.Instance, RequestParams map[string]string) []byte

func (*ConcretProxy) Response

func (cp *ConcretProxy) Response() *chan []byte

type DeployProxy

type DeployProxy struct {
	ProxyType       types.ProxyType
	ResponseChannel chan []byte
}

func NewDeployProxy

func NewDeployProxy(pt types.ProxyType) *DeployProxy

func (*DeployProxy) ErrorRes

func (dp *DeployProxy) ErrorRes(err error) []byte

func (*DeployProxy) Handle

func (dp *DeployProxy) Handle(r *http.Request, backends []types.Instance, RequestParams map[string]string) []byte

func (*DeployProxy) Response

func (dp *DeployProxy) Response() *chan []byte

type ErrProxy

type ErrProxy struct {
}

func NewErrProxy

func NewErrProxy(pt types.ProxyType) *ErrProxy

func (*ErrProxy) Handle

func (ep *ErrProxy) Handle(r *http.Request, backends []types.Instance, reqBody []byte) []byte

func (*ErrProxy) Response

func (ep *ErrProxy) Response() *chan []byte

type FilterProxy

type FilterProxy struct {
	ProxyType       types.ProxyType
	ResponseChannel chan []byte
}

func NewFilterProxy

func NewFilterProxy(pt types.ProxyType) *FilterProxy

func (*FilterProxy) Handle

func (fp *FilterProxy) Handle(r *http.Request, backEnds []types.Instance, RequestParams map[string]string) []byte

func (*FilterProxy) Response

func (fp *FilterProxy) Response() *chan []byte

type LBProxy

type LBProxy struct {
	Policy          types.LBPolicy
	ProxyType       types.ProxyType
	ResponseChannel chan []byte
}

func NewLBProxy

func NewLBProxy(pt types.ProxyType) *LBProxy

func (*LBProxy) Handle

func (lbp *LBProxy) Handle(r *http.Request, backends []types.Instance, RequestParams map[string]string) []byte

func (*LBProxy) Response

func (lbp *LBProxy) Response() *chan []byte

type Response

type Response struct {
	Ret     interface{} `json:"ret"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func HandleResponse

func HandleResponse(b []byte) Response

type Worker

type Worker struct {
	JobQueue    chan ClasterJob
	StopChannel chan int
}

func NewWorker

func NewWorker() Worker

func (Worker) Run

func (w Worker) Run(ctp chan chan ClasterJob)

Jump to

Keyboard shortcuts

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