Documentation ¶
Index ¶
- type JsonAddress
- type JsonAddresses
- type JsonChangeAddr
- type JsonFromAddrs
- type JsonSpendHeader
- type JsonTxID
- type JsonTxIDChangeAddr
- type Server
- func (s *Server) AddAliases(endpoint string, aliases ...string) error
- func (s *Server) AddAliasesWithReadLock(endpoint string, aliases ...string) error
- func (s *Server) AddChainRoute(handler *common.HTTPHandler, ctx *snow.Context, base, endpoint string, ...) error
- func (s *Server) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, ...) error
- func (s *Server) Call(writer http.ResponseWriter, method, base, endpoint string, body io.Reader, ...) error
- func (s *Server) Dispatch() error
- func (s *Server) DispatchTLS(certFile, keyFile string) error
- func (s *Server) Initialize(log logging.Logger, factory logging.Factory, host string, port uint16, ...) error
- func (s *Server) RegisterChain(ctx *snow.Context, vmIntf interface{})
- type SuccessResponse
- type UserPass
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonAddress ¶ added in v0.8.0
type JsonAddress struct {
Address string `json:"address"`
}
JsonAddress contains an address
type JsonAddresses ¶ added in v0.8.0
type JsonAddresses struct {
Addresses []string `json:"addresses"`
}
JsonAddresses contains a list of address
type JsonChangeAddr ¶ added in v0.8.4
type JsonChangeAddr struct {
ChangeAddr string `json:"changeAddr"`
}
ChangeAddr is the address change is sent to, if any
type JsonFromAddrs ¶ added in v0.8.4
type JsonFromAddrs struct {
From []string `json:"from"`
}
JsonFromAddrs is a list of addresses to send funds from
type JsonSpendHeader ¶ added in v0.8.4
type JsonSpendHeader struct { UserPass JsonFromAddrs JsonChangeAddr }
JsonSpendHeader is 3 arguments to a method that spends (including those with tx fees) 1) The username/password 2) The addresses used in the method 3) The address to send change to
type JsonTxIDChangeAddr ¶ added in v0.8.4
type JsonTxIDChangeAddr struct { JsonTxID JsonChangeAddr }
JsonTxIDChangeAddr is a tx ID and change address
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server maintains the HTTP router
func (*Server) AddAliases ¶
AddAliases registers aliases to the server
func (*Server) AddAliasesWithReadLock ¶
AddAliasesWithReadLock registers aliases to the server assuming the http read lock is currently held.
func (*Server) AddChainRoute ¶ added in v0.8.0
func (s *Server) AddChainRoute(handler *common.HTTPHandler, ctx *snow.Context, base, endpoint string, log logging.Logger) error
AddChainRoute registers a route to a chain's handler
func (*Server) AddRoute ¶
func (s *Server) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, log logging.Logger) error
AddRoute registers a route to a handler.
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) DispatchTLS ¶
DispatchTLS starts the API server with the provided TLS certificate
func (*Server) Initialize ¶
func (s *Server) Initialize( log logging.Logger, factory logging.Factory, host string, port uint16, authEnabled bool, authPassword string, ) error
Initialize creates the API server at the provided host and port
func (*Server) RegisterChain ¶
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
type SuccessResponse ¶ added in v0.8.0
type SuccessResponse struct {
Success bool `json:"success"`
}
SuccessResponse indicates success of an API call