skips

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package skips keeps the workflows the user stopped on one unit: the workflow plans nothing there until the user undoes it, and its drafts held there are withdrawn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drafts

type Drafts interface {
	List(ctx context.Context, f outbox.Filter) ([]draft.Draft, error)
	Withdraw(ctx context.Context, id draft.ID, reason string) (draft.Draft, error)
}

Drafts are the Outbox's drafts a skip withdraws.

type Service

type Service struct {
	Store  Store
	Drafts Drafts
	Clock  port.Clock
	// contains filtered or unexported fields
}

Service skips workflows on units. It reads the store once and keeps the skips in memory after, since it is their only writer.

func (*Service) Of

func (s *Service) Of(ctx context.Context, u unit.Unit) ([]string, error)

Of are the workflows skipped on u, by name.

func (*Service) Skip

func (s *Service) Skip(ctx context.Context, workflow string, u unit.Unit) error

Skip stops workflow on u, then withdraws the workflow's drafts held on u.

func (*Service) Skipped

func (s *Service) Skipped(ctx context.Context, workflow string, u unit.Unit) (bool, error)

Skipped says whether workflow is skipped on u.

func (*Service) Unskip

func (s *Service) Unskip(ctx context.Context, workflow string, u unit.Unit) error

Unskip lets workflow run on u again.

type Store

type Store interface {
	SaveSkip(ctx context.Context, workflow string, u unit.Unit, at time.Time) error
	DeleteSkip(ctx context.Context, workflow string, u unit.Unit) error
	AllSkips(ctx context.Context) (map[unit.Unit][]string, error)
}

Store keeps the skips.

Jump to

Keyboard shortcuts

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