server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RESTServerType = "rest"
	RPCServerType  = "rpc"
)

Server type constants

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTConfig added in v0.2.1

type RESTConfig struct {
	Method  string // "gin", "fiber", etc.
	Options []rest.ServerOptions
}

RESTConfig REST服务器配置

type RPCConfig added in v0.2.1

type RPCConfig struct {
	Method  string // "grpc", etc.
	Options []rpc.ServerOptions
}

RPCConfig RPC服务器配置

type Server added in v0.2.1

type Server interface {
	// Start 启动服务器
	Start(ctx context.Context) error
	// Stop 停止服务器
	Stop(ctx context.Context) error
}

Server 统一的服务器接口

func NewServer added in v0.2.1

func NewServer(serverType string, config any) (Server, error)

NewServer 统一的服务器创建函数

Directories

Path Synopsis
rest-fiber/internal/auth
Basic Auth middleware
Basic Auth middleware
rest-fiber/internal/pprof
this is a copy of https://github.com/gofiber/fiber/blob/main/middleware/pprof/config.go
this is a copy of https://github.com/gofiber/fiber/blob/main/middleware/pprof/config.go
rest-gin/internal/auth
Basic Auth middleware
Basic Auth middleware
rest-gin/internal/pprof
this is a copy of "https://github.com/gin-contrib/pprof/blob/master/pprof.go
this is a copy of "https://github.com/gin-contrib/pprof/blob/master/pprof.go
rpc
auth check by jwt

Jump to

Keyboard shortcuts

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