cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 46 Imported by: 1 module, 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 ActionCallCmd

type ActionCallCmd struct {
	Name   string `arg:"" name:"name" help:"Volume name"`
	Action string `arg:"" name:"action" help:"Action name, such as task_list"`
	Input  string `` /* 175-byte string literal not displayed */
}

func (*ActionCallCmd) Run

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

type ActionCommands

type ActionCommands struct {
	ActionList ActionListCmd `` /* 163-byte string literal not displayed */
	ActionCall ActionCallCmd `` /* 138-byte string literal not displayed */
}

type ActionListCmd

type ActionListCmd struct {
	Name string `arg:"" name:"name" optional:"" help:"Volume name, or every volume which is mounted, and online, without it"`
}

func (*ActionListCmd) Run

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

type ClientCommands

type ClientCommands struct {
	VolumeCommands
	ObjectCommands
	SearchCommands
	ActionCommands

	// The server's credentials, such as GOOGLE_CLIENT, and the sign-ins
	// which are stored, of go-auth's
	credentialcmd.CredentialProviderCommands
	credentialcmd.CredentialManagerCommands
}

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

type Flags

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

func (Flags) WithRegistry

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

WithRegistry creates a registry of volumes, with the server's tracer and meter, and the flags' worker, when it's set, and then the options, such as the provider of the volumes' credentials (registry.WithCredentials), which they look up of their names, such as S3_SECRET, and runs it, so the changes to its volumes are published to the broadcaster, and it's closed when the function returns, 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. The broadcaster is one a server shares with its other modules, which it runs and serves, or, when it's nil, one which is created, served as go-server's /changes, and run until the function returns. 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

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

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

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

type ObjectGetCmd

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

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

type ObjectHeadCmd

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

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

type ObjectListCmd

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       string  `` /* 224-byte string literal not displayed */
	Sort       string  `` /* 192-byte string literal not displayed */
	NoTitle    bool    `name:"no-title" help:"Show each object's name, rather than its title (dc:title), when it has one."`
}

func (*ObjectListCmd) Run

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

type ObjectPutCmd

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

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

type ObjectUploadCmd

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

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

type SearchCmd

type SearchCmd struct {
	Query   []string `` /* 240-byte string literal not displayed */
	Offset  uint64   `name:"offset" help:"How many of the objects which match are skipped, before those which are shown"`
	Limit   *uint64  `name:"limit" help:"Maximum number of objects to show, which defaults to and is capped at 100"`
	NoTitle bool     `name:"no-title" help:"Show the paths of objects, rather than their titles"`
}

func (*SearchCmd) AfterApply

func (cmd *SearchCmd) AfterApply(kctx *kong.Context) error

AfterApply sets the query to the words of the command line as they're written, as Kong splits a word which starts with -, which is excluded, as short flags, when it's the first of the query, such as -symphony, of -s and ymphony, which are its characters, so the query is the fewest words, at the end of the command line, which are of the same characters, without a -- before them

func (*SearchCmd) Run

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

type SearchCommands

type SearchCommands struct {
	Search SearchCmd `` /* 153-byte string literal not displayed */
}

SearchCommands are the commands which search the objects of volumes

type SignInFlags

type SignInFlags struct {
	NoBrowser  bool   `name:"no-browser" help:"Print the URL to sign in at, when its user needs to sign in, rather than opening it in the browser."`
	SignInAddr string `` /* 203-byte string literal not displayed */
}

SignInFlags are the flags of signing in, of a command which signs in, when the server needs it: whether the URL to sign in at is opened, and the loopback address it redirects to, which is fixed, so it can be one a web application's client registers, as well as any a desktop app's can

type VolumeBackendsCmd

type VolumeBackendsCmd struct{}

func (*VolumeBackendsCmd) Run

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

