provider

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

internal/provider/bitbucket.go

internal/provider/github.go

internal/provider/provider.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitbucket

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

Bitbucket implements Provider for Bitbucket Cloud.

func NewBitbucket

func NewBitbucket(token, username, baseURL string) *Bitbucket

NewBitbucket creates a new Bitbucket provider. If baseURL is empty, the default Bitbucket Cloud API endpoint is used. If username is non-empty, Basic Auth is used instead of Bearer token auth.

func (*Bitbucket) ListProjects added in v0.2.0

func (b *Bitbucket) ListProjects(ctx context.Context, workspace string) ([]Project, error)

ListProjects fetches all projects in a Bitbucket workspace, handling pagination automatically.

func (*Bitbucket) ListRepos

func (b *Bitbucket) ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)

ListRepos fetches all repositories matching the given options from the Bitbucket API, handling pagination automatically.

type GitHub

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

GitHub implements Provider for GitHub.

func NewGitHub

func NewGitHub(token string, baseURL string) *GitHub

NewGitHub creates a new GitHub provider. If baseURL is empty, the default GitHub API endpoint is used.

func (*GitHub) ListRepos

func (g *GitHub) ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)

ListRepos fetches all repositories matching the given options from the GitHub API, handling Link header pagination automatically.

type ListOpts

type ListOpts struct {
	Workspace       string
	Organization    string
	Projects        []string
	Repos           []string
	Exclude         []string
	IncludeArchived bool
	IncludeForks    bool
}

ListOpts configures which repositories to retrieve from a provider.

type Project added in v0.2.0

type Project struct {
	Key  string
	Name string
}

Project represents a Bitbucket project within a workspace.

type Provider

type Provider interface {
	ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)
}

Provider is the interface that both Bitbucket and GitHub implement for listing repositories.

Jump to

Keyboard shortcuts

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