router

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerInterface

type HandlerInterface interface {
	Handle(request Request) (interface{}, error)
}

type Request

type Request struct {
	Command,
	Token string
	Data interface{}
}

func (*Request) GetAction

func (r *Request) GetAction() string

func (*Request) GetModule

func (r *Request) GetModule() string

type Response

type Response struct {
	Status,
	Error string
	Data interface{}
}

type Router

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

func (*Router) GetHandler

func (r *Router) GetHandler(request Request) HandlerInterface

func (*Router) HandleRequest

func (r *Router) HandleRequest(request Request) (interface{}, error)

func (*Router) RegisterHandler

func (r *Router) RegisterHandler(module string, handler HandlerInterface)

Jump to

Keyboard shortcuts

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