fcradminserver

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

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Overview

Package fcradminserver - provides an interface to do admin networking.

Package fcradminserver - provides an interface to do admin networking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

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

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

func WriteError

func WriteError(w http.ResponseWriter, header int, msg string)

Types

type FCRAdminServer

type FCRAdminServer interface {
	// Start starts the server.
	Start() error

	// Shutdown stops the server.
	Shutdown()

	// AddHandler adds a handler to the server, which handles a given message type (POST).
	AddHandler(msgType byte, handler func(data []byte) (byte, []byte, error)) FCRAdminServer
}

FCRAdminServer represents a server handling admin requests.

func NewFCRAdminServerImplV1

func NewFCRAdminServerImplV1(listenAddr string, keyStr string) FCRAdminServer

type FCRAdminServerImplV1

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

FCRAdminServerImplV1 implements the FCRAdminServer

func (*FCRAdminServerImplV1) AddHandler

func (s *FCRAdminServerImplV1) AddHandler(msgType byte, handler func(data []byte) (byte, []byte, error)) FCRAdminServer

func (*FCRAdminServerImplV1) ServeHTTP

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

func (*FCRAdminServerImplV1) Shutdown

func (s *FCRAdminServerImplV1) Shutdown()

func (*FCRAdminServerImplV1) Start

func (s *FCRAdminServerImplV1) Start() error

Jump to

Keyboard shortcuts

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