routing

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package routing reads which roles and gates run on which event, and which handoffs are allowed (docs/spec/routing.md). It decides nothing by itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoutePrePush

func RoutePrePush(repo string) (steps []string, changed bool, err error)

RoutePrePush has the project's .workline/config.yaml route pre-push to the committer and the documentalist, unless it routes pre-push already: then it is the project's choice, left as it is. It returns the steps pre-push runs afterwards, and whether the file changed. The file is appended to when it has no routing yet, so what a person wrote stays as they wrote it.

Types

type Config

type Config struct {
	Events      map[string][]string `yaml:"events"`
	Handoffs    *[]Edge             `yaml:"handoffs"`
	MaxHandoffs int                 `yaml:"max-handoffs"`
}

Config is the line: steps per event, and the allowed handoffs.

func Load

func Load(repo string) (*Config, error)

Load returns the shipped routing with the project's changes applied.

func (*Config) Allowed

func (c *Config) Allowed(from, to string) bool

Allowed reports whether role from may hand over to role to.

type Edge

type Edge struct {
	From string `yaml:"from"`
	To   string `yaml:"to"`
}

Edge is one handoff a role may ask for.

Jump to

Keyboard shortcuts

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