api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server maintains the HTTP router

func (*Server) AddAliases

func (s *Server) AddAliases(endpoint string, aliases ...string) error

AddAliases registers aliases to the server

func (*Server) AddAliasesWithReadLock

func (s *Server) AddAliasesWithReadLock(endpoint string, aliases ...string) error

AddAliasesWithReadLock registers aliases to the server assuming the http read lock is currently held.

func (*Server) AddRoute

func (s *Server) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, log logging.Logger) error

AddRoute registers the appropriate endpoint for the vm given an endpoint

func (*Server) Call

func (s *Server) Call(
	writer http.ResponseWriter,
	method,
	base,
	endpoint string,
	body io.Reader,
	headers map[string]string,
) error

Call ...

func (*Server) Dispatch

func (s *Server) Dispatch() error

Dispatch starts the API server

func (*Server) DispatchTLS

func (s *Server) DispatchTLS(certFile, keyFile string) error

DispatchTLS starts the API server with the provided TLS certificate

func (*Server) Initialize

func (s *Server) Initialize(log logging.Logger, factory logging.Factory, port uint16)

Initialize creates the API server at the provided port

func (*Server) RegisterChain

func (s *Server) RegisterChain(ctx *snow.Context, vmIntf interface{})

RegisterChain registers the API endpoints associated with this chain That is, add <route, handler> pairs to server so that http calls can be made to the vm

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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