Versions in this module Expand all Collapse all v0 v0.41.2 Aug 25, 2026 v0.41.1 Aug 24, 2026 v0.41.0 Jul 30, 2026 v0.40.1 Jul 28, 2026 v0.40.0 Jul 27, 2026 v0.39.2 Jul 27, 2026 v0.39.1 Jul 23, 2026 v0.39.0 Jul 22, 2026 v0.38.0 Jul 19, 2026 v0.37.0 Jul 16, 2026 v0.36.0 Jul 14, 2026 Changes in this version + func NormalizeAuthorizedKey(k string) string + func PathEscape(v string) string + func TruncateBody(s string) string + type AccessToken struct + ID int64 + Name string + SHA1 string + type Client struct + BaseURL string + HTTPClient *http.Client + Password string + Username string + func New(baseURL, username, password string) *Client + func (c *Client) CreateAccessToken(ctx context.Context, login, name string, scopes []string) (string, error) + func (c *Client) CreateGiteaWebhook(ctx context.Context, owner, repo, callbackURL, secret string, events []string) (*RepoHook, error) + func (c *Client) CreateUser(ctx context.Context, login, email string) (*User, string, error) + func (c *Client) CreateUserRepo(ctx context.Context, owner, name string, autoInit bool, trustModel string) (*Repository, error) + func (c *Client) DeleteRepo(ctx context.Context, owner, name string) error + func (c *Client) DeleteRepoHook(ctx context.Context, owner, repo string, hookID int64) error + func (c *Client) DeleteUserKeyAsAdmin(ctx context.Context, login string, keyID int64) error + func (c *Client) Do(ctx context.Context, method, path string, in, out any) (int, []byte, error) + func (c *Client) EnsureCollaborator(ctx context.Context, owner, repo, user string) error + func (c *Client) EnsureOrg(ctx context.Context, name, fullName, description string) (*Organization, error) + func (c *Client) EnsureOrgRepo(ctx context.Context, org, name, description string, private, autoInit bool) (*Repository, error) + func (c *Client) EnsureUser(ctx context.Context, login, email string) (*TestUser, error) + func (c *Client) EnsureUserKeyAsAdmin(ctx context.Context, login, title, publicKey string) (*PublicKey, error) + func (c *Client) FindUserKey(ctx context.Context, login, publicKey string) (*PublicKey, bool, error) + func (c *Client) FindUserKeyByTitle(ctx context.Context, login, title string) (*PublicKey, bool, error) + func (c *Client) GetCommitVerification(ctx context.Context, owner, repo, sha string) (*CommitVerification, error) + func (c *Client) GetKeyRaw(ctx context.Context, keyID int64) ([]byte, error) + func (c *Client) GetOrg(ctx context.Context, name string) (*Organization, error) + func (c *Client) GetRepo(ctx context.Context, owner, name string) (*Repository, error) + func (c *Client) GetUser(ctx context.Context, login string) (*User, bool, error) + func (c *Client) GetVerificationToken(ctx context.Context) (string, error) + func (c *Client) ListRepoHooks(ctx context.Context, owner, repo string) ([]RepoHook, error) + func (c *Client) ListUserKeys(ctx context.Context, login string) ([]PublicKey, error) + func (c *Client) RegisterUserKeyAsAdmin(ctx context.Context, login, title, publicKey string) (*PublicKey, error) + func (c *Client) RegisterUserKeyAsUser(ctx context.Context, title, publicKey string) (*PublicKey, error) + func (c *Client) SetUserPassword(ctx context.Context, login, password string) error + func (c *Client) VerifySSHKey(ctx context.Context, user *TestUser, opts SSHKeyVerificationOptions) (*SSHKeyVerificationResult, error) + func (c *Client) WebBaseURL() string + type CommitResponse struct + Commit struct{ ... } + SHA string + type CommitVerification struct + Payload string + Reason string + Signature string + Signer *User + Verified bool + type Organization struct + FullName string + ID int64 + UserName string + type PublicKey struct + CreatedAt string + Fingerprint string + ID int64 + Key string + KeyType string + LastUsedAt string + ReadOnly bool + Title string + type RepoHook struct + Active bool + Config RepoHookConfig + ID int64 + Type string + type RepoHookConfig struct + ContentType string + URL string + type Repository struct + CloneURL string + FullName string + ID int64 + Name string + Owner User + Private bool + SSHURL string + type SSHKeyVerificationOptions struct + Debug bool + Fingerprint string + PrivateKeyPEM []byte + PrivateKeyPath string + PublicKey string + type SSHKeyVerificationResult struct + Session *WebSession + Signature string + Token string + type TestUser struct + Email string + ID int64 + Login string + Password string + type User struct + Email string + ID int64 + Login string + type WebSession struct + BaseURL string + Debug bool + HTTPClient *http.Client + func NewWebSession(ctx context.Context, baseURL, username, password string, debug bool) (*WebSession, error) + func (s *WebSession) VerifySSHKey(ctx context.Context, publicKey, fingerprint, signature string) error