consolesink

package
v0.0.339 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FPS = 60
)
View Source
const StampMilliTZ = "Jan _2 15:04:05.000 MST"

Variables

View Source
var (
	OutputActionID        = false
	DisplayWaitingActions = false
	DebugConsoleOutput    = false
	DebugOutputDecisions  = false
)
View Source
var (
	// These assume a black background.
	ColorSticky   = aec.NewRGB8Bit(0x00, 0x2b, 0xac)
	ColorFade     = aec.LightBlackF
	ColorToolName = aec.Color8BitF(aec.NewRGB8Bit(0x30, 0x30, 0x30))
	ColorToolId   = aec.Color8BitF(aec.NewRGB8Bit(0x30, 0x30, 0x30))

	ColorsToolBar = []aec.RGB8Bit{

		aec.NewRGB8Bit(0x56, 0x00, 0xac),
		aec.NewRGB8Bit(0x56, 0x00, 0xd7),
		aec.NewRGB8Bit(0x56, 0x2b, 0xd7),
		aec.NewRGB8Bit(0x56, 0x56, 0xd7),
		aec.NewRGB8Bit(0x56, 0x81, 0xd7),
		aec.NewRGB8Bit(0x56, 0xac, 0xd7),
		aec.NewRGB8Bit(0x56, 0xd7, 0xd7),
	}

	StickyRequired = map[string]bool{
		"webui":    true,
		"commands": true,
	}

	StickyPriorities = map[string]int{
		"stack":    1,
		"webui":    10,
		"commands": 99,
	}

	DefaultStickyPriority = 50
)

Functions

func LogAction

func LogAction(w io.Writer, s colors.Style, ev tasks.EventData)

func SetupFlags

func SetupFlags(flags *pflag.FlagSet)

Types

type Atom added in v0.0.221

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

type ConsoleSink

type ConsoleSink struct {
	ConsoleSinkOpts
	// contains filtered or unexported fields
}

func NewSink

func NewSink(out *os.File, opts ConsoleSinkOpts) *ConsoleSink

func (*ConsoleSink) AllocateConsoleId

func (c *ConsoleSink) AllocateConsoleId() uint64

func (*ConsoleSink) AttachmentsUpdated

func (c *ConsoleSink) AttachmentsUpdated(actionID tasks.ActionID, data *tasks.ResultData)

func (*ConsoleSink) Done

func (c *ConsoleSink) Done(ra *tasks.RunningAction)

func (*ConsoleSink) EnterInputMode

func (c *ConsoleSink) EnterInputMode(ctx context.Context, prompt ...string) func()

Stops rendering actions. But only does so when an idle state is entered, and blocks until that point.

func (*ConsoleSink) Instant

func (c *ConsoleSink) Instant(ev *tasks.EventData)

func (*ConsoleSink) Output

func (c *ConsoleSink) Output(name, contentType string, outputType idtypes.CatOutputType) io.Writer

func (*ConsoleSink) RecentInputSourcesContain

func (c *ConsoleSink) RecentInputSourcesContain(actionId tasks.ActionID) bool

func (*ConsoleSink) SetStickyContent

func (c *ConsoleSink) SetStickyContent(name string, content []byte)

func (*ConsoleSink) Start

func (c *ConsoleSink) Start() func()

func (*ConsoleSink) Started

func (c *ConsoleSink) Started(ra *tasks.RunningAction)

func (*ConsoleSink) Waiting

func (c *ConsoleSink) Waiting(ra *tasks.RunningAction)

func (*ConsoleSink) WriteLines

func (c *ConsoleSink) WriteLines(id idtypes.IdAndHash, name string, cat idtypes.CatOutputType, actionID tasks.ActionID, _ time.Time, lines [][]byte)

type ConsoleSinkOpts added in v0.0.221

type ConsoleSinkOpts struct {
	Interactive   bool // If set to false, only emit buffer output and logged actions.
	InhibitReport bool
	MaxLevel      int // Only display actions at this level or below (all actions are still computed).

	Renderer RendererFunc
}

type Renderable added in v0.0.221

type Renderable struct {
	Data       tasks.EventData      // The original event data.
	Scope      []string             // List of packages this line item pertains to.
	Serialized []Atom               // Pre-rendered arguments.
	Cached     bool                 // Whether this item represents a cache hit.
	Progress   tasks.ActionProgress // This is not great, as we're using memory sharing here, but keeping it simple.
}

type RendererFunc added in v0.0.221

type RendererFunc func(io.Writer, colors.Style, time.Time, Renderable) string

Jump to

Keyboard shortcuts

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