Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrCodeBadArgument = "BadArgument" ErrCodeServerError = "ServerError" ErrCodeNotFound = "NotFound" ErrCodeAccessDenied = "AccessDenied" )
Variables ¶
View Source
var ( DefaultConfig = Options{ ImageWidth: 160, ImageHeight: 80, ImageExpiration: 86400000, ImageColor: []uint8{51, 102, 204}, Symbols: defSymbols, LengthMin: 4, LengthMax: 6, ServerPort: 9527, // contains filtered or unexported fields } DataConnector kvapi.Client )
Functions ¶
func WebServerModule ¶
func WebServerStart ¶
func WebServerStart()
Types ¶
type Api ¶
type Api struct {
*httpsrv.Controller
}
func (Api) ImageAction ¶
func (c Api) ImageAction()
func (Api) VerifyAction ¶
func (c Api) VerifyAction()
type ErrorMeta ¶ added in v0.1.2
type ErrorMeta struct { // A machine-readable description of the type of the error. If this value is // empty there is no information available. Code string `json:"code,omitempty" toml:"code,omitempty"` // A human-readable description of the error message. Message string `json:"message,omitempty" toml:"message,omitempty"` }
ErrorMeta provides more information about an api failure.
func NewErrorMeta ¶ added in v0.1.2
type Options ¶
type Options struct { // FontPath string `json:"font_path,omitempty" toml:"font_path,omitempty"` DataDir string `json:"data_dir,omitempty" toml:"data_dir,omitempty"` // Standard width and height of a CAPTCHA image. ImageWidth int `json:"image_width,omitempty" toml:"image_width,omitempty"` ImageHeight int `json:"image_height,omitempty" toml:"image_height,omitempty"` // RGB red, green, blue values for the color of a CAPTCHA image. ImageColor []uint8 `json:"image_color,omitempty" toml:"image_color,omitempty"` // Expiration time (in milliseconds) of CAPTCHAs used by store. ImageExpiration int64 `json:"image_expiration,omitempty" toml:"image_expiration,omitempty"` // Symbols used to draw CAPTCHA // // Example: // symbols 0123456789 // Example: // symbols 34578acdekpsvxy // (!) alphabet without similar symbols (0=o, 1=l, 2=z, 6=b, 9=g, ...) Symbols string `json:"symbols,omitempty" toml:"symbols,omitempty"` // Default number of symbols in CAPTCHA solution. LengthMin int `json:"length_min,omitempty" toml:"length_min,omitempty"` LengthMax int `json:"length_max,omitempty" toml:"length_max,omitempty"` // ServerPort uint16 `json:"server_port,omitempty" toml:"server_port,omitempty"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.