cmd

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCommands

type ClientCommands struct {
	VolumeCommands
	ObjectCommands
}

ClientCommands are the commands which call the filer API of a server

type Flags added in v0.3.0

type Flags struct {
	Volume []string `` /* 348-byte string literal not displayed */
	Worker string   `` /* 176-byte string literal not displayed */
}

func (Flags) WithRegistry added in v0.3.0

func (flags Flags) WithRegistry(ctx server.Cmd, srv *servercmd.RunServer, fn func(*filer.Registry) error, opts ...filer.Opt) (err error)

WithRegistry creates a registry of volumes, with the server's tracer and meter, and credentials from its environment, such as S3_SECRET, which are the placeholders of a volume's credentials, such as ${S3_SECRET}, and those which are stored while it runs, and the flags' worker, when it's set, and then the options, runs it, so the changes to its volumes are sent to the calls to WatchObjects, adds the volumes of the flags, registers its HTTP handlers with the server, when there is one, and then calls the function with the registry. A volume which can't be added is an error. The registry, and its volumes, are closed when the function returns. Returns any error.

type ObjectCommands added in v0.3.0

type ObjectCommands struct {
	ObjectList   ObjectListCmd   `cmd:"" name:"objects" help:"List the objects in a directory of a volume, a page at a time." group:"OBJECT"`
	ObjectHead   ObjectHeadCmd   `cmd:"" name:"object" help:"Get the metadata of an object in a volume." group:"OBJECT"`
	ObjectGet    ObjectGetCmd    `cmd:"" name:"object-get" help:"Download a file in a volume, to a file, or to standard output." group:"OBJECT"`
	ObjectPut    ObjectPutCmd    `cmd:"" name:"object-put" help:"Upload a file, or standard input, to a file in a volume." group:"OBJECT"`
	ObjectUpload ObjectUploadCmd `` /* 126-byte string literal not displayed */
	ObjectDelete ObjectDeleteCmd `cmd:"" name:"object-delete" help:"Delete a file in a volume, or a directory, with --recursive." group:"OBJECT"`
}

type ObjectDeleteCmd added in v0.3.0

type ObjectDeleteCmd struct {
	Name      string `arg:"" name:"name" help:"Volume name."`
	Path      string `arg:"" name:"path" help:"Path of the file, or directory, in the volume."`
	Recursive bool   `name:"recursive" short:"r" help:"Delete a directory, and every object beneath it."`
}

func (*ObjectDeleteCmd) Run added in v0.3.0

func (cmd *ObjectDeleteCmd) Run(ctx server.Cmd) error

type ObjectGetCmd added in v0.2.20

type ObjectGetCmd struct {
	Name  string `arg:"" name:"name" help:"Volume name."`
	Path  string `arg:"" name:"path" help:"Path of the file in the volume."`
	File  string `` /* 148-byte string literal not displayed */
	Force bool   `name:"force" short:"f" help:"Download the file when the file it's downloaded to exists, and isn't older."`
}

func (*ObjectGetCmd) Run added in v0.2.20

func (cmd *ObjectGetCmd) Run(ctx server.Cmd) error

type ObjectHeadCmd added in v0.2.25

type ObjectHeadCmd struct {
	Name string `arg:"" name:"name" help:"Volume name."`
	Path string `arg:"" name:"path" optional:"" help:"Path of the object, which defaults to the root of the volume."`
}

func (*ObjectHeadCmd) Run added in v0.2.25

func (cmd *ObjectHeadCmd) Run(ctx server.Cmd) error

type ObjectListCmd added in v0.2.0

type ObjectListCmd struct {
	Name       string  `arg:"" name:"name" help:"Volume name."`
	Path       string  `arg:"" name:"path" optional:"" help:"Directory to list, which defaults to the root of the volume."`
	Recursive  bool    `name:"recursive" short:"r" help:"List every object beneath the directory."`
	StartAfter string  `name:"start-after" help:"Return objects whose keys sort after this key, which is the next key of the previous page."`
	Limit      *uint64 `name:"limit" help:"Maximum number of objects to return, which defaults to and is capped at 100."`
}

func (*ObjectListCmd) Run added in v0.2.0

func (cmd *ObjectListCmd) Run(ctx server.Cmd) error

type ObjectPutCmd added in v0.2.24

