server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UrlAdmin = "/admin"
)

Variables

This section is empty.

Functions

func ChainInjector

func ChainInjector(srv *Manager) echo.MiddlewareFunc

func Chunk

func Chunk() echo.MiddlewareFunc

Chunk()

func HTTPErrorHandler

func HTTPErrorHandler(err error, c echo.Context)

func JsonRpc

func JsonRpc() echo.MiddlewareFunc

JsonRpc()

func NoneMiddlewareFunc

func NoneMiddlewareFunc(next echo.HandlerFunc) echo.HandlerFunc

func Redoc

func Redoc(opts RedocOpts) echo.HandlerFunc

func Unauthorized

func Unauthorized(readOnly bool) echo.MiddlewareFunc

func Upgrader

func Upgrader() *websocket.Upgrader

Types

type BlockNotification

type BlockNotification struct {
	Hash    common.HexBytes       `json:"hash"`
	Height  common.HexInt64       `json:"height"`
	Indexes [][]common.HexInt32   `json:"indexes,omitempty"`
	Events  [][][]common.HexInt32 `json:"events,omitempty"`
}

type BlockRequest

type BlockRequest struct {
	Height       common.HexInt64 `json:"height"`
	EventFilters []*EventFilter  `json:"eventFilters,omitempty"`
	// contains filtered or unexported fields
}

type EventFilter

type EventFilter struct {
	Addr      *common.Address `json:"addr,omitempty"`
	Signature string          `json:"event"`
	Indexed   []*string       `json:"indexed,omitempty"`
	Data      []*string       `json:"data,omitempty"`
	// contains filtered or unexported fields
}

type EventNotification

type EventNotification struct {
	Hash   common.HexBytes   `json:"hash"`
	Height common.HexInt64   `json:"height"`
	Index  common.HexInt32   `json:"index"`
	Events []common.HexInt32 `json:"events"`
	Logs   []module.EventLog `json:"logs,omitempty"`
}

type EventRequest

type EventRequest struct {
	EventFilter
	Height common.HexInt64 `json:"height"`
	Logs   common.HexInt32 `json:"logs,omitempty""`
}

type Manager

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

func NewManager

func NewManager(addr string,
	jsonrpcDump bool,
	jsonrpcIncludeDebug bool,
	jsonrpcDefaultChannel string,
	wallet module.Wallet,
	l log.Logger) *Manager

func (*Manager) AdminEchoGroup

func (srv *Manager) AdminEchoGroup(m ...echo.MiddlewareFunc) *echo.Group

func (*Manager) Chain

func (srv *Manager) Chain(channel string) module.Chain

func (*Manager) CheckDebug

func (srv *Manager) CheckDebug() echo.MiddlewareFunc

func (*Manager) IncludeDebug

func (srv *Manager) IncludeDebug() bool

func (*Manager) MessageDump

func (srv *Manager) MessageDump() bool

func (*Manager) RegisterAPIHandler added in v0.9.6

func (srv *Manager) RegisterAPIHandler(g *echo.Group)

func (*Manager) RegisterMetricsHandler added in v0.9.6

func (srv *Manager) RegisterMetricsHandler(g *echo.Group)

func (*Manager) RemoveChain

func (srv *Manager) RemoveChain(channel string)

func (*Manager) SetChain

func (srv *Manager) SetChain(channel string, chain module.Chain)

func (*Manager) SetDefaultChannel

func (srv *Manager) SetDefaultChannel(jsonrpcDefaultChannel string)

func (*Manager) SetIncludeDebug

func (srv *Manager) SetIncludeDebug(enable bool)

func (*Manager) SetMessageDump

func (srv *Manager) SetMessageDump(enable bool)

func (*Manager) Start

func (srv *Manager) Start() error

func (*Manager) Stop

func (srv *Manager) Stop() error

type RedocOpts

type RedocOpts struct {
	// BasePath for the UI path, defaults to: /
	BasePath string
	// Path combines with BasePath for the full UI path, defaults to: docs
	Path string
	// SpecURL the url to find the spec for
	SpecURL string
	// RedocURL for the js that generates the redoc site, defaults to: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js
	RedocURL string
	// Title for the documentation site, default to: API documentation
	Title string
}

func (*RedocOpts) EnsureDefaults

func (r *RedocOpts) EnsureDefaults()

type WSResponse

type WSResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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