rest

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Host string
	Port int
	Mode string
}

Conf Conf

type Option

type Option func()

Option Option

func WithGRpc

func WithGRpc() Option

WithGRpc WithGRpc

func WithMySql

func WithMySql() Option

WithMySql WithMySql

func WithRedis

func WithRedis() Option

WithRedis WithRedis

func WithWS

func WithWS() Option

WithWS WithWS

type Route

type Route struct {
	Method  string
	Path    string
	Handler gin.HandlerFunc
}

Route Route

type Server

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

Server Server

func NewServer

func NewServer(conf Conf) *Server

NewServer 服务

func (*Server) AddRoute

func (e *Server) AddRoute(route Route)

AddRoute 添加路由

func (*Server) AddRouteUse

func (e *Server) AddRouteUse(route Route, next gin.HandlerFunc)

AddRouteUse 添加路由

func (*Server) AddRoutes

func (e *Server) AddRoutes(routes []Route)

AddRoutes 添加路由

func (*Server) AddRoutesUse

func (e *Server) AddRoutesUse(routes []Route, next gin.HandlerFunc)

AddRoutesUse 添加路由

func (*Server) GetEngine

func (e *Server) GetEngine() *gin.Engine

GetEngine 获取路由引擎

func (*Server) Start

func (e *Server) Start()

Start 启动

func (*Server) Stop

func (e *Server) Stop()

Stop 停止服务

func (*Server) Use

func (e *Server) Use(next gin.HandlerFunc)

Use 中间件

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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