Documentation ¶
Index ¶
- Constants
- Variables
- func AccountConfigReadHandler(c *gin.Context)
- func CloseDB()
- func CombinedMiddleware(s *discordgo.Session) gin.HandlerFunc
- func GenerateCookie() (string, error)
- func HandleAccountsRequest(c *gin.Context)
- func HandleAppIDRequest(c *gin.Context)
- func HandleCheckLoginStatusRequest(c *gin.Context)
- func HandleLoginRequest(c *gin.Context)
- func HandleProcessStatusRequest(c *gin.Context)
- func InitializeDB()
- func ValidateCookie(cookie string) (bool, error)
- type GuildPager
- type RequestData
- type ResponseData
- type SendMessageRequest
Constants ¶
View Source
const ( DBName = "cookie.db" CookieBucket = "cookies" ExpirationKey = "expiration" ExpirationHours = 24 // Cookie 有效期为24小时 )
Variables ¶
View Source
var ErrCookieExpired = errors.New("cookie has expired")
View Source
var ErrCookieNotFound = errors.New("cookie not found")
Functions ¶
func AccountConfigReadHandler ¶
AccountConfigReadHandler 是用来处理读取配置文件的HTTP请求的
func CombinedMiddleware ¶
func CombinedMiddleware(s *discordgo.Session) gin.HandlerFunc
NewCombinedMiddleware 创建并返回一个带有依赖的中间件闭包
func GenerateCookie ¶
func HandleAccountsRequest ¶
func HandleAppIDRequest ¶
func HandleCheckLoginStatusRequest ¶
HandleCheckLoginStatusRequest 检查登录状态的处理函数
func InitializeDB ¶
func InitializeDB()
func ValidateCookie ¶
Types ¶
type GuildPager ¶
type GuildPager struct { Before string `json:"before"` // 读此id之前的数据 After string `json:"after"` // 读此id之后的数据 Limit string `json:"limit"` // 分页大小,1-100,默认是 100 }
GuildPager 分页器
type RequestData ¶
type RequestData struct {
Password string `json:"password"`
}
type ResponseData ¶
type SendMessageRequest ¶
SendMessageRequest 定义了发送消息请求的数据结构
Click to show internal directories.
Click to hide internal directories.