Help us shape the future of Go! Take the 2026 Go Developer Survey

hookrelay

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package hookrelay runs the existing hook API without initializing the web application.

Index

Constants

View Source
const (
	Protocol = "gitsss-hook/2"
	// DelegateChanged asks the shell dispatcher to execute the original script.
	DelegateChanged = 75
	EnvPrefix       = "GITSSS_HOOK_"
)

Variables

This section is empty.

Functions

func DelegateMatches

func DelegateMatches(mode string, getenv func(string) string) bool

func Dispatch

func Dispatch(ctx context.Context, mode string, args []string, input io.Reader, output, errorOutput io.Writer, getenv func(string) string) int

Dispatch avoids a shell only when both the dispatcher and its sole delegate are managed.

func LocalURL

func LocalURL(raw string) bool

LocalURL limits the credential-bearing relay to the existing local HTTP API.

func PublicEnvironment

func PublicEnvironment(environment []string) []string

func Run

func Run(ctx context.Context, mode string, args []string, input io.Reader, output, errorOutput io.Writer, getenv func(string) string) int

Run receives the same ref batches and environment as the original managed hook.

func RunCustomHook

func RunCustomHook(ctx context.Context, path string, args []string, input io.Reader, output, errorOutput io.Writer) int

RunCustomHook preserves the original hook while removing the relay capability.

Types

type BranchResult

type BranchResult struct {
	Message bool
	Create  bool
	Branch  string
	URL     string
}

type Options

type Options struct {
	OldCommitIDs                    []string
	NewCommitIDs                    []string
	RefFullNames                    []string
	UserID                          int64
	UserName                        string
	GitObjectDirectory              string
	GitAlternativeObjectDirectories string
	GitQuarantinePath               string
	GitPushOptions                  map[string]string
	PullRequestID                   int64
	PushTrigger                     string
	DeployKeyID                     int64
	IsWiki                          bool
	ActionsTaskID                   int64
}

Jump to

Keyboard shortcuts

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