Documentation ¶
Overview ¶
Package imgrec contains an image recorder used to automatically save images to disk.
Index ¶
- type HTTPWrapper
- func (h HTTPWrapper) GetEnabled(w http.ResponseWriter, r *http.Request)
- func (h HTTPWrapper) GetPrefix(w http.ResponseWriter, r *http.Request)
- func (h HTTPWrapper) GetRoot(w http.ResponseWriter, r *http.Request)
- func (h HTTPWrapper) Inject(rt generichttp.RouteTable)
- func (h HTTPWrapper) SetEnabled(w http.ResponseWriter, r *http.Request)
- func (h HTTPWrapper) SetPrefix(w http.ResponseWriter, r *http.Request)
- func (h HTTPWrapper) SetRoot(w http.ResponseWriter, r *http.Request)
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPWrapper ¶
type HTTPWrapper struct {
*Recorder
}
HTTPWrapper is an HTTP wrapper around an image recorder that allows the folder and prefix to be changed on the fly
it does not implement generichttp.HTTPer, offering an Inject method allowing it to be injected into another HTTPer
func NewHTTPWrapper ¶
func NewHTTPWrapper(r *Recorder) HTTPWrapper
NewHTTPWrapper returns an HTTP wrapper around a recorder
func (HTTPWrapper) GetEnabled ¶
func (h HTTPWrapper) GetEnabled(w http.ResponseWriter, r *http.Request)
GetEnabled returns the Recorder's Enabled field
func (HTTPWrapper) GetPrefix ¶
func (h HTTPWrapper) GetPrefix(w http.ResponseWriter, r *http.Request)
GetPrefix gets the recorder's prefix and sends it back as JSON
func (HTTPWrapper) GetRoot ¶
func (h HTTPWrapper) GetRoot(w http.ResponseWriter, r *http.Request)
GetRoot gets the recorder's root folder and sends it back as JSON
func (HTTPWrapper) Inject ¶
func (h HTTPWrapper) Inject(rt generichttp.RouteTable)
Inject adds GET and POST routes for /autorwrite/root and /autowrite/prefix to the HTTPer which manipulate this wrapper's recorder
func (HTTPWrapper) SetEnabled ¶
func (h HTTPWrapper) SetEnabled(w http.ResponseWriter, r *http.Request)
SetEnabled sets the recorder's Enabled field
func (HTTPWrapper) SetPrefix ¶
func (h HTTPWrapper) SetPrefix(w http.ResponseWriter, r *http.Request)
SetPrefix updates the filename prefix of the recorder
func (HTTPWrapper) SetRoot ¶
func (h HTTPWrapper) SetRoot(w http.ResponseWriter, r *http.Request)
SetRoot updates the root folder of the recorder
type Recorder ¶
type Recorder struct { // Root is the root path Root string // Prefix is the prefix for the filenames Prefix string // Enabled is a flag unused by this struct that allows consumers to disable its use in their code Enabled bool // contains filtered or unexported fields }
Recorder records image sequences with incrementing filenames in yyyy-mm-dd subfolders. It is not thread safe.