ops

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ops parses intent-level operations. The user expresses WHAT resolved ownership should look like; the planner decides which lines change. Scope is a directory, file path, or glob (§4.1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind identifies an operation.

const (
	AddOwner    Kind = "add_owner"
	SetOwners   Kind = "set_owners"
	RemoveOwner Kind = "remove_owner"
	RenameOwner Kind = "rename_owner"
)

type Op

type Op struct {
	Kind     Kind     `json:"kind"`
	Scope    string   `json:"scope,omitempty"`     // pattern text; empty for rename_owner
	Owner    string   `json:"owner,omitempty"`     // add/remove target; rename old name
	NewOwner string   `json:"new_owner,omitempty"` // rename new name
	Owners   []string `json:"owners,omitempty"`    // set_owners exact set (non-nil, may be empty)
	Raw      string   `json:"raw"`
}

Op is one parsed operation.

func Parse

func Parse(s string) (Op, error)

Parse parses one op of the form kind(arg1, arg2).

func ParseAll

func ParseAll(specs []string) ([]Op, error)

ParseAll parses a batch, preserving order (R-8 conflict detection is the planner's job — parse only rejects individually malformed ops).

func (Op) String

func (o Op) String() string

Jump to

Keyboard shortcuts

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