Documentation ¶
Index ¶
- func EntryArg(c *rt.GoCont, n int) (monitor.Entry, error)
- func ValueToEntry(v rt.Value) (monitor.Entry, bool)
- type Monitor
- func (c *Monitor) Close() error
- func (c *Monitor) GetTimeout() time.Duration
- func (c *Monitor) IsClosed() bool
- func (c *Monitor) IsLogName(ctx context.Context, name string) (bool, error)
- func (c *Monitor) LogNames(ctx context.Context) ([]string, error)
- func (c *Monitor) LogNamesWithMatches(ctx context.Context, cond monitor.NameMatches) ([]string, error)
- func (c *Monitor) SetTimeout(timeout time.Duration)
- func (c *Monitor) Stream(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time) (monitor.Iterator, error)
- func (c *Monitor) StreamWithMatches(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time, ...) (monitor.Iterator, error)
- func (c *Monitor) String() string
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor describes a monitor.Connection.
func MonitorArg ¶
MonitorArg turns a continuation argument into a *Monitor.
func ValueToMonitor ¶
ValueToMonitor turns a lua value to a *Monitor, if possible.
func (*Monitor) GetTimeout ¶
GetTimeout returns the timeout.
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 ¶
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'.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream describes a stream of entries as given by a monitor.Iterator.
func NewStream ¶
NewStream wraps the given monitor.Iterator as a stream. A finaliser is set of the stream to ensure that it is closed.
func ValueToStream ¶
ValueToStream turns a lua value to a *Stream, if possible.
func (*Stream) Advance ¶
Advance advances the stream. If the end of the stream is reached, this will return io.EOF.
func (*Stream) Buffered ¶
Buffered returns true iff the next call to Advance is guaranteed not to block.
func (*Stream) GetTimeout ¶
GetTimeout returns the timeout.
func (*Stream) SetTimeout ¶
SetTimeout sets the timeout. A negative timeout is interpreted to mean no timeout.