Documentation
¶
Overview ¶
Package cmd has the resources' commands and flags
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCommands ¶
type ClientCommands struct {
ResourceCommands
}
ClientCommands are the commands which call the resources' API
type Flags ¶
type Flags struct {
MaxSize int64 `name:"max-size" help:"Largest content of a resource, in bytes." default:"268435456" env:"LLM_RESOURCE_MAX_SIZE"`
Retention time.Duration `` /* 150-byte string literal not displayed */
}
Flags are the resources' flags for the server: the largest content of a resource, and how long one on its own is kept, after it's last used
func (Flags) WithResources ¶
func (flags Flags) WithResources(ctx server.Cmd, srv *servercmd.RunServer, store resource.Store, fn func(*resource.Manager) error, opts ...resource.Opt) error
WithResources creates the resources' manager, of the store, with the flags, and the options, such as the broadcaster it publishes their changes to, and which it watches for the sessions which are deleted, registers its HTTP handlers with the server, when there is one, and then calls the function with it, returning any error. The function runs it, so the resources are cleaned.
type ResourceCmd ¶
type ResourceCommands ¶
type ResourceCommands struct {
Resources ResourcesCmd `` /* 148-byte string literal not displayed */
Resource ResourceCmd `cmd:"" name:"resource" help:"Print a resource." group:"RESOURCE"`
ResourceCreate ResourceCreateCmd `` /* 131-byte string literal not displayed */
ResourceGet ResourceGetCmd `cmd:"" name:"resource-get" help:"Download a resource's content, to a file, or standard output." group:"RESOURCE"`
ResourceDelete ResourceDeleteCmd `cmd:"" name:"resource-delete" help:"Delete a resource." group:"RESOURCE"`
}
ResourceCommands are the commands which list, upload, get, download and delete the resources
type ResourceCreateCmd ¶
type ResourceCreateCmd struct {
File string `arg:"" name:"file" optional:"" help:"File to upload, or standard input, when it's omitted, or -." type:"path"`
Session string `` /* 158-byte string literal not displayed */
Name string `name:"name" help:"Name of the resource, which is the file's, when it's omitted."`
Description string `name:"description" help:"Description of the resource."`
Type string `name:"type" help:"MIME type of the resource, which is detected, when it's omitted."`
}
type ResourceDeleteCmd ¶
type ResourceGetCmd ¶
type ResourceGetCmd struct {
Hash string `arg:"" name:"hash" help:"Hash of the resource."`
Session string `name:"session" help:"Identifier of the session the resource is in, or none, for one on its own."`
Output string `name:"output" short:"o" help:"File to write the content to, or standard output, when it's omitted, or -." type:"path"`
}