filesystems

package
v0.0.0-...-c3677c5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// VirtualFilePrefix is the attribute namespace used to state virtual file mappings
	VirtualFilePrefix = "user.titus.virtualFile"
	// VirtualFilePrefixWithSeparator is the VirtualFilePrefix with a "." appended (the namespace separator
	VirtualFilePrefixWithSeparator = VirtualFilePrefix + "."
	// StdioAttr is the attribute that states this is a stdio, rotatable file
	StdioAttr = "user.stdio"
)

Variables

This section is empty.

Functions

func CheckFileForRotation

func CheckFileForRotation(fileName string, regexp *regexp.Regexp) bool

func CheckFileForStdio

func CheckFileForStdio(fileName string) bool

CheckFileForStdio determines whether the file at the path below is one written by tini as a stdio rotator

func FetchStartAndLen

func FetchStartAndLen(xattrKey string, file *os.File) (int64, int64, error)

FetchStartAndLen returns the virtual file start and length for a given xattrKey (a key that includes the prefix)

func GetCurrentOffset

func GetCurrentOffset(file *os.File) (int64, error)

GetCurrentOffset gets the current place where the "active" file is being written from for a given stdio file

func PotentialStdioNames

func PotentialStdioNames(localDir string) []string

PotentialStdioNames takes a base directory and returns all stderr/stout files for the main container as well as any other sidecar container (which has stdout-containername and stderr-containername)

Types

type WatchConfig

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

func NewWatchConfig

func NewWatchConfig(localDir, uploadDir string, uploadRegexp *regexp.Regexp, uploadCheckInterval, uploadThresholdTime, stdioLogCheckInterval time.Duration, keepFileAfterUpload bool) WatchConfig

type Watcher

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

func NewWatcher

func NewWatcher(m metrics.Reporter, c WatchConfig, u *uploader.Uploader) (*Watcher, error)

NewWatcher returns a fully instantiated instance of Watcher, which will run until Stop is called.

func (*Watcher) Stop

func (w *Watcher) Stop(ctx context.Context) error

Stop stops the watcher. It can take an indefinite amount of time. If it is called before starting, it will panic. It can be called multiple times

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context) error

Watch kicks off the watch loop of the Watcher

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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