i18n

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorInvalidJSON     = "error_invalid_json"
	ErrorInvalidRule     = "error_invalid_rule"
	ErrorNoRulesProvided = "error_no_rules_provided"

	ErrorAuthorizationMissingHeader         = "error_auth_header_missing"
	ErrorAuthorizationMalformedHeader       = "error_auth_header_malformed"
	ErrorAuthorizationTokenValidationFailed = "error_auth_failed_validation"
	ErrorAuthorizationNotAuthorized         = "error_auth_not_authorized"

	ErrorInternalServer = "error_internal"
)

Message IDs for translation.

Variables

This section is empty.

Functions

func LoadLocales

func LoadLocales(path string) error

LoadLocales loads translation files

func RestError

func RestError(w rest.ResponseWriter, r *rest.Request, code int, id string, args ...interface{})

RestError writes a basic error response with a translated error message and an untranslated error ID TODO: request ID?

Types

type Error

type Error struct {
	Error       string `json:"error"`
	Description string `json:"description"`
}

Error JSON

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL