fcrrestserver

package
v0.0.0-...-12ab560 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package fcrrestserver - common methods to create HTTP endpoints and handle HTTP requests across the application.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FCRRESTServer

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

FCRRESTServer represents a REST server handling http requests.

func NewFCRRESTServer

func NewFCRRESTServer(
	listenAddrs []string,
) *FCRRESTServer

NewFCRRESTServer creates an empty FCRRESTServer

Example
s := NewFCRRESTServer([]string{"0"})
fmt.Printf("%T\n", s)
err := s.Start()
fmt.Println(err)
Output:

*fcrrestserver.FCRRESTServer
<nil>

func (*FCRRESTServer) AddHandler

func (s *FCRRESTServer) AddHandler(listenAddr string, msgType int32, handler func(rw rest.ResponseWriter, request *fcrmessages.FCRMessage)) *FCRRESTServer

AddHandler is used to add a handler to the server for a given type.

func (*FCRRESTServer) Start

func (s *FCRRESTServer) Start() error

Start is used to start the server.

Jump to

Keyboard shortcuts

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