spoken

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

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

History records messages generated by robot.

func Open

func Open(ctx context.Context, db *sqlitex.Pool) (*History, error)

Open opens an existing history in a DB.

func (*History) Record

func (h *History) Record(ctx context.Context, tag, msg string, trace []string, tm time.Time, cost time.Duration, orig, emote, effect string) error

Record records a message with its trace and metadata.

func (*History) Since

func (h *History) Since(ctx context.Context, tag string, tm time.Time) iter.Seq2[string, error]

AllSince provides an iterator over all trace IDs since the given time.

func (*History) Trace

func (h *History) Trace(ctx context.Context, tag, msg string) ([]string, time.Time, error)

Trace obtains the trace and time of the most recent instance of a message. If the message has not been recorded, the results are empty with a nil error.

Jump to

Keyboard shortcuts

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