context

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 6 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 context provides request-scoped state helpers used throughout the align client.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrReposNotFoundInContext is returned by RepoMap when no repository map has been stored in the context.
	ErrReposNotFoundInContext = errors.New("repos map not found in context")
)

Functions

func Concurrency added in v0.0.6

func Concurrency(ctx context.Context, fallback int) (int, error)

Concurrency returns the override or fallback, rejecting nonpositive limits.

func IgnoredRepos added in v0.0.6

func IgnoredRepos(ctx context.Context) []string

IgnoredRepos returns the local directory exclusions, or nil when unset.

func RemoveExcludes

func RemoveExcludes(ctx context.Context, repoMap map[string][]*Repository) (map[string][]*Repository, error)

RemoveExcludes returns a copy of repoMap with excluded repositories removed.

func RepoMap

func RepoMap(ctx context.Context) (map[string][]*Repository, error)

RepoMap retrieves the directory→repository map from ctx.

func Verbose

func Verbose(ctx context.Context) bool

Verbose retrieves the verbose flag from ctx, returning false if unset.

func WithConcurrency added in v0.0.6

func WithConcurrency(ctx context.Context, limit int) context.Context

WithConcurrency stores an invocation-scoped limit for operations that support it.

func WithExcludes

func WithExcludes(ctx context.Context, repos []*Repository) context.Context

WithExcludes stores the repository exclusion list in ctx.

func WithIgnoredRepos added in v0.0.6

func WithIgnoredRepos(ctx context.Context, names []string) context.Context

WithIgnoredRepos stores exact local directory names to exclude from discovery.

func WithRepos

func WithRepos(ctx context.Context, repos []*github.Repository) context.Context

WithRepos stores the given GitHub repositories as a dir→[]Repository map in ctx.

func WithVerbose

func WithVerbose(ctx context.Context, verbose bool) context.Context

WithVerbose returns a copy of ctx with the verbose flag set.

Types

type Repository

type Repository struct {
	Name string
	URL  string
}

Repository holds the name and SSH URL of a repository to clone.

func Excludes

func Excludes(ctx context.Context) ([]*Repository, error)

Excludes retrieves the exclusion list from ctx, returning nil if unset.

Jump to

Keyboard shortcuts

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