internalcmd

package
v1.80.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGCFilewalkerCmd

func NewGCFilewalkerCmd() *cobra.Command

NewGCFilewalkerCmd creates a new cobra command for running garbage collection filewalker.

func NewUsedSpaceFilewalkerCmd

func NewUsedSpaceFilewalkerCmd() *cobra.Command

NewUsedSpaceFilewalkerCmd creates a new cobra command for running used-space calculation filewalker.

Types

type FilewalkerCfg

type FilewalkerCfg struct {
	lazyfilewalker.Config
}

FilewalkerCfg is the config structure for the lazyfilewalker commands.

func (*FilewalkerCfg) DatabaseConfig

func (config *FilewalkerCfg) DatabaseConfig() storagenodedb.Config

DatabaseConfig returns the storagenodedb.Config that should be used with this lazyfilewalker.

type GCLazyFileWalker

type GCLazyFileWalker struct {
	*RunOptions
}

GCLazyFileWalker is an execwrapper.Command for the gc-filewalker.

func NewGCLazyFilewalker

func NewGCLazyFilewalker(ctx context.Context, logger *zap.Logger, config lazyfilewalker.Config) *GCLazyFileWalker

NewGCLazyFilewalker creates a new GCLazyFileWalker instance.

func NewGCLazyFilewalkerWithConfig

func NewGCLazyFilewalkerWithConfig(ctx context.Context, logger *zap.Logger, config *FilewalkerCfg) *GCLazyFileWalker

NewGCLazyFilewalkerWithConfig creates a new GCLazyFileWalker instance with the given config.

func (*GCLazyFileWalker) Run

func (g *GCLazyFileWalker) Run() (err error)

Run runs the GCLazyFileWalker.

func (*GCLazyFileWalker) SetErr

func (g *GCLazyFileWalker) SetErr(writer io.Writer)

SetErr sets the stderr of the GCLazyFileWalker.

func (*GCLazyFileWalker) SetIn

func (g *GCLazyFileWalker) SetIn(reader io.Reader)

SetIn sets the stdin of the GCLazyFileWalker.

func (*GCLazyFileWalker) SetOut

func (g *GCLazyFileWalker) SetOut(writer io.Writer)

SetOut sets the stdout of the GCLazyFileWalker.

func (*GCLazyFileWalker) Start

func (g *GCLazyFileWalker) Start() error

Start starts the GCLazyFileWalker, assuming it behaves like the Start method on exec.Cmd. This is a no-op and only exists to satisfy the execwrapper.Command interface. Wait must be called to actually run the command.

func (*GCLazyFileWalker) Wait

func (g *GCLazyFileWalker) Wait() error

Wait waits for the GCLazyFileWalker to finish, assuming it behaves like the Wait method on exec.Cmd.

type RunOptions

type RunOptions struct {
	Ctx    context.Context
	Logger *zap.Logger
	Config *FilewalkerCfg
	// contains filtered or unexported fields
}

RunOptions defines the options for the lazyfilewalker runners.

func DefaultRunOpts

func DefaultRunOpts(ctx context.Context, logger *zap.Logger, config *FilewalkerCfg) *RunOptions

DefaultRunOpts returns the default RunOptions.

func (*RunOptions) SetErr

func (r *RunOptions) SetErr(writer io.Writer)

SetErr sets the stderr writer.

func (*RunOptions) SetIn

func (r *RunOptions) SetIn(reader io.Reader)

SetIn sets the stdin reader.

func (*RunOptions) SetOut

func (r *RunOptions) SetOut(writer io.Writer)

SetOut sets the stdout writer.

type UsedSpaceLazyFileWalker

type UsedSpaceLazyFileWalker struct {
	*RunOptions
}

UsedSpaceLazyFileWalker is an execwrapper.Command for the used-space-filewalker.

func NewUsedSpaceLazyFilewalker

func NewUsedSpaceLazyFilewalker(ctx context.Context, logger *zap.Logger, config lazyfilewalker.Config) *UsedSpaceLazyFileWalker

NewUsedSpaceLazyFilewalker creates a new UsedSpaceLazyFileWalker instance.

func NewUsedSpaceLazyFilewalkerWithConfig

func NewUsedSpaceLazyFilewalkerWithConfig(ctx context.Context, logger *zap.Logger, config *FilewalkerCfg) *UsedSpaceLazyFileWalker

NewUsedSpaceLazyFilewalkerWithConfig creates a new UsedSpaceLazyFileWalker instance with the given config.

func (*UsedSpaceLazyFileWalker) Run

func (u *UsedSpaceLazyFileWalker) Run() (err error)

Run runs the UsedSpaceLazyFileWalker.

func (*UsedSpaceLazyFileWalker) SetErr

func (u *UsedSpaceLazyFileWalker) SetErr(writer io.Writer)

SetErr sets the stderr of the UsedSpaceLazyFileWalker.

func (*UsedSpaceLazyFileWalker) SetIn

func (u *UsedSpaceLazyFileWalker) SetIn(reader io.Reader)

SetIn sets the stdin of the UsedSpaceLazyFileWalker.

func (*UsedSpaceLazyFileWalker) SetOut

func (u *UsedSpaceLazyFileWalker) SetOut(writer io.Writer)

SetOut sets the stdout of the UsedSpaceLazyFileWalker.

func (*UsedSpaceLazyFileWalker) Start

func (u *UsedSpaceLazyFileWalker) Start() error

Start starts the GCLazyFileWalker, assuming it behaves like the Start method on exec.Cmd. This is a no-op and only exists to satisfy the execwrapper.Command interface. Wait must be called to actually run the command.

func (*UsedSpaceLazyFileWalker) Wait

func (u *UsedSpaceLazyFileWalker) Wait() error

Wait waits for the GCLazyFileWalker to finish, assuming it behaves like the Wait method on exec.Cmd.

Jump to

Keyboard shortcuts

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