Documentation
¶
Index ¶
- Variables
- func NewCDN(config CDNConfig) *s3.S3
- func NewDB(config DatabaseConfig) (*sqlx.DB, error)
- func NewMQ(conf MQConfig) (*amqp.Connection, error)
- func Transact(db *sqlx.DB, txFunc func(*sqlx.Tx) error) (err error)
- type AccessClaims
- type Accesser
- type CDNConfig
- type Config
- type DatabaseConfig
- type MQConfig
- type Mail
- type MailConfig
- type Mailer
- type Permission
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoToken = errors.New("token not found") ErrInvalidToken = errors.New("invalid token") )
Functions ¶
func NewDB ¶ added in v0.7.0
func NewDB(config DatabaseConfig) (*sqlx.DB, error)
NewDB Initialises the connection to the database
Types ¶
type AccessClaims ¶ added in v0.8.0
type AccessClaims struct {
UserID int `json:"id"`
Permissions []string `json:"perms"`
jwt.StandardClaims
}
AccessClaims represents an identifiable JWT
type Accesser ¶ added in v0.8.0
type Accesser struct {
// contains filtered or unexported fields
}
func NewAccesser ¶ added in v0.8.0
NewAccesser allows the validation of web-auth JWT tokens both as headers and as cookies
func (*Accesser) AuthMiddleware ¶ added in v0.8.0
func (a *Accesser) AuthMiddleware(next echo.HandlerFunc) echo.HandlerFunc
AuthMiddleware checks a HTTP request for a valid token either in the header or cookie
type CDNConfig ¶ added in v0.7.0
CDNConfig represents a configuration to connect to a CDN / S3 instance
type DatabaseConfig ¶ added in v0.7.0
type DatabaseConfig struct {
Host string
Port string
SSLMode string
Name string
Username string
Password string
}
DatabaseConfig represents a configuration to connect to an SQL database
type Mail ¶ added in v0.7.0
type Mail struct {
Subject string
To string
Cc []string
Bcc []string
From string
// contains filtered or unexported fields
}
Mail represents an email to be sent
type MailConfig ¶ added in v0.7.0
MailConfig represents a configuration to connect to an SMTP server
type Mailer ¶ added in v0.7.0
type Mailer struct {
*mail.SMTPClient
Enabled bool
}
Mailer encapsulates the dependency
func NewMailer ¶ added in v0.7.0
func NewMailer(config MailConfig) (*Mailer, error)
NewMailer creates a new SMTP client
type Permission ¶ added in v0.7.0
type Permission struct {
Name string `json:"name"`
}
Permission represents the permissions that a user has
Click to show internal directories.
Click to hide internal directories.