task

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender writes log lines to a task.

func (Sender) Complete

func (s Sender) Complete(status Status)

func (Sender) Write

func (s Sender) Write(line string)

type Status

type Status int
const (
	Running Status = iota
	Completed
	Failed
)

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Store

func (*Store) AppID added in v0.0.2

func (s *Store) AppID(id string) string

AppID returns the app ID associated with a task, or empty string if not found.

func (*Store) Create

func (s *Store) Create(id, appID string) Sender

Create registers a new running task. Returns a Sender for writing log lines.

func (*Store) CreatedAt

func (s *Store) CreatedAt(id string) string

CreatedAt returns the task's creation timestamp as an RFC3339 string. Returns empty string if the task is not found.

func (*Store) Status

func (s *Store) Status(id string) (Status, bool)

Status returns the task's current status. Returns false if not found.

func (*Store) Subscribe

func (s *Store) Subscribe(id string) (snapshot []string, live <-chan string, done <-chan struct{}, ok bool)

Subscribe returns a snapshot of buffered lines and a channel for live lines written after the snapshot. The live channel only delivers new lines — no dedup needed by the caller. The done channel is closed when the task completes.

Jump to

Keyboard shortcuts

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