Documentation
¶
Overview ¶
Package workapi is the engine's API for ideas, pursuits and evidence: twenty-four methods (ideas, pursuits, plans, the loop, evidence and runs), typed once, each change one command with its event.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Engine ¶ added in v0.0.55
func Engine(in EngineIn) (build func(get func(ctx context.Context, repo string) (*state.State, error)) []api.Method, opts state.Options, closeRuns func())
Engine builds the engine's methods, its state options and the close of its run supervisor, all sharing one supervisor. build is what the engine calls with its state opener, which the supervisor then reaches each repo's state through; opts is in.State with the supervisor's and the loop's timer and intent kinds added, the loop counting the supervisor's live runs and binding as run.start does; closeRuns ends every run process the supervisor holds and is called once the engine has returned.
func GitHub ¶ added in v0.0.57
GitHub gives the forge of the repo at root: GitHub, the forge the engine runs with in production, for the evidence poll, the gate and the loop.
func Methods ¶
func Methods(env []string, name func(ctx context.Context, dir string) string) func(get func(ctx context.Context, repo string) (*state.State, error)) []api.Method
Methods returns what the engine calls with its state opener to get the twenty-four methods, runs among them. env is the environment git runs in. name names who adds an idea when idea.add leaves the person out: the person running Physa on this machine, named as the CLI names them; "" when no name can be had. It holds no run supervisor and registers no loop, so run.start, run.stop and pursuit.drive reply an internal error: Engine builds an engine that starts runs and drives pursuits.
func PersonOnly ¶
PersonOnly reports whether method is one only a person may call: a pursuit is started and stopped by people (people-pursue), and only a person answers for a change the loop holds for them.
func StateOptions ¶
StateOptions registers the evidence poll and its retention, and the gate that decides whether a run's change is ready with the commit status it sends, in every repo's state, with GitHub as the forge and git run in env, for the engine to run with.
Types ¶
type EngineIn ¶ added in v0.0.55
type EngineIn struct {
// Env is the engine's environment: git's, and the one the bound
// commands' environment is made from.
Env []string
// Name names the person running Physa on this machine, as the CLI names
// them; "" when no name can be had. idea.add and run.stop use it.
Name func(ctx context.Context, dir string) string
// State is the base state options the supervisor's kinds are added to:
// StateOptions(Env) in production, a test's own (or the zero value) in
// tests.
State state.Options
// Grace, ResultTimeout and StopTimeout are the supervisor's durations; 0
// means its defaults.
Grace, ResultTimeout, StopTimeout time.Duration
// Dir is the engine's settings directory, the one it serves: the loop
// reads the machine's slots from its slots file at each look.
Dir string
// Forge gives the forge the loop reads PR states from, for a repo root:
// GitHub in production; nil means no forge.
Forge func(root string) forge.Forge
// DriveEvery and DriveForgeEvery are the loop's tick and forge cadences;
// 0 means its defaults.
DriveEvery, DriveForgeEvery time.Duration
}
EngineIn is what Engine builds an engine's methods and state options from.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package driveapi is the engine's API for the loop: pursuit.drive turns the loop on for one opted-in pursuit, and pursuit.again is a person's answer for a change the loop holds for them.
|
Package driveapi is the engine's API for the loop: pursuit.drive turns the loop on for one opted-in pursuit, and pursuit.again is a person's answer for a change the loop holds for them. |