server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0, MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// HandlerAckDone is set when handler has been acknowledged of snapshotter termination.
	HandlerAckDone uint32 = 0
	// HandlerAckWaiting is set when handler starts waiting of snapshotter termination.
	HandlerAckWaiting uint32 = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	Initializer initializer.Initializer
	Snapshotter *snapshotter.Snapshotter
	Port        int

	Logger *logrus.Logger

	AckState uint32

	StopCh          chan struct{}
	EnableProfiling bool
	ReqCh           chan struct{}
	AckCh           chan struct{}
	// contains filtered or unexported fields
}

HTTPHandler is implementation to handle HTTP API exposed by server

func (*HTTPHandler) GetStatus added in v0.7.0

func (h *HTTPHandler) GetStatus() int

GetStatus returns the current status in the HTTPHandler

func (*HTTPHandler) RegisterHandler

func (h *HTTPHandler) RegisterHandler()

RegisterHandler registers the handler for different requests

func (*HTTPHandler) SetStatus added in v0.7.0

func (h *HTTPHandler) SetStatus(status int)

SetStatus sets the current status in the HTTPHandler

func (*HTTPHandler) Start

func (h *HTTPHandler) Start()

Start starts the http server to listen for request

func (*HTTPHandler) Stop

func (h *HTTPHandler) Stop() error

Stop stops the http server

type HandlerAckState

type HandlerAckState int32

HandlerAckState denotes the state the handler would be in after sending a stop request to the snapshotter.

type HandlerRequest

type HandlerRequest int

HandlerRequest represents the type of request handler makes to the snapshotter.

const (
	// HandlerSsrAbort is the HandlerRequest to the snapshotter to terminate the snapshot process.
	HandlerSsrAbort HandlerRequest = 0
)

Jump to

Keyboard shortcuts

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