infrastructure

package
v0.0.0-...-dd5d962 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Code    int    `json:",omitempty"`
	Message string `json:"message"`
}

func AsAppError

func AsAppError(err error) *AppError

func NewAuthenticationError

func NewAuthenticationError(message string) *AppError

func NewAuthorizationError

func NewAuthorizationError(message string) *AppError

func NewNotFoundError

func NewNotFoundError(message string) *AppError

func NewUnexpectedError

func NewUnexpectedError(message string) *AppError

func NewValidationError

func NewValidationError(message string) *AppError

type DbConfig

type DbConfig struct {
	DbType       string `mapstructure:"db_type" json:"db_type" yaml:"db_type"`
	Host         string `mapstructure:"host" json:"host" yaml:"host"`
	Port         string `mapstructure:"port" json:"port" yaml:"port"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	DbName       string `mapstructure:"dbname" json:"dbname" yaml:"dbname"`
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	MaxIdleConns int    `mapstructure:"max_idle_connections" json:"max_idle_connections" yaml:"max_idle_connections"`
	MaxOpenConns int    `mapstructure:"max_open_connections" json:"max_open_connections" yaml:"max_open_connections"`
}

type DbContext

type DbContext interface {
	DSN() string
	GetDb() *gorm.DB
}

type Model

type Model struct {
	Id          string `gorm:"primaryKey" json:"id"`
	Create_Time int64  `gorm:"autoCreateTime:nano" json:"create_time"`
	Update_Time int64  `gorm:"autoUpdateTime:nano" json:"update_time"`
}

Jump to

Keyboard shortcuts

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