Documentation
¶
Overview ¶
Package orca puts Orca's sessions and board behind the core's ports.
Index ¶
- type Adapter
- func (a *Adapter) Agents(ctx context.Context) ([]turns.AgentObservation, error)
- func (a *Adapter) Apply(ctx context.Context, items []view.Item, force map[unit.Unit]bool) ([]view.Applied, error)
- func (a *Adapter) Census(ctx context.Context) (turns.ProcessCensus, error)
- func (a *Adapter) Close(ctx context.Context, handle string) error
- func (a *Adapter) LastAgents() (agents []turns.AgentObservation, ok bool)
- func (a *Adapter) Manages(role view.Role, column string) bool
- func (a *Adapter) Name() string
- func (a *Adapter) Placements(ctx context.Context) (map[unit.Unit]string, error)
- func (a *Adapter) Processes(ctx context.Context, workspaceID string) ([]turns.Process, error)
- func (a *Adapter) Refresh()
- func (a *Adapter) Status(role view.Role, column string) view.Status
- func (a *Adapter) Type(ctx context.Context, handle, line string) (bool, error)
- func (a *Adapter) WaitIdle(ctx context.Context, handle string, timeout time.Duration) (bool, error)
- func (a *Adapter) WatchAgents(ctx context.Context, note func(units []unit.Unit))
- type Columns
- type Link
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func New ¶
func New(m *wsorca.Manager, cfg Columns, links func(context.Context) (map[pr.Ref]Link, error)) *Adapter
New is an adapter whose every read asks m.
func Ports ¶
func Ports(ws workspace.Manager, cols Columns, links func(context.Context) (map[pr.Ref]Link, error)) (*Adapter, error)
Ports puts an Orca workspace manager behind the sessions and board ports. On a *workspace.Cached the adapter reads its cache and invalidates it on each write.
func (*Adapter) Apply ¶
func (a *Adapter) Apply(ctx context.Context, items []view.Item, force map[unit.Unit]bool) ([]view.Applied, error)
Apply writes the review items to the pull request's review workspace and the author items to its own one; an item without that workspace is skipped. A card that already shows what an item would write is not written again. The board is read from the cache, and read again fresh before any write so a card is never overwritten on a stale column.
func (*Adapter) LastAgents ¶
func (a *Adapter) LastAgents() (agents []turns.AgentObservation, ok bool)
LastAgents are the agents of the cache's recent snapshot, without asking Orca; ok is false while the panes the cache holds are missing, too old or from another Orca runtime.
func (*Adapter) Placements ¶
func (*Adapter) Status ¶
Status is the status whose column on the board is column, None when the sink does not write that column for role.
func (*Adapter) WatchAgents ¶
WatchAgents calls note with the units linked to the workspaces whose agents, terminals or card moved, after each load of the cache that moved any, and with nil when the links cannot be read; the links are read under ctx.
type Columns ¶
type Columns struct {
ReviewStatus, ReviewFallbackStatus, NeedsMeStatus, ReviewedStatus string
InProgressStatus, InReviewStatus, ReadyStatus, CompletedStatus string
// AuthorColumns makes the author role own in-review, ready and completed;
// set it with views.Service.Facts.
AuthorColumns bool
}
Columns are the board columns the configuration names.