adminserver

package
v0.0.0-...-7c2dc49 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request(addr string, msgType byte, data []byte) ([]byte, error)

Request sends a request to given addr with given msg type and data.

Types

type AdminServer

type AdminServer interface {
	Start() error

	Stop()
}

AdminServer is an interface for the admin server.

func NewAdminServerImpl

func NewAdminServerImpl(APIPort int, handlers map[byte]func(req []byte) ([]byte, error)) AdminServer

NewAdminServerImpl creates a new admin server.

type AdminServerImpl

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

AdminServerImpl implements AdminServer.

func (*AdminServerImpl) ServeHTTP

func (s *AdminServerImpl) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the api calls. It takes a response writer, the http request as arguments.

func (*AdminServerImpl) Start

func (s *AdminServerImpl) Start() error

Start starts the server.

func (*AdminServerImpl) Stop

func (s *AdminServerImpl) Stop()

Stop shuts down the server.

Jump to

Keyboard shortcuts

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