Documentation ¶
Index ¶
- func ClosePostgresConnection()
- func ErrorHandlerMiddleware() gin.HandlerFunc
- func GetPostgresConnection() *sql.DB
- func GetValidator() *validator.Validate
- func ParseISODate(date string) (time.Time, error)
- func ParseMicroserviceError(resp *http.Response, err error) error
- func ValidateMultipartFileHeader(multipartHeader *multipart.FileHeader) error
- func WithAuthenticationMiddleware() gin.HandlerFunc
- func WithAuthorizationMiddleware(role []string) gin.HandlerFunc
- type Claims
- type EnvironmentSpec
- type JwtTokenHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClosePostgresConnection ¶
func ClosePostgresConnection()
func ErrorHandlerMiddleware ¶
func ErrorHandlerMiddleware() gin.HandlerFunc
func GetPostgresConnection ¶
func GetValidator ¶
func GetValidator() *validator.Validate
func ParseISODate ¶ added in v0.29.0
ParseISODate parses a date in ISO format received from a date-time input
func ParseMicroserviceError ¶ added in v0.35.0
ParseMicroserviceError parses the error returned by the archives microservice
func ValidateMultipartFileHeader ¶ added in v0.37.0
func ValidateMultipartFileHeader(multipartHeader *multipart.FileHeader) error
ValidateMultipartFileHeader validates the multipart archive according to the environment configuration and domain rules
func WithAuthenticationMiddleware ¶ added in v0.4.0
func WithAuthenticationMiddleware() gin.HandlerFunc
func WithAuthorizationMiddleware ¶ added in v0.4.0
func WithAuthorizationMiddleware(role []string) gin.HandlerFunc
Types ¶
type EnvironmentSpec ¶ added in v0.5.1
type EnvironmentSpec struct { // Execution environment Environment string `split_words:"true" default:"development"` // Connection strings DbConnectionString string `split_words:"true" default:"postgres://postgres:postgres@localhost:5432/codelabs?sslmode=disable"` WebClientUrl string `split_words:"true" default:"http://localhost:5173"` StaticFilesMicroserviceAddress string `split_words:"true" default:"http://localhost:8081"` // PgSQL migration files DbMigrationsPath string `split_words:"true" default:"file://sql/migrations"` // JWT parameters JwtSecret string `split_words:"true" default:"default"` JwtExpirationHours int `split_words:"true" default:"6"` // Configuration parameters ArchiveMaxSizeKb int64 `split_words:"true" default:"1024"` }
func GetEnvironment ¶
func GetEnvironment() *EnvironmentSpec
type JwtTokenHandler ¶ added in v0.3.0
func GetJwtTokenHandler ¶ added in v0.3.0
func GetJwtTokenHandler() *JwtTokenHandler
func (JwtTokenHandler) GenerateToken ¶ added in v0.3.0
func (handler JwtTokenHandler) GenerateToken(user entities.User) (string, error)
func (JwtTokenHandler) ValidateToken ¶ added in v0.3.0
func (handler JwtTokenHandler) ValidateToken(token string) (dtos.CustomClaimsDTO, error)
Click to show internal directories.
Click to hide internal directories.