identity

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 8 Imported by: 0 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 identity resolves which project and run a CLI invocation acts for.

Precedence: --project/--run flags, then OTAG_PROJECT/OTAG_RUN_ID, then the working directory matched against registered project paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Project       *registry.ProjectRow `json:"project"`
	ProjectSource string               `json:"project_source,omitempty"` // flag | env | run | cwd
	RunID         string               `json:"run_id,omitempty"`
	RunSource     string               `json:"run_source,omitempty"` // flag | env
}

Identity is the resolved identity. Project may be nil when nothing matched.

func Resolve

func Resolve(ctx context.Context, q db.Querier, in Input) (Identity, error)

Resolve applies the precedence rules against the synced projects.

func (Identity) RequireProject

func (id Identity) RequireProject() (*registry.ProjectRow, error)

RequireProject returns the project or a NO_PROJECT error.

type Input

type Input struct {
	ProjectFlag string
	RunFlag     string
	EnvProject  string
	EnvRun      string
	Cwd         string
}

Input carries the raw identity hints.

Jump to

Keyboard shortcuts

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