monitoringlib

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: CC0-1.0, CC0-1.0, CC0-1.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryArg

func EntryArg(c *rt.GoCont, n int) (monitor.Entry, error)

EntryArg turns a continuation argument into a monitor.Entry.

func ValueToEntry

func ValueToEntry(v rt.Value) (monitor.Entry, bool)

ValueToEntry turns a lua value to a monitor.Entry, if possible.

Types

type Monitor

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

Monitor describes a monitor.Connection.

func MonitorArg

func MonitorArg(c *rt.GoCont, n int) (*Monitor, error)

MonitorArg turns a continuation argument into a *Monitor.

func ValueToMonitor

func ValueToMonitor(v rt.Value) (*Monitor, bool)

ValueToMonitor turns a lua value to a *Monitor, if possible.

func (*Monitor) Close

func (c *Monitor) Close() error

Close prevents any further queries through this connection.

func (*Monitor) GetTimeout

func (c *Monitor) GetTimeout() time.Duration

GetTimeout returns the timeout.

func (*Monitor) IsClosed

func (c *Monitor) IsClosed() bool

IsClosed returns true iff the connection is closed.

func (*Monitor) IsLogName

func (c *Monitor) IsLogName(ctx context.Context, name string) (bool, error)

IsLogName returns true iff the given string is a log name.

func (*Monitor) LogNames

func (c *Monitor) LogNames(ctx context.Context) ([]string, error)

LogNames returns the log names.

func (*Monitor) LogNamesWithMatches

func (c *Monitor) LogNamesWithMatches(ctx context.Context, cond monitor.NameMatches) ([]string, error)

LogNamesWithMatches is the same as LogNames, with the exception that log names are filtered against the conditions 'cond'.

func (*Monitor) SetTimeout

func (c *Monitor) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout. A negative timeout is interpreted to mean no timeout.

func (*Monitor) Stream

func (c *Monitor) Stream(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time) (monitor.Iterator, error)

Stream returns an iterator down which entries from the log 'name' are passed. Only entries falling into the range determined by start and finish will be returned. If start is unassigned then the start of the log will be used; if end is unassigned then no end is used. The caller should ensure that the returned Iterator is closed, otherwise a resource leak will result.

func (*Monitor) StreamWithMatches

func (c *Monitor) StreamWithMatches(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time, cond monitor.Matches) (monitor.Iterator, error)

StreamWithMatches is the same as Stream, with the exception that entries are filtered against the conditions 'cond'.

func (*Monitor) String

func (c *Monitor) String() string

String returns a string description of the connection.

type Stream

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

Stream describes a stream of entries as given by a monitor.Iterator.

func NewStream

func NewStream(itr monitor.Iterator) *Stream

NewStream wraps the given monitor.Iterator as a stream. A finaliser is set of the stream to ensure that it is closed.

func StreamArg

func StreamArg(c *rt.GoCont, n int) (*Stream, error)

StreamArg turns a continuation argument into a *Stream.

func ValueToStream

func ValueToStream(v rt.Value) (*Stream, bool)

ValueToStream turns a lua value to a *Stream, if possible.

func (*Stream) Advance

func (s *Stream) Advance(ctx context.Context) (e monitor.Entry, err error)

Advance advances the stream. If the end of the stream is reached, this will return io.EOF.

func (*Stream) Buffered

func (s *Stream) Buffered() bool

Buffered returns true iff the next call to Advance is guaranteed not to block.

func (*Stream) Close

func (s *Stream) Close() error

Close closes the stream.

func (*Stream) GetTimeout

func (s *Stream) GetTimeout() time.Duration

GetTimeout returns the timeout.

func (*Stream) IsClosed

func (s *Stream) IsClosed() bool

IsClosed returns true iff the stream is closed.

func (*Stream) SetTimeout

func (s *Stream) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout. A negative timeout is interpreted to mean no timeout.

func (*Stream) String

func (s *Stream) String() string

String returns a string representation of a stream.

Jump to

Keyboard shortcuts

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