Documentation
¶
Index ¶
- type Item
- type PageObj
- type S3Proxy
- func (p S3Proxy) BrowseHandler(w http.ResponseWriter, r *http.Request, key string) error
- func (S3Proxy) CaddyModule() caddy.ModuleInfo
- func (p S3Proxy) ConstructListObjInput(r *http.Request, key string) s3.ListObjectsV2Input
- func (p S3Proxy) DeleteHandler(w http.ResponseWriter, r *http.Request, key string) error
- func (p S3Proxy) GetHandler(w http.ResponseWriter, r *http.Request, fullPath string) error
- func (p S3Proxy) MakePageObj(result *s3.ListObjectsV2Output) PageObj
- func (p *S3Proxy) Provision(ctx caddy.Context) (err error)
- func (p S3Proxy) PutHandler(w http.ResponseWriter, r *http.Request, key string) error
- func (p S3Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PageObj ¶
type PageObj struct {
Count int64 `json:"count"`
Items []Item `json:"items"`
MoreLink string `json:"more"`
}
func (PageObj) GenerateHtml ¶
GenerateHtml generates html output for the PageObj
func (PageObj) GenerateJson ¶
func (po PageObj) GenerateJson(w http.ResponseWriter) error
GenerateJson generates JSON output for the PageObj
type S3Proxy ¶
type S3Proxy struct {
// The path to the root of the site. Default is `{http.vars.root}` if set,
// Or if not set the value is "" - meaning use the whole path as a key.
Root string `json:"root,omitempty"`
// The AWS region the bucket is hosted in
Region string `json:"region,omitempty"`
// The AWS profile to use if mulitple profiles are specified in creds
Profile string `json:"profile,omitempty"`
// The name of the S3 bucket
Bucket string `json:"bucket,omitempty"`
// Use non-standard endpoint for S3
Endpoint string `json:"endpoint,omitempty"`
// The names of files to try as index files if a folder is requested.
IndexNames []string `json:"index_names,omitempty"`
// A glob pattern used to hide matching key paths (returning a 404)
Hide []string
// Flag to determine if PUT operations are allowed (default false)
EnablePut bool
// Flag to determine if DELETE operations are allowed (default false)
EnableDelete bool
// Flag to enable browsing of "directories" in S3 (paths that end with a /)
EnableBrowse bool
// Path to a template file to use for generating browse dir html page
BrowseTemplate string
// Mapping of HTTP error status to S3 keys or pass through option.
ErrorPages map[int]string `json:"error_pages,omitempty"`
// S3 key to a default error page or pass through option.
DefaultErrorPage string `json:"default_error_page,omitempty"`
// Set this to `true` to force the request to use path-style addressing.
S3ForcePathStyle bool `json:"force_path_style,omitempty"`
// Set this to `true` to enable S3 Accelerate feature.
S3UseAccelerate bool `json:"use_accelerate,omitempty"`
// contains filtered or unexported fields
}
S3Proxy implements a proxy to return, set, delete or browse objects from S3
func (S3Proxy) BrowseHandler ¶
func (S3Proxy) CaddyModule ¶
func (S3Proxy) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (S3Proxy) ConstructListObjInput ¶
func (S3Proxy) DeleteHandler ¶
func (S3Proxy) GetHandler ¶
func (S3Proxy) MakePageObj ¶
func (p S3Proxy) MakePageObj(result *s3.ListObjectsV2Output) PageObj
func (S3Proxy) PutHandler ¶
Click to show internal directories.
Click to hide internal directories.