Documentation
¶
Index ¶
- Constants
- func ContainerGenerator(ctx context.Context, config *DockerConfig, client *dockerclient.Client) (iter.Seq[types.ContainerJSON], error)
- func FilteredContainerGenerator(ctx context.Context, config *DockerConfig, client *dockerclient.Client, ...) (iter.Seq[*DockerTarget], error)
- func RunDocker(ctx context.Context, client *dockerclient.Client, config *DockerConfig) error
- func SetColorList(composeColors, containerColors []string) error
- func WatchDockers(ctx context.Context, config *DockerConfig, filter *dockerTargetFilter, ...) (chan *DockerTarget, error)
- type DockerConfig
- type DockerTail
- type DockerTarget
- type FileTail
- type Log
- type ResumeRequest
- type TailOptions
Constants ¶
View Source
const TimestampFormatDefault = "2006-01-02T15:04:05.000000000Z07:00"
RFC3339Nano with trailing zeros
View Source
const TimestampFormatShort = "01-02 15:04:05"
time.DateTime without year
Variables ¶
This section is empty.
Functions ¶
func ContainerGenerator ¶
func ContainerGenerator(ctx context.Context, config *DockerConfig, client *dockerclient.Client) (iter.Seq[types.ContainerJSON], error)
func FilteredContainerGenerator ¶
func FilteredContainerGenerator(ctx context.Context, config *DockerConfig, client *dockerclient.Client, filter *dockerTargetFilter) (iter.Seq[*DockerTarget], error)
func RunDocker ¶
func RunDocker(ctx context.Context, client *dockerclient.Client, config *DockerConfig) error
func SetColorList ¶
func WatchDockers ¶
func WatchDockers(ctx context.Context, config *DockerConfig, filter *dockerTargetFilter, client *dockerclient.Client) (chan *DockerTarget, error)
Types ¶
type DockerConfig ¶
type DockerConfig struct { Timestamps bool TimestampFormat string Location *time.Location Label []string ContainerQuery []*regexp.Regexp ExcludeContainerQuery []*regexp.Regexp ComposeProjectQuery []*regexp.Regexp Exclude []*regexp.Regexp ImageQuery []*regexp.Regexp Include []*regexp.Regexp Highlight []*regexp.Regexp Since time.Duration TailLines int64 Template *template.Template Follow bool OnlyLogLines bool MaxLogRequests int Stdin bool Out io.Writer ErrOut io.Writer }
Config contains the config for tailfin
type DockerTail ¶
type DockerTail struct { ContainerId string ContainerName string ComposeProject string Tty bool Options *TailOptions // contains filtered or unexported fields }
func NewDockerTail ¶
func NewDockerTail( client *dockerclient.Client, containerId string, containerName string, composeProject string, tty bool, tmpl *template.Template, out, errOut io.Writer, options *TailOptions, ) *DockerTail
func (*DockerTail) Close ¶
func (t *DockerTail) Close()
func (*DockerTail) GetResumeRequest ¶ added in v0.1.1
func (t *DockerTail) GetResumeRequest() *ResumeRequest
func (*DockerTail) Print ¶
func (t *DockerTail) Print(msg string)
func (*DockerTail) Resume ¶ added in v0.1.1
func (t *DockerTail) Resume(ctx context.Context, resumeRequest *ResumeRequest) error
type DockerTarget ¶
type FileTail ¶
type FileTail struct { Options *TailOptions // contains filtered or unexported fields }
func NewFileTail ¶
func NewFileTail(tmpl *template.Template, in io.Reader, out, errOut io.Writer, options *TailOptions) *FileTail
NewFileTail returns a new tail of the input reader
func (*FileTail) ConsumeReader ¶
ConsumeReader reads the data from the reader and writes into the out writer.
type Log ¶
type Log struct { // Message is the log message itself Message string `json:"message"` ContainerName string `json:"container"` ComposeProject string `json:"compose"` ComposeColor *color.Color `json:"-"` ContainerColor *color.Color `json:"-"` }
Log is the object which will be used together with the template to generate the output.
type ResumeRequest ¶
type TailOptions ¶
type TailOptions struct { Timestamps bool TimestampFormat string Location *time.Location DockerSinceTime string Exclude []*regexp.Regexp Include []*regexp.Regexp Highlight []*regexp.Regexp DockerTailLines string Follow bool OnlyLogLines bool // contains filtered or unexported fields }
func (TailOptions) HighlightMatchedString ¶
func (o TailOptions) HighlightMatchedString(msg string) string
func (TailOptions) IsExclude ¶
func (o TailOptions) IsExclude(msg string) bool
func (TailOptions) IsInclude ¶
func (o TailOptions) IsInclude(msg string) bool
func (TailOptions) UpdateTimezoneAndFormat ¶
func (o TailOptions) UpdateTimezoneAndFormat(timestamp string) (string, error)
Click to show internal directories.
Click to hide internal directories.