Documentation ¶
Index ¶
- func ClosePostgresConnection()
- func CloseRabbitMQConnection()
- func ConnectToRabbitMQ()
- func ErrorHandlerMiddleware() gin.HandlerFunc
- func GetMultipartFormBufferFromFile(file *multipart.File) (*baseMultipartFormBuffer, error)
- func GetPostgresConnection() *sql.DB
- func GetRabbitMQChannel() *amqp.Channel
- func GetRabbitMQSubmissionsQueue() *amqp.Queue
- func GetValidator() *validator.Validate
- func ParseMicroserviceError(resp *http.Response, err error) error
- func ParseRFCEDate(date string) (time.Time, error)
- func ValidateMultipartFileHeader(multipartHeader *multipart.FileHeader) error
- func WithAuthenticationMiddleware() gin.HandlerFunc
- func WithAuthorizationMiddleware(role []string) gin.HandlerFunc
- func WithServerSentEventsMiddleware() gin.HandlerFunc
- type Claims
- type EnvironmentSpec
- type JwtTokenHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClosePostgresConnection ¶
func ClosePostgresConnection()
func CloseRabbitMQConnection ¶ added in v0.41.0
func CloseRabbitMQConnection()
func ConnectToRabbitMQ ¶ added in v0.41.0
func ConnectToRabbitMQ()
func ErrorHandlerMiddleware ¶
func ErrorHandlerMiddleware() gin.HandlerFunc
func GetMultipartFormBufferFromFile ¶ added in v0.41.0
func GetPostgresConnection ¶
func GetRabbitMQChannel ¶ added in v0.41.0
func GetRabbitMQSubmissionsQueue ¶ added in v0.41.0
func GetValidator ¶
func GetValidator() *validator.Validate
func ParseMicroserviceError ¶ added in v0.35.0
ParseMicroserviceError parses the error returned by the archives microservice
func ParseRFCEDate ¶ added in v0.53.3
ParseRFCEDate parses a date in RFC3339 format
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
func WithServerSentEventsMiddleware ¶ added in v0.42.0
func WithServerSentEventsMiddleware() gin.HandlerFunc
Types ¶
type EnvironmentSpec ¶ added in v0.5.1
type EnvironmentSpec struct { // Execution environment ExecEnvironment string `split_words:"true" default:"development"` IsInProduction bool `split_words:"true" default:"false"` // Connection strings DbConnectionString string `split_words:"true" default:"postgres://postgres:postgres@localhost:5432/codelabs?sslmode=disable"` RabbitMQConnectionString string `split_words:"true" default:"amqp://rabbitmq:rabbitmq@localhost:5672/"` 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.