Documentation ¶
Index ¶
Constants ¶
View Source
const (
SymmetricKeyLen = 32
)
Variables ¶
Functions ¶
func CustomErrorHandler ¶
Types ¶
type CodeHosting ¶
type CodeHosting struct {
URL string `json:"url" validate:"required"`
}
type Environment ¶
type Environment struct { MaxRequests int `env:"MAX_REQUESTS" envDefault:"20"` CurrentEnvironment string `env:"ENVIRONMENT" envDefault:"local"` Database string `env:"DATABASE_DSN"` PasetoKey *Base64Key `env:"PASETO_KEY"` }
func (*Environment) IsTest ¶
func (e *Environment) IsTest() bool
type ProblemJSONError ¶
type ProblemJSONError struct { Code string `json:"code,omitempty"` Title string `json:"title"` Detail string `json:"detail,omitempty"` Status int `json:"status"` ValidationErrors []ValidationError `json:"validationErrors,omitempty"` }
func ErrorWithValidationErrors ¶
func ErrorWithValidationErrors( status int, title string, detail string, validationErrors []ValidationError, ) ProblemJSONError
func (ProblemJSONError) Error ¶
func (pj ProblemJSONError) Error() string
type PublisherUpdate ¶
type PublisherUpdate struct { CodeHosting []CodeHosting `json:"codeHosting" validate:"required"` Description string `json:"description"` Email string `json:"email" validate:"email"` }
type ValidationError ¶
type ValidationError struct { FailedField string `json:"field"` Tag string `json:"rule"` Value string `json:"providedValue"` }
func ValidateStruct ¶
func ValidateStruct(s interface{}) []ValidationError
Click to show internal directories.
Click to hide internal directories.