installer

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package installer provides a web-based installer for creating GitHub Apps using the GitHub App Manifest flow.

Index

Constants

View Source
const (
	EnvGitHubURL = "GITHUB_URL"
	EnvGitHubOrg = "GITHUB_ORG"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store              configstore.Store
	Manifest           Manifest
	AppDisplayName     string
	GitHubURL          string
	GitHubOrg          string
	RedirectURL        string
	WebhookURL         string
	OnCredentialsSaved CredentialsSavedFunc

	// OnReloadNeeded is called after credentials are saved to trigger
	// a configuration reload. This should be wired to the Runtime's
	// ReloadCallback() or a custom reload function.
	OnReloadNeeded func()
}

Config holds the installer configuration.

func NewConfigFromEnv

func NewConfigFromEnv() Config

NewConfigFromEnv creates a Config from environment variables.

type CredentialsSavedFunc

type CredentialsSavedFunc func(ctx context.Context, creds *configstore.AppCredentials) error

CredentialsSavedFunc is called after credentials are saved.

type Handler

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

Handler handles the GitHub App manifest installation flow.

func New

func New(cfg Config) (*Handler, error)

New creates a new installer Handler with the given configuration.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type HookAttributes

type HookAttributes struct {
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

HookAttributes configures the webhook for the GitHub App.

type Manifest

type Manifest struct {
	Name           string            `json:"name,omitempty"`
	URL            string            `json:"url"`
	HookAttributes HookAttributes    `json:"hook_attributes"`
	RedirectURL    string            `json:"redirect_url"`
	Public         bool              `json:"public"`
	DefaultPerms   map[string]string `json:"default_permissions"`
	DefaultEvents  []string          `json:"default_events"`
}

Manifest represents a GitHub App manifest.

func (*Manifest) Clone

func (m *Manifest) Clone() *Manifest

Clone returns a deep copy of the manifest.

Jump to

Keyboard shortcuts

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