joblogger

package
v0.6.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger is a datastore backed implementation of ffs.Logger.

func New

func New(ds datastore.Datastore) *Logger

New returns a new CidLogger.

func (*Logger) Close

func (cl *Logger) Close() error

Close closes and cancels all watchers that might be active.

func (*Logger) GetByCid

func (cl *Logger) GetByCid(ctx context.Context, c cid.Cid) ([]ffs.LogEntry, error)

GetByCid returns history logs for a Cid.

func (*Logger) Log

func (cl *Logger) Log(ctx context.Context, format string, a ...interface{})

Log logs a log entry for a Cid. The ctx can contain an optional ffs.CtxKeyJid to add additional metadata about the log entry being part of a Job execution.

func (*Logger) Watch

func (cl *Logger) Watch(ctx context.Context, c chan<- ffs.LogEntry) error

Watch is a blocking function that writes to the channel all new created log entries. The client should cancel the ctx to signal stopping writing to the channel and free resources.

Jump to

Keyboard shortcuts

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