codeberg

package
v0.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRepoNames

func GetRepoNames(repos []Repository) []string

GetRepoNames returns just the repository names

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles Codeberg API operations

func NewClient

func NewClient(org, token string) Client

NewClient creates a new Codeberg API client

func (*Client) CreateRepo

func (c *Client) CreateRepo(repoName, description string, private bool) error

CreateRepo creates a new repository on Codeberg

func (*Client) DeleteRepo

func (c *Client) DeleteRepo(repoName string) error

DeleteRepo deletes a repository from Codeberg

func (*Client) HasToken

func (c *Client) HasToken() bool

HasToken returns true if a token is loaded

func (*Client) ListPublicRepos

func (c *Client) ListPublicRepos() ([]Repository, error)

ListPublicRepos lists all public repositories for an organization

func (*Client) ListUserPublicRepos

func (c *Client) ListUserPublicRepos() ([]Repository, error)

ListUserPublicRepos lists all public repositories for a user

func (*Client) RepoExists

func (c *Client) RepoExists(repoName string) (bool, error)

RepoExists checks if a repository exists on Codeberg

type Repository

type Repository struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	FullName    string    `json:"full_name"`
	Description string    `json:"description"`
	Private     bool      `json:"private"`
	Fork        bool      `json:"fork"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	CloneURL    string    `json:"clone_url"`
	SSHURL      string    `json:"ssh_url"`
	Size        int       `json:"size"`
	Archived    bool      `json:"archived"`
	Empty       bool      `json:"empty"`
}

Repository represents a Codeberg/Gitea repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL