server

package
v1.2.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultWSMaxSession = 10
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 Config added in v1.2.14

type Config struct {
	ServerAddress         string
	JSONRPCDump           bool
	JSONRPCIncludeDebug   bool
	JSONRPCRosetta        bool
	JSONRPCDefaultChannel string
	JSONRPCBatchLimit     int
	WSMaxSession          int
}

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(
	config *Config,
	wallet module.Wallet,
	l log.Logger) *Manager

func (*Manager) AdminEchoGroup

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

func (*Manager) BatchLimit added in v1.2.0

func (srv *Manager) BatchLimit() int

func (*Manager) Chain

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

func (*Manager) CheckDebug

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

func (*Manager) CheckRosetta added in v1.2.13

func (srv *Manager) CheckRosetta() 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) Rosetta added in v1.2.13

func (srv *Manager) Rosetta() bool

func (*Manager) SetBatchLimit added in v1.2.0

func (srv *Manager) SetBatchLimit(limitOfBatch int)

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) SetRosetta added in v1.2.13

func (srv *Manager) SetRosetta(enable bool)

func (*Manager) SetWSMaxSession added in v1.2.14

func (srv *Manager) SetWSMaxSession(limit int)

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