Documentation
¶
Index ¶
- Variables
- func ErrorResponse(w http.ResponseWriter, code int, message string)
- func GetIP(r *http.Request) string
- func Hash(s string) uint64
- func JsonResponse(w http.ResponseWriter, code int, payload interface{})
- func OkOrDie(err error)
- func ValidUrl(raw string) bool
- type AlreadyExistsError
- type InvalidValueError
- type NoSuchKeyError
- type VersionMismatchError
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyError = errors.New("Emtpy value")
View Source
var InternalError = errors.New("Internal error")
View Source
var InvalidTokenError = errors.New("Invalid token")
View Source
var PermissionDeniedError = errors.New("Permission denied")
Functions ¶
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, code int, message string)
func GetIP ¶
GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.
func JsonResponse ¶
func JsonResponse(w http.ResponseWriter, code int, payload interface{})
Types ¶
type AlreadyExistsError ¶
type AlreadyExistsError string
func (AlreadyExistsError) Error ¶
func (e AlreadyExistsError) Error() string
type InvalidValueError ¶
type InvalidValueError string
func (InvalidValueError) Error ¶
func (e InvalidValueError) Error() string
type NoSuchKeyError ¶
type NoSuchKeyError string
func (NoSuchKeyError) Error ¶
func (e NoSuchKeyError) Error() string
type VersionMismatchError ¶
func (VersionMismatchError) Error ¶
func (e VersionMismatchError) Error() string
Click to show internal directories.
Click to hide internal directories.