common

package
v0.0.0-...-80d1ce1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(pass string) string

func IsAdminOrModerator

func IsAdminOrModerator(c echo.Context) bool

func OnlyAdminOrModerators

func OnlyAdminOrModerators(next echo.HandlerFunc) echo.HandlerFunc

func RandomString

func RandomString(n int) (string, error)

Types

type CustomValidator

type CustomValidator struct {
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator() *CustomValidator

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

type ErrorJson

type ErrorJson struct {
	Message     string `json:"message"`
	ErrorSystem string `json:"error"`
}

func NewErrorJson

func NewErrorJson(msg string, err error) *ErrorJson

func (*ErrorJson) Error

func (e *ErrorJson) Error() string

type ISmtpService

type ISmtpService interface {
	SendEmail(subject string, to []string, msg []byte) error
}

type JwtAuthenticationClaims

type JwtAuthenticationClaims struct {
	MemberID int32  `json:"memberId"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	jwt.RegisteredClaims
}

func NewJwtAuthentication

func NewJwtAuthentication(memberID int32, name, role string, dur time.Duration) *JwtAuthenticationClaims

type ListValidatorErrorJson

type ListValidatorErrorJson []ValidatorErrorJson

func (*ListValidatorErrorJson) Error

func (e *ListValidatorErrorJson) Error() string

type SmtpService

type SmtpService struct {
	// contains filtered or unexported fields
}

func NewSmtpService

func NewSmtpService(from, username, password, smtpHost string, smtpPort int) *SmtpService

func (*SmtpService) SendEmail

func (s *SmtpService) SendEmail(subject string, to []string, msg []byte) error

type ValidatorErrorJson

type ValidatorErrorJson struct {
	Field   string
	Type    string
	Message string
}

Jump to

Keyboard shortcuts

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