adapter

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CheckInterval represents the time interval of running check.
	CheckInterval = time.Second
)

Functions

func NewAPIService

func NewAPIService(srv *server.Server, redirector http.Handler) (*apiserver.Service, error)

NewAPIService uses the PD information to create a new apiserver.Service.

Types

type Manager

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

Manager is used to control dashboard.

func NewManager

func NewManager(srv *server.Server, s *apiserver.Service, redirector *Redirector) *Manager

NewManager creates a new Manager.

func (*Manager) Start

func (m *Manager) Start()

Start monitoring the dynamic config and control the dashboard.

func (*Manager) Stop

func (m *Manager) Stop()

Stop monitoring the dynamic config and control the dashboard.

type Redirector

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

Redirector is used to redirect when the dashboard is started in another PD.

func NewRedirector

func NewRedirector(name string, tlsConfig *tls.Config) *Redirector

NewRedirector creates a new Redirector.

func (*Redirector) GetAddress

func (h *Redirector) GetAddress() string

GetAddress is used to get the address to be redirected.

func (*Redirector) GetProxy

func (h *Redirector) GetProxy() *httputil.ReverseProxy

GetProxy is used to get the reverse proxy arriving at address.

func (*Redirector) ReverseProxy

func (h *Redirector) ReverseProxy(w http.ResponseWriter, r *http.Request)

ReverseProxy forwards the request to address and returns the response to the client.

func (*Redirector) SetAddress

func (h *Redirector) SetAddress(addr string)

SetAddress is used to set a new address to be redirected.

func (*Redirector) TemporaryRedirect

func (h *Redirector) TemporaryRedirect(w http.ResponseWriter, r *http.Request)

TemporaryRedirect sends the status code 307 to the client, and the client redirects itself.

Jump to

Keyboard shortcuts

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