type ObjectPutCmd struct {
	Name        string   `arg:"" name:"name" help:"Volume name."`
	Path        string   `arg:"" name:"path" help:"Path of the file in the volume, or of the directory, ending with /, to upload it to with its name."`
	File        string   `arg:"" name:"file" help:"File to upload, or - for standard input."`
	IfNotExists bool     `name:"no-replace" help:"Don't replace a file which exists."`
	IfExists    bool     `name:"replace-only" help:"Don't create a file which doesn't exist."`
	Meta        []string `` /* 231-byte string literal not displayed */
}

func (*ObjectPutCmd) Run added in v0.2.24

func (cmd *ObjectPutCmd) Run(ctx server.Cmd) error

type ObjectUploadCmd added in v0.3.0

type ObjectUploadCmd struct {
	Name      string   `arg:"" name:"name" help:"Volume name."`
	Path      string   `arg:"" name:"path" help:"Directory in the volume to upload into, which is created, or / for its root."`
	Files     []string `` /* 214-byte string literal not displayed */
	Overwrite bool     `name:"overwrite" short:"y" help:"Replace files which exist, rather than skipping them."`
	Meta      []string `` /* 232-byte string literal not displayed */
}

func (*ObjectUploadCmd) Run added in v0.3.0

func (cmd *ObjectUploadCmd) Run(ctx server.Cmd) error

type VolumeCommands added in v0.3.0

type VolumeCommands struct {
	VolumeList    VolumeListCmd    `cmd:"" name:"volumes" help:"List volumes, with the URLs of their backends." group:"VOLUME"`
	VolumeGet     VolumeGetCmd     `cmd:"" name:"volume" help:"Get a volume by its name, with the URL of its backend." group:"VOLUME"`
	VolumeSchemes VolumeSchemesCmd `cmd:"" name:"volume-schemes" help:"List the schemes of the URLs which volumes can be created from." group:"VOLUME"`
	VolumeCreate  VolumeCreateCmd  `cmd:"" name:"volume-create" help:"Create a volume from the URL of its backend, or a directory." group:"VOLUME"`
	VolumeUpdate  VolumeUpdateCmd  `cmd:"" name:"volume-update" help:"Change the options of a volume by its name." group:"VOLUME"`
	VolumeDelete  VolumeDeleteCmd  `cmd:"" name:"volume-delete" help:"Delete a volume by its name, without deleting its files." group:"VOLUME"`
	VolumeWatch   VolumeWatchCmd   `` /* 132-byte string literal not displayed */
}

type VolumeCreateCmd added in v0.2.0

type VolumeCreateCmd struct {
	URL  string   `` /* 235-byte string literal not displayed */
	Name string   `` /* 195-byte string literal not displayed */
	Opt  []string `` /* 280-byte string literal not displayed */
}

func (*VolumeCreateCmd) Run added in v0.2.0

func (cmd *VolumeCreateCmd) Run(ctx server.Cmd) error

type VolumeDeleteCmd added in v0.2.14

type VolumeDeleteCmd struct {
	VolumeGetCmd
}

func (*VolumeDeleteCmd) Run added in v0.2.14

func (cmd *VolumeDeleteCmd) Run(ctx server.Cmd) error

type VolumeGetCmd added in v0.2.14

type VolumeGetCmd struct {
	Name string `arg:"" name:"name" help:"Volume name."`
}

func (*VolumeGetCmd) Run added in v0.2.14

func (cmd *VolumeGetCmd) Run(ctx server.Cmd) error

type VolumeListCmd added in v0.2.7

type VolumeListCmd struct{}

func (*VolumeListCmd) Run added in v0.2.7

func (cmd *VolumeListCmd) Run(ctx server.Cmd) error

type VolumeSchemesCmd added in v0.3.0

type VolumeSchemesCmd struct{}

func (*VolumeSchemesCmd) Run added in v0.3.0

func (cmd *VolumeSchemesCmd) Run(ctx server.Cmd) error

type VolumeUpdateCmd added in v0.2.14

type VolumeUpdateCmd struct {
	VolumeGetCmd
	Opt   []string `` /* 252-byte string literal not displayed */
	Unset []string `name:"unset" sep:"none" placeholder:"KEY" help:"Option to remove, so it's the default, which can be repeated."`
}

func (*VolumeUpdateCmd) Run added in v0.2.14

func (cmd *VolumeUpdateCmd) Run(ctx server.Cmd) error

type VolumeWatchCmd added in v0.3.0

type VolumeWatchCmd struct {
	Name []string `arg:"" name:"name" optional:"" help:"Volumes to watch, which is every volume without any."`
}

func (*VolumeWatchCmd) Run added in v0.3.0

func (cmd *VolumeWatchCmd) Run(ctx server.Cmd) error

Jump to

Keyboard shortcuts

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