Documentation ¶
Index ¶
- Constants
- func NewDir(action structs.Action, client *api.Client, query *api.QueryOptions) *dir
- func NewFile(action structs.Action, client *api.Client) *file
- func NewHealth(action structs.Action, nomad *nomad.Client, consul *consul.Client, ...) *health
- func NewInfo(action structs.Action, client *api.Client, query *api.QueryOptions) *info
- func NewList(action structs.Action, shallow bool, client *api.Client, ...) *list
- func NewStats(action structs.Action, client *api.Client, query *api.QueryOptions) *stats
- type LineLimitReader
Constants ¶
const ( WatchFile = "NOMAD_WATCH_FILE" UnwatchFile = "NOMAD_UNWATCH_FILE" )
const ( UnwatchHealth = "NOMAD_UNWATCH_ALLOCATION_HEALTH" WatchHealth = "NOMAD_WATCH_ALLOCATION_HEALTH" )
const ( WatchInfo = "NOMAD_WATCH_ALLOC" UnwatchInfo = "NOMAD_UNWATCH_ALLOC" )
const ( UnwatchList = "NOMAD_UNWATCH_ALLOCS" UnwatchListShallow = "NOMAD_UNWATCH_ALLOCS_SHALLOW" WatchList = "NOMAD_WATCH_ALLOCS" WatchListShallow = "NOMAD_WATCH_ALLOCS_SHALLOW" )
const ( WatchStats = "NOMAD_WATCH_ALLOC_STATS" UnwatchStats = "NOMAD_UNWATCH_ALLOC_STATS" )
const (
FetchDir = "NOMAD_FETCH_DIR"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LineLimitReader ¶
type LineLimitReader struct { io.ReadCloser // contains filtered or unexported fields }
LineLimitReader wraps another reader and provides `tail -n` like behavior. LineLimitReader buffers up to the searchLimit and returns `-n` number of lines. After those lines have been returned, LineLimitReader streams the underlying ReadCloser
func NewLineLimitReader ¶
func NewLineLimitReader(r io.ReadCloser, lines, searchLimit int, timeLimit time.Duration) *LineLimitReader
NewLineLimitReader takes the ReadCloser to wrap, the number of lines to find searching backwards in the first searchLimit bytes. timeLimit can optionally be specified by passing a non-zero duration. When set, the search for the last n lines is aborted if no data has been read in the duration. This can be used to flush what is had if no extra data is being received. When used, the underlying reader must not block forever and must periodically unblock even when no data has been read.