Documentation ¶
Overview ¶
Package http provides common functionality for http servers
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "http remote:path", Short: `Serve the remote over HTTP.`, Long: `Run a basic web server to serve a remote over HTTP. This can be viewed in a web browser or you can make a remote of type http read from it. You can use the filter flags (e.g. ` + "`--include`, `--exclude`" + `) to control what is served. The server will log errors. Use ` + "`-v`" + ` to see access logs. ` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` to control the stats printing. ` + libhttp.Help + libhttp.TemplateHelp + libhttp.AuthHelp + vfs.Help, Annotations: map[string]string{ "versionIntroduced": "v1.39", }, Run: func(command *cobra.Command, args []string) { cmd.CheckArgs(1, 1, command, args) f := cmd.NewFsSrc(args) cmd.Run(false, true, command, func() error { ctx := context.Background() s, err := run(ctx, f, Opt) if err != nil { log.Fatal(err) } s.server.Wait() return nil }) }, }
Command definition for cobra
View Source
var DefaultOpt = Options{ Auth: libhttp.DefaultAuthCfg(), HTTP: libhttp.DefaultCfg(), Template: libhttp.DefaultTemplateCfg(), }
DefaultOpt is the default values used for Options
View Source
var Opt = DefaultOpt
Opt is options set by command line flags
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v1.56.0
type Options struct { Auth libhttp.AuthConfig HTTP libhttp.Config Template libhttp.TemplateConfig }
Options required for http server
Directories ¶
Path | Synopsis |
---|---|
Package data provides common functionality for http servers The "go:generate" directive compiles static assets by running assets_generate.go
|
Package data provides common functionality for http servers The "go:generate" directive compiles static assets by running assets_generate.go |
Click to show internal directories.
Click to hide internal directories.