Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SubModuleName defines the XIBC port name
SubModuleName = "routing"
)
Variables ¶
View Source
var (
ErrInvalidRoute = sdkerrors.Register(moduleName, 2, "route not found")
)
XIBC routing sentinel errors
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
The router is a map from module name to the XIBCModule which contains all the module-defined callbacks
func (*Router) AddRoute ¶
func (rtr *Router) AddRoute(port string, cbs XIBCModule) *Router
AddRoute adds XIBCModule for a given port. It returns the Router so AddRoute calls can be linked. It will panic if the Router is sealed.
func (*Router) GetRoute ¶
func (rtr *Router) GetRoute(port string) (XIBCModule, bool)
GetRoute returns a XIBCModule for a given port.
func (*Router) HasRoute ¶
HasRoute returns true if the Router has a module registered or false otherwise.
type XIBCModule ¶
type XIBCModule interface { // OnRecvPacket must return the acknowledgement bytes // In the case of an asynchronous acknowledgement, nil should be returned. OnRecvPacket(ctx sdk.Context, packetData []byte) (res *sdk.Result, result packettypes.Result, err error) OnAcknowledgementPacket(ctx sdk.Context, packetData []byte, result []byte) (*sdk.Result, error) }
XIBCModule defines an interface that implements all the callbacks
Click to show internal directories.
Click to hide internal directories.