Documentation
¶
Index ¶
- Constants
- Variables
- func BuildQuery(conds Conds) (sql string, binds []interface{})
- func DefaultConfig() *config
- type Association
- type Authentication
- type Component
- type Cond
- type Conds
- type Container
- type DB
- type Dialector
- type Field
- type Handler
- type Interceptor
- type Logger
- type Model
- type NamingStrategy
- type Option
- type Processor
- type TLSConfig
Constants ¶
View Source
const PackageName = "component.egorm"
PackageName ...
Variables ¶
View Source
var ( // ErrRecordNotFound returns a "record not found error". Occurs only when attempting to query the database with a struct; querying with a slice won't return this error ErrRecordNotFound = gorm.ErrRecordNotFound )
Functions ¶
func BuildQuery ¶
BuildQuery 根据conds构建sql和绑定的参数
Types ¶
type Authentication ¶ added in v1.0.6
type Authentication struct { // TLS authentication TLS *TLSConfig }
func (*Authentication) TLSConfig ¶ added in v1.0.6
func (config *Authentication) TLSConfig() *tls.Config
type Cond ¶
type Cond struct { // Connector MySQL中查询条件连接符,如and,or,默认为and Connector string // Op MySQL中查询条件,如like,=,in Op string // Val 查询条件对应的值 Val interface{} }
Cond 为字段查询结构体
type Conds ¶
type Conds map[string]interface{}
Conds 为Cond类型map,用于定义Where方法参数 map[field.name]interface{}
type Interceptor ¶
type Interceptor func(string, *manager.DSN, string, *config, *elog.Component) func(next Handler) Handler
Interceptor ...
type Option ¶
type Option func(c *Container)
Option 可选项
func WithDSNParser ¶
WithDSNParser 设置自定义dsnParser
func WithNamingStrategy ¶ added in v1.1.1
type Processor ¶
type Processor interface { Get(name string) func(*gorm.DB) Replace(name string, handler func(*gorm.DB)) error }
Processor ...
type TLSConfig ¶ added in v1.0.6
type TLSConfig struct { // Enable TLS Enabled bool // Path to the CA cert. For a client this verifies the server certificate. CAFile string // Path to the TLS cert to use for TLS required connections. (optional) CertFile string // Path to the TLS key to use for TLS required connections. (optional) KeyFile string // InsecureSkipVerify will enable TLS but not verify the certificate InsecureSkipVerify bool // MinVersion sets the minimum TLS version that is acceptable. // If not set, TLS 1.2 will be used. (optional) MinVersion string // MaxVersion sets the maximum TLS version that is acceptable. // If not set, refer to crypto/tls for defaults. (optional) MaxVersion string }
TLSConfig is the interface used to configure a tcp client or server from a `Config`
Source Files
¶
Click to show internal directories.
Click to hide internal directories.