Documentation
¶
Overview ¶
Package workapi is the engine's API for ideas, pursuits and evidence: twenty-two methods (ideas, pursuits, plans, 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 timer and intent kinds added; closeRuns ends every run process the supervisor holds and is called once the engine has returned.
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-two 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, so run.start and run.stop reply an internal error: Engine builds an engine that starts runs.
func PersonOnly ¶
PersonOnly reports whether method is one only a person may call: a pursuit is started and stopped by people (people-pursue).
func StateOptions ¶
StateOptions registers the evidence poll and its retention 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
}
EngineIn is what Engine builds an engine's methods and state options from.