Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBCache ¶
type DBCache struct { // 存儲後端 Redis Redis // 時間緩存 Modtime Redis // 禁用緩存列表 Direct []string // 表獨立緩存 Special []struct { // 表名 Name string // 存儲後端 Redis Redis } }
數據庫緩存
type HTTP ¶
type HTTP struct { // 服務器監聽地址 Addr string // tls 證書,如果爲空字符串則使用 http CertFile string KeyFile string // 爲 api 提供 Swagger 服務 /serve/swagger/ Swagger bool // 爲 靜態檔案提供 服務 /serve/assets/ Assets bool // 爲 項目提供在線 說明 /serve/document/ Document bool // 提供在線的 protobuf 定義 /serve/protobuf/ Protobuf bool // 服務器一些細節定義 Option ServerOption }
http 服務定義
type Logger ¶
type Logger struct { // 日誌存儲路徑 Filename string // 單個檔案最大尺寸 MB MaxSize int // 最多保存多少個檔案 MaxBackups int // 最多保存多少天日誌 MaxDays int // 日誌寫入緩存大小 BufferSize int // 如果爲 true 在日誌中輸出代碼所在行 Caller bool // 輸出到檔案的日誌等級 [debug info warn error dpanic panic fatal] FileLevel string // 輸出到控制檯的日誌等級 [debug info warn error dpanic panic fatal] ConsoleLevel string }
日誌定義
type ServerOption ¶
type Session ¶
type Session struct { // 會話數據存儲路徑 Path string // redis 寫入地址,如果設置則使用 redis 爲會話提供緩存 Write string // redis 讀取地址,可以使用 redis 讀寫分離 // 如果爲空字符串,則使用 Write 設定的值 Read string // 訪問 token 有效時間 Access time.Duration // 刷新 token 有效時間 Refresh time.Duration // session 最長維持多久 Deadline time.Duration // 支持的平臺,每個平臺同一時刻只允許相同用戶存在一個會話,但不同平臺可以存在同一用戶的多個會話 Platform []string // session 簽名算法 HMD5 HS1 HS256 HS384 HS512 Alg string // 簽名密鑰 Key string }
定義會話
Click to show internal directories.
Click to hide internal directories.