Documentation ¶
Index ¶
- func GetNoCache(ctx context.Context) bool
- func SetNoCache(ctx context.Context, noCache bool) context.Context
- func TypeStrings() []string
- type CachedReader
- type CompositeReader
- type File
- func (f *File) AddReleaseFunc(fn ReleaseFunc)
- func (f *File) FormatSignature(formattersSig []byte) ([]byte, error)
- func (f *File) NewFormatSignature() ([]byte, error)
- func (f *File) Release(ctx context.Context) error
- func (f *File) Stat() (changed bool, info fs.FileInfo, err error)
- func (f *File) String() string
- type FilesystemReader
- type GitReader
- type Reader
- type ReleaseFunc
- type StdinReader
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNoCache ¶
func TypeStrings ¶
func TypeStrings() []string
TypeStrings returns a slice of all String values of the enum
Types ¶
type CachedReader ¶
type CachedReader struct {
// contains filtered or unexported fields
}
CachedReader reads files from a delegate Reader, appending a cache Entry on read (if on exists) and updating the cache after the file has been processed.
func NewCachedReader ¶
NewCachedReader creates a cache Reader instance, backed by a bolt DB and delegating reads to delegate.
func (*CachedReader) Close ¶
func (c *CachedReader) Close() error
Close waits for any processing to complete.
type CompositeReader ¶
type CompositeReader struct {
// contains filtered or unexported fields
}
CompositeReader combines multiple Readers into one. It iterates over the given readers, reading each until completion.
func (*CompositeReader) Close ¶
func (c *CompositeReader) Close() error
type File ¶
type File struct { Path string RelPath string Info fs.FileInfo // FormattedInfo is the result of os.stat after formatting the file. FormattedInfo fs.FileInfo // FormattersSignature represents the sequence of formatters and their config that was applied to this file. FormattersSignature []byte // CachedFormatSignature is the last FormatSignature generated for this file, retrieved from the cache. CachedFormatSignature []byte // contains filtered or unexported fields }
File represents a file object with its path, relative path, file info, and potential cache entry.
func (*File) AddReleaseFunc ¶
func (f *File) AddReleaseFunc(fn ReleaseFunc)
AddReleaseFunc adds a release function to the File's list of release functions.
func (*File) FormatSignature ¶
FormatSignature takes the file's info from when it was traversed and appends it to formattersSig, generating a unique format signature which encapsulates the sequence of formatters that were applied to this file and the outcome.
func (*File) NewFormatSignature ¶
NewFormatSignature takes the file's info after being formatted and appends it to FormattersSignature, generating a unique format signature which encapsulates the sequence of formatters that were applied to this file and the outcome.
func (*File) Release ¶
Release calls all registered release functions for the File and returns an error if any function fails. Accepts a context which can be used to pass parameters to the release hooks.
type FilesystemReader ¶
type FilesystemReader struct {
// contains filtered or unexported fields
}
FilesystemReader traverses and reads files from a specified root directory and its subdirectories.
func NewFilesystemReader ¶
func NewFilesystemReader( root string, path string, statz *stats.Stats, batchSize int, ) *FilesystemReader
NewFilesystemReader creates a new instance of FilesystemReader to traverse and read files from the specified paths and root.
func (*FilesystemReader) Close ¶
func (f *FilesystemReader) Close() error
Close waits for all filesystem processing to complete.
type GitReader ¶
type GitReader struct {
// contains filtered or unexported fields
}
func NewGitReader ¶
type ReleaseFunc ¶
type StdinReader ¶
type StdinReader struct {
// contains filtered or unexported fields
}
func NewStdinReader ¶
func NewStdinReader(root string, path string, statz *stats.Stats) StdinReader
func (StdinReader) Close ¶
func (s StdinReader) Close() error
type Type ¶
type Type int
func TypeString ¶
TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Type) IsAType ¶
IsAType returns "true" if the value is listed in the enum definition. "false" otherwise
func (Type) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Type
func (*Type) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Type