restapi

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(opts *allOpts)

Opt represents a REST Api option.

type RESTAPI

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

RESTAPI contains handlers for REST API

func NewRESTAPI

func NewRESTAPI(node *zkvote.Node, opts ...Opt) (*RESTAPI, error)

NewRESTAPI returns new controller REST API instance.

func (*RESTAPI) GetHandlers

func (c *RESTAPI) GetHandlers() []controller.Handler

GetHandlers returns all controller REST API endpoints

type Server

type Server struct {
	*RESTAPI
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer(node *zkvote.Node, serverAddr string) (*Server, error)

NewServer ...

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the server using the standard Go HTTP server implementation.

Directories

Path Synopsis
model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL