talu

package module
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MulanPSL-2.0 Imports: 40 Imported by: 0

README

Talu

一个用于 Go 项目的工具库和 Web 框架封装。

功能特性

Web 框架
  • 基于 Gin 的 HTTP 服务器封装
  • 支持 HTTP1.1 长连接(Keep-Alive)
  • 请求超时控制
  • 请求限流保护
  • 请求追踪(X-Request-ID)
  • 会话管理(Session)
加密模块
  • SM2 非对称加密
  • SM3 哈希算法
  • SM4 对称加密
工具函数
  • 配置文件解析
  • 日志记录
  • 时间工具
  • 文件操作
  • Redis 客户端封装
  • 数据库操作(XORM)
  • 消息队列(NATS)

安装

go get gitee.com/your-username/talu

使用示例

创建 Web 服务
import "gitee.com/your-username/talu"

// 使用默认配置
web, err := talu.New(nil)
if err != nil {
    panic(err)
}

// 添加控制器
web.AddController(&MyController{})

// 启动服务
web.RunService("0.0.0.0", "8080")
使用自定义配置
web, err := talu.New(&talu.ServerConfig{
    Debug:         true,
    ReadTimeout:   20,
    WriteTimeout:  20,
    IdleTimeout:   120,
    SessionSecret: "your-secret-key",
    SecureCookie:  true,
})

环境变量

变量名 说明 默认值
TALU_SESSION_SECRET 会话密钥 自动生成
TALU_LOG_LEVEL 日志级别 info

技术栈

  • Go 1.25+
  • Gin 1.10+
  • XORM 0.7+
  • Redis (redigo)
  • NATS
  • 国密算法(GM/T)

目录结构

talu/
├── web.go          # Web 服务器实现
├── controllers.go   # 控制器和中间件
├── db.go           # 数据库操作
├── redis.go        # Redis 客户端
├── mq.go           # 消息队列
├── sm2.go          # SM2 加密
├── sm3.go          # SM3 哈希
├── sm4.go          # SM4 加密
└── ...

许可证

MIT License

Documentation

Index

Constants

View Source
const (
	MinKeyLen = 16
)

Variables

View Source
var (
	MethodHttpGet    = "GET"
	MethodHttpPost   = "POST"
	MethodHttpDelete = "DELETE"
	MethodHttpPut    = "PUT"
)
View Source
var (
	ErrSM4InvalidKeyLength = errors.New("SM4 key must be 16 bytes")
	ErrSM4InvalidBlockSize = errors.New("SM4 ciphertext must be multiple of 16 bytes")
)
View Source
var DefaultUserID = []byte("1234567812345678")

DefaultUserID is the default user ID for SM2 signature, matching gmssl default: "1234567812345678"

View Source
var ErrInvalidCiphertext = errors.New("invalid SM2 ciphertext")
View Source
var (
	Userid = []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}
)

Functions

func AddDuration

func AddDuration(t time.Time, duration time.Duration) int64

func Black

func Black(str string, modifier ...interface{}) string

func Blue

func Blue(str string, modifier ...interface{}) string

func Brown

func Brown(str string, modifier ...interface{}) string

func Close_Timer

func Close_Timer(f func()) chan struct{}

func ConvertMsg

func ConvertMsg(obj interface{}) ([]byte, error)

func ConvertObj

func ConvertObj(msg []byte, obj interface{}) error

func CreateFile

func CreateFile(filename string) error

create file

func Cross

func Cross() gin.HandlerFunc

func CurrentUnixNanoTimestamp

func CurrentUnixNanoTimestamp() int64

func CurrentUnixTimestamp

func CurrentUnixTimestamp() int64

func Cyan

func Cyan(str string, modifier ...interface{}) string

func DarkGray

func DarkGray(str string, modifier ...interface{}) string

func Debug

func Debug(formating string, args ...interface{})

func Deserialization

func Deserialization(byt []byte, ptr interface{}) (err error)

func Error

func Error(formating string, args ...interface{})

func GetCurrentPath

func GetCurrentPath() string

func GetFileToDirectory

func GetFileToDirectory(path string) string

func GetNowUnixSec

func GetNowUnixSec() int64

func Green

func Green(str string, modifier ...interface{}) string

func HMACSM3

func HMACSM3(key, data []byte) []byte

func HMACSM3Equal

func HMACSM3Equal(mac1, mac2 []byte) bool

func IfElse

func IfElse(condition bool, trueVal, falseVal interface{}) interface{}

func Info

func Info(formating string, args ...interface{})

func IsFunctionExists

func IsFunctionExists(class interface{}, name string) bool

func LightBlue

func LightBlue(str string, modifier ...interface{}) string

func LightCyan

func LightCyan(str string, modifier ...interface{}) string

func LightGray

func LightGray(str string, modifier ...interface{}) string

func LightGreen

func LightGreen(str string, modifier ...interface{}) string

func LightPurple

func LightPurple(str string, modifier ...interface{}) string

func LightRed

func LightRed(str string, modifier ...interface{}) string

func LoadCertificateFromBuf

func LoadCertificateFromBuf(buf []byte) (*gmX509.Certificate, error)

func LoadCertificateFromPEM

func LoadCertificateFromPEM(filePath string) (*gmX509.Certificate, error)

func MakeSignature

func MakeSignature(data []byte, privKey *SM2PrivateKey, userID []byte) ([]byte, error)

func NewEngine

func NewEngine(config *EngineConfig) (*gin.Engine, error)

func PathExists

func PathExists(path string) (bool, error)

file or path is exists

func ProcessNotify

func ProcessNotify(addr string)

func Purple

func Purple(str string, modifier ...interface{}) string

func ReadAll

func ReadAll(path string) (data string, err error)

read file data

func Red

func Red(str string, modifier ...interface{}) string

func RegRouterHandlerController

func RegRouterHandlerController(http *http.Server, method string, relativePath string, v interface{})

func RequestID

func RequestID() gin.HandlerFunc

func SM2Decrypt

func SM2Decrypt(privKey *SM2PrivateKey, ciphertext []byte) ([]byte, error)

func SM2DecryptC1C2C3

func SM2DecryptC1C2C3(privKey *SM2PrivateKey, ciphertext []byte) ([]byte, error)

func SM2DecryptC1C3C2

func SM2DecryptC1C3C2(privKey *SM2PrivateKey, ciphertext []byte) ([]byte, error)

func SM2Encrypt

func SM2Encrypt(pubKey *SM2PublicKey, plaintext []byte) ([]byte, error)

func SM2EncryptC1C2C3

func SM2EncryptC1C2C3(pubKey *SM2PublicKey, plaintext []byte) ([]byte, error)

func SM2EncryptC1C3C2

func SM2EncryptC1C3C2(pubKey *SM2PublicKey, plaintext []byte) ([]byte, error)

func SM2GenerateKey

func SM2GenerateKey() (*SM2PrivateKey, *SM2PublicKey, error)

func SM2Sign

func SM2Sign(privKey *SM2PrivateKey, data []byte, userID ...[]byte) ([]byte, error)

func SM2Verify

func SM2Verify(pubKey *SM2PublicKey, data, signature []byte, userID ...[]byte) bool

func SM3

func SM3(data []byte) []byte

func SM4CBCDecrypt

func SM4CBCDecrypt(ciphertext []byte, key [MinKeyLen]byte) ([]byte, error)

SM4CBCDecrypt 对数据进行 SM4 CBC 解密(从加密数据中提取IV) 参数:ciphertext - 加密数据(包含IV),key - 16字节密钥 返回值:解密后的数据、错误

func SM4CBCDecryptEx

func SM4CBCDecryptEx(ciphertext []byte, iv [sm4.BlockSize]byte, key [MinKeyLen]byte) ([]byte, error)

SM4CBCDecryptEx 对数据进行 SM4 CBC 解密(外部传入IV) 参数:ciphertext - 加密数据,iv - 初始向量,key - 16字节密钥 返回值:解密后的数据、错误

func SM4CBCEncrypt

func SM4CBCEncrypt(buf []byte, key [MinKeyLen]byte) ([]byte, []byte, error)

SM4CBCEncrypt 对数据进行 SM4 CBC 加密(返回加密数据、填充值和错误) 参数:buf - 待加密数据,key - 16字节密钥 返回值:加密后的数据、填充值、错误