type VolumeCommands

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"`
	VolumeBackends        VolumeBackendsCmd        `` /* 181-byte string literal not displayed */
	VolumeCreate          VolumeCreateCmd          `cmd:"" name:"volume-create" help:"Create a volume from the URL of its backend, or a directory." group:"VOLUME"`
	VolumeCreateFS        VolumeCreateFSCmd        `cmd:"" name:"volume-create-fs" help:"Create a volume of a directory on the server." group:"VOLUME"`
	VolumeCreateS3        VolumeCreateS3Cmd        `` /* 145-byte string literal not displayed */
	VolumeCreateGTasks    VolumeCreateGTasksCmd    `` /* 167-byte string literal not displayed */
	VolumeCreateGContacts VolumeCreateGContactsCmd `` /* 184-byte string literal not displayed */
	VolumeCreateGCalendar VolumeCreateGCalendarCmd `` /* 236-byte string literal not displayed */
	VolumeCreateGDrive    VolumeCreateGDriveCmd    `` /* 292-byte string literal not displayed */
	VolumeCreateRSS       VolumeCreateRSSCmd       `cmd:"" name:"volume-create-rss" help:"Create a volume of an RSS feed's items, read-only, of its URL." group:"VOLUME"`
	VolumeCreateWebcal    VolumeCreateWebcalCmd    `` /* 132-byte string literal not displayed */
	VolumeUpdate          VolumeUpdateCmd          `` /* 212-byte string literal not displayed */
	VolumeMount           VolumeMountCmd           `` /* 162-byte string literal not displayed */
	VolumeUnmount         VolumeUnmountCmd         `` /* 134-byte string literal not displayed */
	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

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 */
	Description string   `` /* 130-byte string literal not displayed */
	Writable    *bool    `` /* 189-byte string literal not displayed */
}

func (*VolumeCreateCmd) Run

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

type VolumeCreateFSCmd

type VolumeCreateFSCmd struct {
	Name        string   `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Path        string   `arg:"" name:"path" help:"Absolute path of the directory, on the server, such as /mnt/media."`
	Writable    bool     `` /* 158-byte string literal not displayed */
	Skip        []string `` /* 237-byte string literal not displayed */
	Package     []string `` /* 254-byte string literal not displayed */
	Opt         []string `` /* 210-byte string literal not displayed */
	Description string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateFSCmd) Run

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

type VolumeCreateGCalendarCmd

type VolumeCreateGCalendarCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Writable        bool           `` /* 257-byte string literal not displayed */
	Window          string         `` /* 148-byte string literal not displayed */
	Credential      string         `` /* 171-byte string literal not displayed */
	Quota           *uint          `name:"quota" help:"Most requests to Google each minute, or 0 not to limit them, which is 120, unless it's set."`
	RefreshInterval *time.Duration `` /* 147-byte string literal not displayed */
	SignInFlags
	Opt         []string `` /* 211-byte string literal not displayed */
	Description string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateGCalendarCmd) Run

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

Run creates a volume of contacts, as a volume of tasks is created

type VolumeCreateGContactsCmd

type VolumeCreateGContactsCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Writable        bool           `` /* 261-byte string literal not displayed */
	Credential      string         `` /* 171-byte string literal not displayed */
	Quota           *uint          `name:"quota" help:"Most requests to Google each minute, or 0 not to limit them, which is 120, unless it's set."`
	RefreshInterval *time.Duration `` /* 147-byte string literal not displayed */
	SignInFlags
	Opt         []string `` /* 210-byte string literal not displayed */
	Description string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateGContactsCmd) Run

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

type VolumeCreateGDriveCmd

type VolumeCreateGDriveCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Writable        bool           `` /* 233-byte string literal not displayed */
	Credential      string         `` /* 171-byte string literal not displayed */
	Quota           *uint          `name:"quota" help:"Most requests to Google each minute, or 0 not to limit them, which is 120, unless it's set."`
	RefreshInterval *time.Duration `` /* 161-byte string literal not displayed */
	SignInFlags
	Opt         []string `` /* 210-byte string literal not displayed */
	Description string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateGDriveCmd) Run

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

type VolumeCreateGTasksCmd

type VolumeCreateGTasksCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Writable        bool           `` /* 229-byte string literal not displayed */
	Credential      string         `` /* 171-byte string literal not displayed */
	Quota           *uint          `name:"quota" help:"Most requests to Google each minute, or 0 not to limit them, which is 120, unless it's set."`
	RefreshInterval *time.Duration `` /* 147-byte string literal not displayed */
	Hidden          bool           `` /* 134-byte string literal not displayed */
	SignInFlags
	Opt         []string `` /* 210-byte string literal not displayed */
	Description string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateGTasksCmd) Run

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

Run creates the volume of Google Tasks, and, when the server says its user needs to sign in, signs in with Google, in the browser, and creates it again

type VolumeCreateRSSCmd

type VolumeCreateRSSCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Feed            string         `arg:"" name:"url" help:"URL of the feed, which is http or https."`
	RefreshInterval *time.Duration `name:"refresh-interval" placeholder:"DURATION" help:"How long a feed which is fetched is kept, which is 5m, unless it's set."`
	Opt             []string       `` /* 211-byte string literal not displayed */
	Description     string         `` /* 126-byte string literal not displayed */
}

func (*VolumeCreateRSSCmd) Run

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

type VolumeCreateS3Cmd

type VolumeCreateS3Cmd struct {
	Name         string   `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Bucket       string   `arg:"" name:"bucket" help:"Bucket, and optionally a prefix of its keys, such as my.bucket or my.bucket/photos."`
	Region       string   `name:"region" help:"Region of the bucket, which is its own, when it's not set."`
	Endpoint     string   `` /* 127-byte string literal not displayed */
	Profile      string   `name:"profile" help:"Profile of the server's shared AWS configuration, whose credentials are used."`
	AccessKey    string   `` /* 197-byte string literal not displayed */
	SecretKey    string   `` /* 187-byte string literal not displayed */
	SessionToken string   `` /* 148-byte string literal not displayed */
	Anonymous    bool     `name:"anonymous" help:"Requests aren't signed, so they're without credentials, and the volume is read-only."`
	Writable     bool     `` /* 205-byte string literal not displayed */
	SeaweedFS    string   `` /* 194-byte string literal not displayed */
	Opt          []string `` /* 210-byte string literal not displayed */
	Description  string   `` /* 130-byte string literal not displayed */
}

