Documentation
¶
Index ¶
- type ClientCommands
- type Flags
- type ObjectCommands
- type ObjectDeleteCmd
- type ObjectGetCmd
- type ObjectHeadCmd
- type ObjectListCmd
- type ObjectPutCmd
- type ObjectUploadCmd
- type VolumeCommands
- type VolumeCreateCmd
- type VolumeDeleteCmd
- type VolumeGetCmd
- type VolumeListCmd
- type VolumeSchemesCmd
- type VolumeUpdateCmd
- type VolumeWatchCmd
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 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."`
}
type ObjectHeadCmd ¶ added in v0.2.25
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."`
}
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 */
}
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 */
}
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 VolumeDeleteCmd ¶ added in v0.2.14
type VolumeDeleteCmd struct {
VolumeGetCmd
}
type VolumeGetCmd ¶ added in v0.2.14
type VolumeGetCmd struct {
Name string `arg:"" name:"name" help:"Volume name."`
}
type VolumeListCmd ¶ added in v0.2.7
type VolumeListCmd struct{}
type VolumeSchemesCmd ¶ added in v0.3.0
type VolumeSchemesCmd struct{}
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."`
}
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."`
}