func SM4CBCEncryptEx

func SM4CBCEncryptEx(data []byte, key [MinKeyLen]byte) ([]byte, [sm4.BlockSize]byte, error)

SM4CBCEncryptEx 对数据进行 SM4 CBC 加密(外部合成buf) 参数:data - 待加密数据(包含totalLen/offset/seq等字段),key - 16字节密钥 返回值:加密后的数据、IV数组、错误

func SM4Decrypt

func SM4Decrypt(key, ciphertext []byte) ([]byte, error)

func SM4DecryptIV

func SM4DecryptIV(key, iv, ciphertext []byte) ([]byte, error)

func SM4Encrypt

func SM4Encrypt(key, plaintext []byte) ([]byte, error)

func SM4EncryptIV

func SM4EncryptIV(key, iv, plaintext []byte) ([]byte, error)

func Serialization

func Serialization(value interface{}) ([]byte, error)

func StringToUnixTimestamp

func StringToUnixTimestamp(timeStr string) (int64, error)

func SubtractDuration

func SubtractDuration(t time.Time, duration time.Duration) int64

func ToAddr

func ToAddr(host string, port int) string

func ToAddress

func ToAddress(host string, port string) string

func ToUrlAddr

func ToUrlAddr(host string, port int) string

func UnixNanoTimestamp

func UnixNanoTimestamp(t time.Time) int64

func UnixTimestamp

func UnixTimestamp(t time.Time) int64

func UnixTimestampToString

func UnixTimestampToString(timestamp int64) string

func VerifySignature

func VerifySignature(data []byte, sign [64]byte, publicKey *SM2PublicKey, userID []byte) error

func WalkDir

func WalkDir(dirPth, suffix string) (files []string, err error)

get dir all files

func Warning

func Warning(formating string, args ...interface{})

func White

func White(str string, modifier ...interface{}) string

func WriteFile

func WriteFile(filename string, data string) (err error)

write file

func XZCompress

func XZCompress(data []byte) ([]byte, error)

func XZDecompress

func XZDecompress(data []byte) ([]byte, error)

func Yellow

func Yellow(str string, modifier ...interface{}) string

Types

type Btree

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

func NewBtree

func NewBtree() *Btree

func (*Btree) GetValue

func (p *Btree) GetValue(key interface{}) interface{}

func (*Btree) SetValue

func (p *Btree) SetValue(key interface{})

type Controller

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

func (*Controller) DelSessionKV

func (c *Controller) DelSessionKV(context *gin.Context, key interface{})

func (*Controller) GetBody

func (c *Controller) GetBody(context *gin.Context) ([]byte, error)

func (*Controller) GetSessionKV

func (c *Controller) GetSessionKV(context *gin.Context, key interface{}) interface{}

func (*Controller) SaveBody

func (c *Controller) SaveBody(context *gin.Context) error

func (*Controller) SaveSession

func (c *Controller) SaveSession(context *gin.Context)

func (*Controller) ServiceFinish

func (c *Controller) ServiceFinish(context *gin.Context, status int, res interface{})

func (*Controller) ServiceFinishAsciiJSON

func (c *Controller) ServiceFinishAsciiJSON(context *gin.Context, status int, res interface{})

func (*Controller) ServiceFinishString

func (c *Controller) ServiceFinishString(context *gin.Context, status int, data string)

func (*Controller) SetHttpServer

func (c *Controller) SetHttpServer(web *http.Server)

func (*Controller) SetSessionKV

func (c *Controller) SetSessionKV(context *gin.Context, key interface{}, val interface{})

type ControllerInterface

type ControllerInterface interface {
	GetControllerName() string
	SetHttpServer(srv *http.Server)
	GetControllerHandle(router string, handle Handle)
}

type ControllerTables

type ControllerTables struct {
	List
}

func NewControllerTables

func NewControllerTables() *ControllerTables

func (*ControllerTables) AddController

func (c *ControllerTables) AddController(v interface{})

func (*ControllerTables) AllItem

func (c *ControllerTables) AllItem(f func(value ControllerInterface))

func (*ControllerTables) DelController

func (c *ControllerTables) DelController(v interface{})

type Database

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

func NewORM

func NewORM() (x *Database)

func (*Database) Close

func (db *Database) Close() error

func (*Database) CountWhere

func (db *Database) CountWhere(obj interface{}, where string, args ...interface{}) (int64, error)

func (*Database) CreateTable

func (db *Database) CreateTable(obj interface{}) error

func (*Database) Delete

func (db *Database) Delete(obj interface{}) error

func (*Database) DropTable

func (db *Database) DropTable(obj interface{}) error

func (*Database) Exec

func (db *Database) Exec(query string, args ...interface{}) (sql.Result, error)

func (*Database) Find

func (db *Database) Find(obj interface{}) error

func (*Database) FindAsc

func (db *Database) FindAsc(obj interface{}, orderBy string) error

func (*Database) FindDesc

func (db *Database) FindDesc(obj interface{}, orderBy string) error

func (*Database) FindWhere

func (db *Database) FindWhere(obj interface{}, where string, args ...interface{}) error

func (*Database) FindWhereAsc

func (db *Database) FindWhereAsc(obj interface{}, where string, orderBy string, args ...interface{}) error

func (*Database) FindWhereDesc

func (db *Database) FindWhereDesc(obj interface{}, where string, orderBy string, args ...interface{}) error

func (*Database) Get

func (db *Database) Get(obj interface{}) (bool, error)

func (*Database) GetWhere

func (db *Database) GetWhere(obj interface{}, where string, args ...interface{}) (bool, error)

func (*Database) Insert

func (db *Database) Insert(obj interface{}) error

func (*Database) Open

func (db *Database) Open(st, addr string, out io.Writer) error

func (*Database) Ping

func (db *Database) Ping() error

func (*Database) Select

func (db *Database) Select(obj interface{}, it func(idx int, bean interface{}) error) error

func (*Database) SyncTable

func (db *Database) SyncTable(obj interface{}) error

func (*Database) TableExists

func (db *Database) TableExists(obj interface{}) bool

func (*Database) Transactions

func (db *Database) Transactions(obj interface{}, it func(it interface{}) error) error

func (*Database) Update

func (db *Database) Update(obj interface{}, where interface{}) error

type EngineConfig

type EngineConfig struct {
	Debug         bool
	SessionSecret string
	SecureCookie  bool
	SessionMaxAge int
}

type Handle

type Handle func(schema string, method string, v interface{})

type Job

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

func (*Job) At

func (j *Job) At(hour, min uint) *Job

func (*Job) Days

func (j *Job) Days() *Job

Days unit

func (*Job) Do

func (j *Job) Do(jobFunc interface{}, params ...interface{})

Do ...

func (*Job) Every

func (j *Job) Every(interval uint64) *Job

Every

func (*Job) GetName

func (j *Job) GetName() string

GetName ...

func (*Job) Hours

func (j *Job) Hours() *Job

Hours unit

func (*Job) Minutes

func (j *Job) Minutes() *Job

Minutes unit

func (*Job) Rename

func (j *Job) Rename(name string)

Rename ...

func (Job) Run

func (j Job) Run()

func (*Job) Seconds

func (j *Job) Seconds() *Job

Seconds unit

type List

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

func NewList

func NewList() *List

func (*List) AddNode

func (p *List) AddNode(v interface{})

func (*List) AllList

func (p *List) AllList(f func(value interface{}))

func (*List) DelNode

func (p *List) DelNode(v interface{})

type Logger

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

func NewLog

func NewLog(path string, debug bool) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close()

func (*Logger) Debug