func (*VolumeCreateS3Cmd) Run

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

type VolumeCreateWebcalCmd added in v0.5.2

type VolumeCreateWebcalCmd struct {
	Name            string         `arg:"" name:"name" help:"Volume name, which is an identifier."`
	Feed            string         `arg:"" name:"url" help:"URL of the calendar, which is webcal, https or http, such as a calendar's subscription link."`
	RefreshInterval *time.Duration `` /* 130-byte string literal not displayed */
	Opt             []string       `` /* 211-byte string literal not displayed */
	Description     string         `` /* 133-byte string literal not displayed */
}

func (*VolumeCreateWebcalCmd) Run added in v0.5.2

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

type VolumeDeleteCmd

type VolumeDeleteCmd struct {
	VolumeGetCmd
}

func (*VolumeDeleteCmd) Run

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

type VolumeGetCmd

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

func (*VolumeGetCmd) Run

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

type VolumeListCmd

type VolumeListCmd struct{}

func (*VolumeListCmd) Run

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

type VolumeMountCmd

type VolumeMountCmd struct {
	VolumeGetCmd
	SignInFlags
}

func (*VolumeMountCmd) Run

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

Run enables the volume, so it's mounted

type VolumeUnmountCmd

type VolumeUnmountCmd struct {
	VolumeGetCmd
}

func (*VolumeUnmountCmd) Run

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

Run disables the volume, so it's unmounted

type VolumeUpdateCmd

type VolumeUpdateCmd struct {
	VolumeGetCmd
	SignInFlags
	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."`
	Enabled     *bool    `` /* 162-byte string literal not displayed */
	Description *string  `` /* 150-byte string literal not displayed */
	Writable    *bool    `` /* 199-byte string literal not displayed */
}

func (*VolumeUpdateCmd) Run

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

type VolumeWatchCmd

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

func (*VolumeWatchCmd) Run

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

Run watches the changes to the objects of the volumes, or of every volume, with go-server's /changes, of the filer schema

Jump to

Keyboard shortcuts

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