api

package
v0.0.0-...-abd5428 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUndefinedRouterFactory = errors.New("undefined Router factory")
	ErrUnimplemented          = errors.New("unimplemented Router factory")
)
View Source
var (
	ErrUnregisteredVM = errors.New("no Router is registered for this VM")
)

Functions

func RegisterRouter

func RegisterRouter(name string, factory RouterFactory, ctx interface{})

func WriteErr

func WriteErr(w http.ResponseWriter, code int, msg string)

func WriteJSON

func WriteJSON(w http.ResponseWriter, msg []byte)

func WriteObject

func WriteObject(w http.ResponseWriter, obj interface{})

Types

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RootRequestContext

type RootRequestContext struct{}

type RouterFactory

type RouterFactory func(RouterFactoryParams) error

type RouterFactoryParams

type RouterFactoryParams struct {
	Router        *web.Router
	NetworkID     uint32
	ChainConfig   cfg.ChainConfig
	ServiceConfig cfg.ServiceConfig
}

type Server

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

func NewServer

func NewServer(conf cfg.APIConfig) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Listen

func (s *Server) Listen() error

Jump to

Keyboard shortcuts

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