forge

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package forge abstracts the "publish a release" operation against a code hosting provider. The default implementation (GitHubReleaser) targets the GitHub REST API; the interface keeps the runner provider-agnostic.

Index

Constants

This section is empty.

Variables

View Source
var ErrForge = errors.New("forge error")

ErrForge is the sentinel returned (wrapped) when a release-hosting operation fails. Callers should use errors.Is to branch on it.

Functions

This section is empty.

Types

type CreateReleaseOptions

type CreateReleaseOptions struct {
	Owner   string
	Repo    string
	TagName string // e.g. "v1.2.3" or "module/v1.2.3"
	Name    string // human-readable release title
	Body    string // release notes (markdown)
}

CreateReleaseOptions describes a single release publication.

type GitHubReleaser

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

GitHubReleaser publishes releases against the public GitHub API.

func NewGitHubReleaser

func NewGitHubReleaser(token string) *GitHubReleaser

NewGitHubReleaser returns a Releaser configured with the supplied bearer token (typically a GitHub App installation token).

func NewGitHubReleaserFromClient

func NewGitHubReleaserFromClient(client *github.Client) *GitHubReleaser

NewGitHubReleaserFromClient is a test-friendly constructor that accepts a pre-configured *github.Client. Production code should prefer NewGitHubReleaser; tests can swap in a client pointed at httptest.

func (*GitHubReleaser) CreateRelease

func (g *GitHubReleaser) CreateRelease(ctx context.Context, opts CreateReleaseOptions) error

CreateRelease creates a GitHub Release.

type Releaser

type Releaser interface {
	CreateRelease(ctx context.Context, opts CreateReleaseOptions) error
}

Releaser is the abstraction for publishing a release.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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