cidlogger

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 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 CidLogger

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

CidLogger is a datastore backed implementation of ffs.CidLogger.

func New

func New(ds datastore.Datastore) *CidLogger

New returns a new CidLogger.

func (*CidLogger) Close

func (cl *CidLogger) Close() error

Close closes and cancels all watchers that might be active.

func (*CidLogger) Get

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

Get returns history logs of a Cid.

func (*CidLogger) Log

func (cl *CidLogger) Log(ctx context.Context, c cid.Cid, 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 (*CidLogger) Watch

func (cl *CidLogger) 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