Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAuthentication = errors.New("No authentication scheme was configured.") ErrEmptyAuth = errors.New("Empty or missing authentication header.") ErrNoGrantTime = errors.New("No grant time specified in the authentication grant.") ErrExpiredGrant = errors.New("The authentication grant has expired.") ErrMACMismatch = errors.New("The provided message authentication code is invalid for the given message.") )
Functions ¶
This section is empty.
Types ¶
type AuthenticatedUser ¶
type Authenticator ¶
type Authenticator interface {
GetUser(*http.Request) (*AuthenticatedUser, error)
}
type DatadogStats ¶
type DatadogStats struct {
// contains filtered or unexported fields
}
func NewDatadogStats ¶
func NewDatadogStats(datadogHost string) (*DatadogStats, error)
func (*DatadogStats) Error ¶
func (d *DatadogStats) Error(code int)
func (*DatadogStats) LogStartup ¶
func (d *DatadogStats) LogStartup()
func (*DatadogStats) Request ¶
func (d *DatadogStats) Request(url string)
func (*DatadogStats) ResponseTime ¶
func (d *DatadogStats) ResponseTime(elapsed time.Duration, url string)
func (*DatadogStats) Thumbnail ¶
func (d *DatadogStats) Thumbnail(name string)
func (*DatadogStats) Upload ¶
func (d *DatadogStats) Upload(source string)
type DiscardStats ¶
type DiscardStats struct{}
func (*DiscardStats) Error ¶
func (d *DiscardStats) Error(code int)
func (*DiscardStats) LogStartup ¶
func (d *DiscardStats) LogStartup()
func (*DiscardStats) Request ¶
func (d *DiscardStats) Request(url string)
func (*DiscardStats) ResponseTime ¶
func (d *DiscardStats) ResponseTime(elapsed time.Duration, url string)
func (*DiscardStats) Thumbnail ¶
func (d *DiscardStats) Thumbnail(name string)
func (*DiscardStats) Upload ¶
func (d *DiscardStats) Upload(source string)
type HMACAuthenticator ¶
type HMACAuthenticator struct {
// contains filtered or unexported fields
}
func NewHMACAuthenticatorSHA256 ¶
func NewHMACAuthenticatorSHA256(key []byte) *HMACAuthenticator
func (*HMACAuthenticator) GetUser ¶
func (auth *HMACAuthenticator) GetUser(req *http.Request) (*AuthenticatedUser, error)
func (*HMACAuthenticator) SetTime ¶
func (auth *HMACAuthenticator) SetTime(t time.Time)
type ImageResponse ¶
type ImageResponse struct { Link string `json:"link"` Mime string `json:"mime"` Name string `json:"name"` Hash string `json:"hash"` Size int64 `json:"size"` Width int `json:"width"` Height int `json:"height"` OCRText string `json:"ocrtext"` Thumbs map[string]interface{} `json:"thumbs"` UserID string `json:"user_id"` }
type OcrResponse ¶
type PassthroughAuthenticator ¶
type PassthroughAuthenticator struct{}
func (*PassthroughAuthenticator) GetUser ¶
func (auth *PassthroughAuthenticator) GetUser(req *http.Request) (*AuthenticatedUser, error)
type RuntimeStats ¶
type Server ¶
type Server struct { Config *config.Configuration HTTPClient *http.Client ImageStore imagestore.ImageStore // contains filtered or unexported fields }
func NewAuthenticatedServer ¶
func NewAuthenticatedServer(c *config.Configuration, strategy imageprocessor.ImageProcessorStrategy, auth Authenticator, stats RuntimeStats) *Server
func NewServer ¶
func NewServer(c *config.Configuration, strategy imageprocessor.ImageProcessorStrategy, stats RuntimeStats) *Server
type ServerResponse ¶
type ServerResponse struct { Error string `json:"error,omitempty"` Data interface{} `json:"data,omitempty"` Status int `json:"status"` Success *bool `json:"success"` // the empty value is the nil pointer, because this is a computed property }
func (*ServerResponse) Write ¶
func (resp *ServerResponse) Write(w http.ResponseWriter, s RuntimeStats)
Click to show internal directories.
Click to hide internal directories.