init: first commit

This commit is contained in:
2025-12-01 19:35:50 +08:00
commit b0aef76685
81 changed files with 2348 additions and 0 deletions

17
api/get_csrf_token.go Normal file
View File

@@ -0,0 +1,17 @@
package api
import "encoding/json"
func GetCsrfToken(c Client) (int32, error) {
data, err := c.Send("get_csrf_token", nil)
if err != nil {
return 0, err
}
var resp struct {
Token int32 `json:"token"`
}
if err := json.Unmarshal(data, &resp); err != nil {
return 0, err
}
return resp.Token, nil
}