walker

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseWalkerConfig

type BaseWalkerConfig struct {
	Depth              uint              `` /* 135-byte string literal not displayed */
	BinNumber          int               `long:"histogram-bins" required:"true" default:"30" env:"HISTOGRAM_BINS" description:"Number of bins for histograms"`
	BinStart           float64           `long:"histogram-start" required:"true" default:"10_000_000" env:"HISTOGRAM_START" description:"Value of first bin in bytes"`
	BinIncrementFactor float64           `` /* 147-byte string literal not displayed */
	PrefixFilters      []string          `long:"prefix-filter" required:"false" env:"PREFIX_FILTER" description:"Prefixes or part of prefix to be ignored"`
	CustomLabels       map[string]string `long:"custom-labels" env:"CUSTOM_LABELS" description:"Labels to add for prometheus exporters"`
}

type Config

type Config struct {
	*BaseWalkerConfig
	*S3WalkerConfig
	*FsWalkerConfig
}

type FsWalker

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

func (*FsWalker) Init

func (f *FsWalker) Init(config Config, labels map[string]string, labelsNames []string) error

func (*FsWalker) ProcessFile

func (b *FsWalker) ProcessFile(base string, path string, size int64, depth uint, contentType string, labels map[string]string)

func (*FsWalker) ValidateConfig

func (f *FsWalker) ValidateConfig(config Config) error

func (*FsWalker) Walk

func (f *FsWalker) Walk() error

type FsWalkerConfig

type FsWalkerConfig struct {
	Folder string `long:"folder" env:"FOLDER" default:"/" description:"Folder to be used for FS walker"`
}

type S3Configuration

type S3Configuration struct {
	Endpoint        string `long:"endpoint" description:"URL to the S3" required:"false" env:"ENDPOINT"`
	Bucket          string `long:"bucket" description:"S3 bucket" required:"false" env:"BUCKET"`
	AccessKey       string `long:"access-key" description:"S3 Storage Access Key" required:"false" env:"ACCESS_KEY"`
	SecretKey       string `long:"secret-key" description:"S3 Storage Secret Key" required:"false" env:"SECRET_KEY"`
	Region          string `long:"region" description:"S3 Storage Region" required:"false" env:"REGION" default:"us-west"`
	BucketPathStyle bool   `long:"bucket-path-style" description:"Bucket type" required:"false" env:"BUCKET_PATH_STYLE"`
}

type S3Walker

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

func (*S3Walker) Init

func (s *S3Walker) Init(config Config, labels map[string]string, _ []string) error

func (*S3Walker) ProcessFile

func (b *S3Walker) ProcessFile(base string, path string, size int64, depth uint, contentType string, labels map[string]string)

func (*S3Walker) ValidateConfig

func (s *S3Walker) ValidateConfig(Config) error

func (*S3Walker) Walk

func (s *S3Walker) Walk() error

type S3WalkerConfig

type S3WalkerConfig struct {
	S3Configuration `group:"S3 Configuration" namespace:"s3" env-namespace:"S3"`
	BucketFilters   []string `long:"bucket-filter" env:"BUCKET_FILTER" description:"Exclude buckets based on name"`
}

type Walker

type Walker interface {
	Init(config Config, labels map[string]string, labelValue []string) error
	Walk() error
	ValidateConfig(config Config) error
}

func FromConfig

func FromConfig(config Config, walkerType string) (Walker, error)

Jump to

Keyboard shortcuts

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