add unmigrate command

This commit is contained in:
eyedeekay
2025-04-20 22:23:48 -04:00
parent 7d36635472
commit 355093391c
2 changed files with 18 additions and 0 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ go.work.sum
# env file
.env
migrate

View File

@ -29,6 +29,23 @@ type VersionResponse struct {
Version string `json:"version"`
}
// SearchResponse represents the structure of Gitea search responses
type SearchResponse struct {
Data []map[string]interface{} `json:"data"`
OK bool `json:"ok"`
Total int `json:"total_count"`
}
// SearchRepositories searches for repositories and returns the results
func (c *Client) SearchRepositories() ([]map[string]interface{}, error) {
var response SearchResponse
err := c.Get("/repos/search?limit=1000", &response)
if err != nil {
return nil, err
}
return response.Data, nil
}
// FetchCSRFToken retrieves a CSRF token from Gitea
// I don't think it works.
func (c *Client) FetchCSRFToken() (string, error) {