func (l *Logger) Debug(formating string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(formating string, args ...interface{})

func (*Logger) GetIo

func (l *Logger) GetIo() *os.File

func (*Logger) Info

func (l *Logger) Info(formating string, args ...interface{})

func (*Logger) SetMode

func (l *Logger) SetMode(debug bool)

func (*Logger) Warning

func (l *Logger) Warning(formating string, args ...interface{})

type Map

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

func NewMap

func NewMap() *Map

func (*Map) DeleteValue

func (p *Map) DeleteValue(key interface{})

func (*Map) GetValue

func (p *Map) GetValue(key interface{}) (interface{}, error)

func (*Map) IsValue

func (p *Map) IsValue(key interface{}) bool

func (*Map) Rang

func (p *Map) Rang(f func(key, value interface{}) bool)

func (*Map) SetValue

func (p *Map) SetValue(key interface{}, v interface{})

type Queue

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

func NewQueue

func NewQueue() *Queue

func (*Queue) Consume

func (q *Queue) Consume(newSlice *[]interface{})

func (*Queue) Exit

func (q *Queue) Exit()

func (*Queue) IsExit

func (q *Queue) IsExit() bool

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Notify

func (q *Queue) Notify()

func (*Queue) Produce

func (q *Queue) Produce(data interface{})

type RedisContainer

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

func NewRedisChannel

func NewRedisChannel(network string,
	addr string, pwd string, index int, max_con int) (*RedisContainer, error)

func (*RedisContainer) ClearDB

func (c *RedisContainer) ClearDB() error

func (*RedisContainer) Close

func (c *RedisContainer) Close()

func (*RedisContainer) Delete

func (c *RedisContainer) Delete(keys ...interface{}) (bool, error)

func (*RedisContainer) ExistIs

func (c *RedisContainer) ExistIs(name string) (bool, error)

func (*RedisContainer) ExistsHash

func (c *RedisContainer) ExistsHash(name, field string) (bool, error)

func (*RedisContainer) GetConn

func (c *RedisContainer) GetConn() redis.Conn

func (*RedisContainer) GetDBSize

func (c *RedisContainer) GetDBSize() int64

func (*RedisContainer) GetH

func (c *RedisContainer) GetH(name, field string, v interface{}) (err error)

func (*RedisContainer) GetHM

func (c *RedisContainer) GetHM(name string, fields ...string) ([]interface{}, error)

func (*RedisContainer) GetString

func (c *RedisContainer) GetString(name string) (string, error)

func (*RedisContainer) HashLen

func (c *RedisContainer) HashLen(name string) (int, error)

func (*RedisContainer) Hashdel

func (c *RedisContainer) Hashdel(name, key string) (bool, error)

func (*RedisContainer) Push

func (c *RedisContainer) Push(name string, msg []byte) error

func (*RedisContainer) ScardInt64s

func (c *RedisContainer) ScardInt64s(name string) (int64, error)

func (*RedisContainer) SetExpireTime

func (c *RedisContainer) SetExpireTime(name string, newSecondsLifeTime int64) error

func (*RedisContainer) SetH

func (c *RedisContainer) SetH(name string, key string, value interface{}) (err error)

func (*RedisContainer) SetHM

func (c *RedisContainer) SetHM(name string, obj interface{}) (err error)

func (*RedisContainer) SetString

func (c *RedisContainer) SetString(name string, v interface{}) error

func (*RedisContainer) Smembers

func (c *RedisContainer) Smembers(name string, v interface{}) (err error)

func (*RedisContainer) StrKeyLen

func (c *RedisContainer) StrKeyLen(name string) (int, error)

func (*RedisContainer) StringIncr

func (c *RedisContainer) StringIncr(name string) (int, error)

type RefCounter

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

func (*RefCounter) Decrement

func (r *RefCounter) Decrement()

func (*RefCounter) Get

func (r *RefCounter) Get() int

func (*RefCounter) Increment

func (r *RefCounter) Increment()

func (*RefCounter) Set

func (r *RefCounter) Set(value int)

type SM2PrivateKey

type SM2PrivateKey struct {
	D *sm2.PrivateKey
}

func LoadSM2PrivateKeyFromPEM

func LoadSM2PrivateKeyFromPEM(filePath string) (*SM2PrivateKey, error)

type SM2PublicKey

type SM2PublicKey struct {
	Point *sm2.PublicKey
}

func LoadSM2PublicKeyFromCertificate

func LoadSM2PublicKeyFromCertificate(cert *gmX509.Certificate) (*SM2PublicKey, error)

func LoadSM2PubliceyFromBuf

func LoadSM2PubliceyFromBuf(data []byte) (*SM2PublicKey, error)

func LoadSM2PubliceyFromPEM

func LoadSM2PubliceyFromPEM(filePath string) (*SM2PublicKey, error)

type Scheduler

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

func NewSchedule

func NewSchedule() *Scheduler

func (*Scheduler) Entries

func (s *Scheduler) Entries() []*Job

Entries ...

func (*Scheduler) Len

func (s *Scheduler) Len() int

func (*Scheduler) Less

func (s *Scheduler) Less(i, j int) bool

func (*Scheduler) NewJob

func (s *Scheduler) NewJob(Name string) *Job

NewJob

func (*Scheduler) RemoveJob

func (s *Scheduler) RemoveJob(name string) bool

RemoveJob ...

func (*Scheduler) Start

func (s *Scheduler) Start()

Start ...

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop ...

func (*Scheduler) Swap

func (s *Scheduler) Swap(i, j int)

Swap ...

type Semp

type Semp struct {
	Ref RefCounter
	// contains filtered or unexported fields
}

func NewSemp

func NewSemp(ref int) *Semp

func (*Semp) Exit

func (p *Semp) Exit()

func (*Semp) GetRef

func (p *Semp) GetRef() int

func (*Semp) Kill

func (p *Semp) Kill()

func (*Semp) Signal

func (p *Semp) Signal()

func (*Semp) Wait

func (p *Semp) Wait()

type ServerConfig

type ServerConfig struct {
	Debug bool

	// Output 日志输出目标,默认为 os.Stdout
	Output io.Writer

	// ReadTimeout 读取请求超时时间(秒),默认 30 秒
	ReadTimeout int

	// WriteTimeout 写入响应超时时间(秒),默认 30 秒
	WriteTimeout int

	// ReadHeaderTimeout 读取请求头超时时间(秒),默认 10 秒
	ReadHeaderTimeout int

	// IdleTimeout 长连接空闲超时时间(秒),默认 60 秒(HTTP1.1 Keep-Alive)
	IdleTimeout int

	// MaxHeaderBytes 请求头最大字节数,默认 1MB
	MaxHeaderBytes int

	// MaxRequests 最大并发请求数,默认 1000
	MaxRequests int

	// RequestTimeout 请求处理超时时间(秒),默认 30 秒
	RequestTimeout int

	// SessionSecret 会话密钥,用于加密 Session Cookie
	// 如果为空,会自动生成随机密钥(不推荐生产环境使用)
	SessionSecret string

	// SecureCookie 是否启用 Secure Cookie(仅 HTTPS)
	SecureCookie bool

	// SessionMaxAge Session 过期时间(秒),默认 1800 秒(30 分钟)
	SessionMaxAge int
}

ServerConfig 定义 HTTP 服务器配置

type Timer

type Timer struct {
	Tsec time.Duration
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer() *Timer

func (*Timer) CreateTickController

func (this *Timer) CreateTickController(tmsec time.Duration)

func (*Timer) CreateTimeController

func (this *Timer) CreateTimeController(tmsec time.Duration)

func (*Timer) DelTickController

func (this *Timer) DelTickController() bool

func (*Timer) DelTimeController

func (this *Timer) DelTimeController() bool

func (*Timer) UpdateTimeController

func (this *Timer) UpdateTimeController(tmsec time.Duration) bool

func (*Timer) WaitTimerClose

func (this *Timer) WaitTimerClose()

type Web

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

func NewWebEngine

func NewWebEngine(config *ServerConfig) (*Web, error)

func (*Web) AddController

func (web *Web) AddController(v interface{})

func (*Web) GetConfig

func (web *Web) GetConfig() *ServerConfig

func (*Web) GetGinEngine

func (web *Web) GetGinEngine() *gin.Engine

func (*Web) GetHandler added in v1.0.10

func (web *Web) GetHandler() *http.Server

func (*Web) HttpClose

func (web *Web) HttpClose() error

func (*Web) RegisterController

func (web *Web) RegisterController()

func (*Web) RunService

func (web *Web) RunService(ip string, port string) error

func (*Web) RunServiceTLS

func (web *Web) RunServiceTLS(ip string, port string, cert, key string) error

func (*Web) Shutdown

func (web *Web) Shutdown(timeout time.Duration) error

Jump to

Keyboard shortcuts

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