Documentation ¶
Index ¶
- Constants
- Variables
- func AllHandle(w http.ResponseWriter, r *http.Request)
- func EthPubSubHandle(w http.ResponseWriter, r *http.Request)
- func GetAttemptsFromContext(r *http.Request) int
- func GetRetryFromContext(r *http.Request) int
- func ParseURL(r *http.Request) (types.Proxy, error, map[string]string)
- func PubSubHandle(w http.ResponseWriter, r *http.Request)
- func Start()
- type BackendProto
- type ServerPool
- type SpecificJob
- type Worker
Constants ¶
View Source
const ( Attempts int = iota Retry )
View Source
const ( DefaultLogDir = "$HOME/.gateway" AppID = "hedlzgp1u48kjf50xtcvwdklminbqe9a" )
Variables ¶
View Source
var (
ShardPort = &types.ShardPort
)
Functions ¶
func EthPubSubHandle ¶
func EthPubSubHandle(w http.ResponseWriter, r *http.Request)
func GetAttemptsFromContext ¶
GetAttemptsFromContext returns the attempts for request
func GetRetryFromContext ¶
GetAttemptsFromContext returns the attempts for request
func PubSubHandle ¶
func PubSubHandle(w http.ResponseWriter, r *http.Request)
Types ¶
type ServerPool ¶
type ServerPool struct { JobQueue chan types.Job WorkerQueue chan chan types.Job // contains filtered or unexported fields }
func NewServerPool ¶
func NewServerPool(backProto BackendProto, svrsource types.ServerSource, workerlen int) *ServerPool
func (*ServerPool) AddBackend ¶
func (s *ServerPool) AddBackend(backend types.Instance)
AddBackend to the server pool
func (*ServerPool) ConfigServerPool ¶
func (s *ServerPool) ConfigServerPool(tokens []string)
func (*ServerPool) HealthCheck ¶
func (s *ServerPool) HealthCheck()
func (*ServerPool) MarkBackendStatus ¶
func (s *ServerPool) MarkBackendStatus(backendUrl *url.URL, alive bool)
MarkBackendStatus changes a status of a backend
func (*ServerPool) Run ¶
func (s *ServerPool) Run()
func (*ServerPool) SharedCheck ¶
func (s *ServerPool) SharedCheck()
type SpecificJob ¶
type SpecificJob struct { Request *http.Request Proxy types.Proxy BackEnds []types.Instance RequestParams map[string]string ResponseChan *chan []byte }
func NewSpecificJob ¶
func NewSpecificJob(r *http.Request, backends []types.Instance) *SpecificJob
func (*SpecificJob) Do ¶
func (sjob *SpecificJob) Do()
Click to show internal directories.
Click to hide internal directories.