service

package
v0.0.0-...-7ede18c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARAM_TYPE_BODY = iota
	PARAM_TYPE_INT
	PARAM_TYPE_FLOAT64
	PARAM_TYPE_STRING
)
View Source
const (
	PARAM_FROM_QUERY = iota
	PARAM_FROM_BODY
	PARAM_FROM_ALL
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func struct {
	FuncName string
	Params   []Param
	Func     RPCFunc
}

type FuncGroup

type FuncGroup struct {
	GroupName string
	Functions []Func
}

type HTTPServer

type HTTPServer struct {
	Engine *gin.Engine
	Port   int
}

func NewHTTPServer

func NewHTTPServer(port int) *HTTPServer

func (HTTPServer) RegistFunctions

func (server HTTPServer) RegistFunctions(group FuncGroup)

func (HTTPServer) RegistGroups

func (server HTTPServer) RegistGroups(groups []FuncGroup)

func (HTTPServer) Start

func (server HTTPServer) Start() error

func (HTTPServer) Stop

func (server HTTPServer) Stop() error

type Param

type Param struct {
	Name string
	From int
	Type int
}

type RPCFunc

type RPCFunc func(params ...interface{}) interface{}

type Service

type Service interface {
	Start() error
	Stop() error
}

Jump to

Keyboard shortcuts

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