forgejo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package forgejo talks to the target Forgejo instance: it triggers repository migrations and ensures the destination owner exists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a thin client for the target Forgejo REST API.

func New

func New(baseURL, token string, client *httpx.Client) *Client

New builds a target client. The baseURL is the instance root, e.g. https://codefloe.com.

func (*Client) EnsureOrg

func (c *Client) EnsureOrg(ctx context.Context, name string) error

EnsureOrg makes sure the destination owner exists, creating an organization when it does not already exist as an org or user.

func (*Client) Migrate

func (c *Client) Migrate(ctx context.Context, req MigrateRequest) error

Migrate triggers a repository migration on the target instance.

func (*Client) RepoExists

func (c *Client) RepoExists(ctx context.Context, owner, name string) (bool, error)

RepoExists reports whether owner/name already exists on the target instance.

type MigrateRequest

type MigrateRequest struct {
	CloneAddr   string
	Service     string
	AuthToken   string
	RepoOwner   string
	RepoName    string
	Description string
	Options     Options
}

MigrateRequest describes a single repository migration.

type Options

type Options struct {
	Issues         bool
	PullRequests   bool
	Labels         bool
	Milestones     bool
	Releases       bool
	Wiki           bool
	LFS            bool
	Mirror         bool
	Private        bool
	MirrorInterval string
	LFSEndpoint    string
}

Options are the content toggles the Forgejo migration assistant exposes.

Jump to

Keyboard shortcuts

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