Documentation ¶
Index ¶
- Constants
- Variables
- func CustomErrorHandler(ctx *fiber.Ctx, err error) error
- func GenerateErrorDetails(validationErrors []ValidationError) string
- func NormalizeEmail(email *string) *string
- func ValidateRequestEntity(ctx *fiber.Ctx, request interface{}, errorMessage string) error
- type Base64Key
- type CodeHosting
- type Environment
- type Log
- type ProblemJSONError
- type PublisherPatch
- type PublisherPost
- type Response
- type SoftwarePatch
- type SoftwarePost
- type ValidationError
- type Webhook
Constants ¶
View Source
const ( SymmetricKeyLen = 32 EventTypeCreate = "create" EventTypeUpdate = "update" EventTypeDelete = "delete" )
Variables ¶
Functions ¶
func CustomErrorHandler ¶
func GenerateErrorDetails ¶ added in v0.8.0
func GenerateErrorDetails(validationErrors []ValidationError) string
func NormalizeEmail ¶ added in v0.5.1
func ValidateRequestEntity ¶ added in v0.5.1
Types ¶
type CodeHosting ¶
type Environment ¶
type Environment struct { MaxRequests int `env:"MAX_REQUESTS" envDefault:"0"` CurrentEnvironment string `env:"ENVIRONMENT" envDefault:"production"` Database string `env:"DATABASE_DSN"` PasetoKey *Base64Key `env:"PASETO_KEY"` }
var EnvironmentConfig Environment //nolint:gochecknoglobals
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, validationErrors []ValidationError, ) ProblemJSONError
func InternalServerError ¶ added in v0.9.0
func InternalServerError(title string) ProblemJSONError
func (ProblemJSONError) Error ¶
func (pj ProblemJSONError) Error() string
type PublisherPatch ¶ added in v0.5.1
type PublisherPatch struct { CodeHosting *[]CodeHosting `json:"codeHosting" validate:"omitempty,gt=0,dive"` Description *string `json:"description"` Email *string `json:"email" validate:"omitempty,email"` Active *bool `json:"active"` AlternativeID *string `json:"alternativeId" validate:"omitempty,max=255"` }
type PublisherPost ¶ added in v0.5.1
type PublisherPost struct { CodeHosting []CodeHosting `json:"codeHosting" validate:"required,gt=0,dive"` Description string `json:"description" validate:"required"` Email *string `json:"email" validate:"omitempty,email"` Active *bool `json:"active"` AlternativeID *string `json:"alternativeId" validate:"omitempty,min=1,max=255"` }
type SoftwarePatch ¶ added in v0.5.0
type SoftwarePost ¶ added in v0.5.0
type ValidationError ¶
type ValidationError struct { Field string `json:"field"` Rule string `json:"rule"` Value string `json:"value"` }
func ValidateStruct ¶
func ValidateStruct(validateStruct interface{}) []ValidationError
Click to show internal directories.
Click to hide internal directories.