server

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package server implements rest server handling "jump" requests and optionally updating stats service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogRecord added in v1.1.0

type LogRecord struct {
	ID       string    `json:"id,omitempty"`
	FromIP   string    `json:"from_ip"`
	TS       time.Time `json:"ts,omitempty"`
	FileName string    `json:"file_name"`
	Service  string    `json:"service"`
	DestHost string    `json:"dest"`
	Referer  string    `json:"referer"`
}

LogRecord for stats

type Picker added in v1.1.0

type Picker interface {
	Pick(svc string, resource string) (resURL string, node picker.Node, err error)
	Nodes() map[string][]picker.Node
	Status() (bool, []string)
}

Picker defines pick method to return final redirect url from service and resource

type RLBServer

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

RLBServer - main rlb server

func NewRLBServer

func NewRLBServer(nodePicker Picker, emsg, statsURL string, port int, version string) *RLBServer

NewRLBServer makes a new rlb server for map of services

func (*RLBServer) DoJump

func (s *RLBServer) DoJump(w http.ResponseWriter, r *http.Request)

DoJump - jump to alive server for svc, url = Query("url")

func (*RLBServer) Run

func (s *RLBServer) Run()

Run activates alive updater and web server

func (*RLBServer) Shutdown added in v1.1.0

func (s *RLBServer) Shutdown()

Shutdown rlb http server

Jump to

Keyboard shortcuts

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