Documentation
¶
Overview ¶
Package webapi provides types and methods for implementing the wasp http and websocket api
Index ¶
- Constants
- Variables
- func AddHealthEndpoint(server echoswagger.ApiRoot, chainService interfaces.ChainService, ...)
- func Init(logger log.Logger, server echoswagger.ApiRoot, waspVersion string, ...)
- type APIGroupModifier
- func (p *APIGroupModifier) Add(method, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) CallOverrideHandler(api echoswagger.Api) echoswagger.Api
- func (p *APIGroupModifier) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) EchoGroup() *echo.Group
- func (p *APIGroupModifier) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
- func (p *APIGroupModifier) SetDescription(desc string) echoswagger.ApiGroup
- func (p *APIGroupModifier) SetExternalDocs(desc, url string) echoswagger.ApiGroup
- func (p *APIGroupModifier) SetSecurity(names ...string) echoswagger.ApiGroup
- func (p *APIGroupModifier) SetSecurityWithScope(s map[string][]string) echoswagger.ApiGroup
- type Mocker
Constants ¶
const APIVersion = 1
Variables ¶
var ConfirmedStateLagThreshold uint32
Functions ¶
func AddHealthEndpoint ¶
func AddHealthEndpoint(server echoswagger.ApiRoot, chainService interfaces.ChainService, metricsService interfaces.MetricsService)
func Init ¶
func Init( logger log.Logger, server echoswagger.ApiRoot, waspVersion string, config *configuration.Configuration, networkProvider peering.NetworkProvider, trustedNetworkManager peering.TrustedNetworkManager, userManager *userspkg.UserManager, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, dkShareRegistryProvider registry.DKShareRegistryProvider, nodeIdentityProvider registry.NodeIdentityProvider, chainsProvider chains.Provider, distKeyGenNodeProvider distkeygen.NodeProvider, shutdownHandler *shutdown.ShutdownHandler, chainMetricsProvider *metrics.ChainMetricsProvider, authConfig authentication.AuthConfiguration, requestCacheTTL time.Duration, websocketService *websocket.Service, indexDBPath string, accountDumpsPath string, pub *publisher.Publisher, l1ParamsFetcher parameters.L1ParamsFetcher, l1Client clients.L1Client, jsonrpcParams *jsonrpc.Parameters, )
Types ¶
type APIGroupModifier ¶
type APIGroupModifier struct {
OverrideHandler func(api echoswagger.Api)
// contains filtered or unexported fields
}
APIGroupModifier is required as it is impossible with echoSwagger to define a group with mixed authentication rules. Most of our routes are protected but very few are not.
While it is possible to create two different groups such as (chainAdm, chainPub), this will pollute the code generation and the documentation itself, as it will create empty groups for controllers that define no public routes, duplicate code files and increase the client lib size even further
Furthermore, it's forbidden to create two groups with the same name to support two different authentication rules. This wrapper adds modifiers to each route that it is assigned to. See: api.go -> loadControllers
func (*APIGroupModifier) Add ¶
func (p *APIGroupModifier) Add(method, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) CallOverrideHandler ¶
func (p *APIGroupModifier) CallOverrideHandler(api echoswagger.Api) echoswagger.Api
func (*APIGroupModifier) DELETE ¶
func (p *APIGroupModifier) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) EchoGroup ¶
func (p *APIGroupModifier) EchoGroup() *echo.Group
func (*APIGroupModifier) GET ¶
func (p *APIGroupModifier) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) HEAD ¶
func (p *APIGroupModifier) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) OPTIONS ¶
func (p *APIGroupModifier) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) PATCH ¶
func (p *APIGroupModifier) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) POST ¶
func (p *APIGroupModifier) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) PUT ¶
func (p *APIGroupModifier) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echoswagger.Api
func (*APIGroupModifier) SetDescription ¶
func (p *APIGroupModifier) SetDescription(desc string) echoswagger.ApiGroup
func (*APIGroupModifier) SetExternalDocs ¶
func (p *APIGroupModifier) SetExternalDocs(desc, url string) echoswagger.ApiGroup
func (*APIGroupModifier) SetSecurity ¶
func (p *APIGroupModifier) SetSecurity(names ...string) echoswagger.ApiGroup
func (*APIGroupModifier) SetSecurityWithScope ¶
func (p *APIGroupModifier) SetSecurityWithScope(s map[string][]string) echoswagger.ApiGroup
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apierrors provides errors for the webapi
|
Package apierrors provides errors for the webapi |
|
Package common implements common VM methods
|
Package common implements common VM methods |
|
controllers
|
|
|
chain
Package chain defines the methods evm chain in the webapi
|
Package chain defines the methods evm chain in the webapi |
|
controllerutils
Package controllerutils provides utility functions for webapi controllers
|
Package controllerutils provides utility functions for webapi controllers |
|
corecontracts
Package corecontracts contains routes for webapi core contract interactions
|
Package corecontracts contains routes for webapi core contract interactions |
|
metrics
Package metrics provides methods for getting chain metrics
|
Package metrics provides methods for getting chain metrics |
|
node
Package node implements webapi node controller
|
Package node implements webapi node controller |
|
requests
Package requests handles off-ledger requests
|
Package requests handles off-ledger requests |
|
users
Package users implements the webapi user methods
|
Package users implements the webapi user methods |
|
Package corecontracts provides methods for the webapi to interact with core contracts
|
Package corecontracts provides methods for the webapi to interact with core contracts |
|
Package dto implements the webapi dto
|
Package dto implements the webapi dto |
|
Package httpserver is an almost 1:1 copy (few removals) from inx-app https://github.com/iotaledger/inx-app/blob/428f260abc503227439635b4a9aea5b12b0317c2/pkg/httpserver/http_server.go To get around the additional dependencies
|
Package httpserver is an almost 1:1 copy (few removals) from inx-app https://github.com/iotaledger/inx-app/blob/428f260abc503227439635b4a9aea5b12b0317c2/pkg/httpserver/http_server.go To get around the additional dependencies |
|
Package interfaces defines interfaces for various webapi systems
|
Package interfaces defines interfaces for various webapi systems |
|
Package models implements VM models for the webapi
|
Package models implements VM models for the webapi |
|
Package params defines parameters for webapi keys
|
Package params defines parameters for webapi keys |
|
Package routes provides the webapi routes
|
Package routes provides the webapi routes |
|
Package services defines the services for the evm backend in the webapi
|
Package services defines the services for the evm backend in the webapi |
|
Package websocket implements the webapi websocket connection
|
Package websocket implements the webapi websocket connection |
|
commands
Package commands defines websocket commands
|
Package commands defines websocket commands |