Documentation ¶
Index ¶
- func NewLogAdapter(l kitlog.Logger, slowThreshold time.Duration, tracer trace.Tracer) logger.Interface
- func WithConnContext[T ConnType](ctx context.Context, conn T) context.Context
- type Client
- type ConnType
- type DBOptions
- type MySQLClient
- type MySQLOptions
- type MySQLStatsCollector
- type Processor
- type SQLiteClient
- type SQLiteOptions
- type SessionClient
- type TLSOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogAdapter ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewGormSQLiteClient ¶
func NewGormSQLiteClient(ctx context.Context, options *SQLiteOptions) (clt *Client, err error)
func NewMySQLClient ¶
func NewMySQLClient(ctx context.Context, options MySQLOptions) (clt *Client, err error)
type MySQLClient ¶
type MySQLClient struct { *Client // contains filtered or unexported fields }
func (MySQLClient) MarshalJSON ¶
func (c MySQLClient) MarshalJSON() ([]byte, error)
func (MySQLClient) Options ¶
func (c MySQLClient) Options() MySQLOptions
func (*MySQLClient) SetOptions ¶
func (c *MySQLClient) SetOptions(o *MySQLOptions)
func (*MySQLClient) UnmarshalJSON ¶
func (c *MySQLClient) UnmarshalJSON(data []byte) (err error)
type MySQLOptions ¶
type MySQLOptions struct { Host string `json:"host,omitempty"` Username string `json:"username,omitempty"` Password safe.String `json:"password,omitempty"` Schema string `json:"schema,omitempty"` MaxIdle int32 `json:"max_idle,omitempty"` MaxIdleConnections int32 `json:"max_idle_connections,omitempty"` MaxOpenConnections int32 `json:"max_open_connections,omitempty"` MaxConnectionLifeTime *model.Duration `json:"max_connection_life_time,omitempty"` Charset string `json:"charset,omitempty"` Collation string `json:"collation,omitempty"` TablePrefix string `json:"table_prefix,omitempty"` SlowThreshold *model.Duration `json:"slow_threshold,omitempty"` TLSConfig *TLSOptions `json:"tls_config" yaml:"tls_config" mapstructure:"tls_config"` }
func NewMySQLOptions ¶
func NewMySQLOptions() *MySQLOptions
func (*MySQLOptions) GetConnectionString ¶ added in v1.1.12
func (x *MySQLOptions) GetConnectionString() string
func (*MySQLOptions) GetDBName ¶ added in v1.1.12
func (x *MySQLOptions) GetDBName() string
func (*MySQLOptions) GetPeer ¶ added in v1.1.12
func (x *MySQLOptions) GetPeer() (string, int)
func (*MySQLOptions) GetStdMaxConnectionLifeTime ¶
func (x *MySQLOptions) GetStdMaxConnectionLifeTime() time.Duration
func (*MySQLOptions) GetType ¶ added in v1.1.12
func (x *MySQLOptions) GetType() string
func (*MySQLOptions) GetUsername ¶ added in v1.1.12
func (x *MySQLOptions) GetUsername() string
type MySQLStatsCollector ¶ added in v1.2.0
type MySQLStatsCollector struct {
// contains filtered or unexported fields
}
func (*MySQLStatsCollector) Collect ¶ added in v1.2.0
func (m *MySQLStatsCollector) Collect(metrics chan<- prometheus.Metric)
func (*MySQLStatsCollector) Describe ¶ added in v1.2.0
func (m *MySQLStatsCollector) Describe(descs chan<- *prometheus.Desc)
type SQLiteClient ¶
type SQLiteClient struct { *Client // contains filtered or unexported fields }
func NewSQLiteClient ¶
func NewSQLiteClient(ctx context.Context, options *SQLiteOptions) (clt *SQLiteClient, err error)
func (SQLiteClient) MarshalJSON ¶
func (c SQLiteClient) MarshalJSON() ([]byte, error)
func (*SQLiteClient) UnmarshalJSON ¶
func (c *SQLiteClient) UnmarshalJSON(data []byte) (err error)
type SQLiteOptions ¶
type SQLiteOptions struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` TablePrefix string `protobuf:"bytes,2,opt,name=table_prefix,json=tablePrefix,proto3" json:"table_prefix,omitempty"` SlowThreshold *types.Duration `protobuf:"bytes,12,opt,name=slow_threshold,json=slowThreshold,proto3" json:"slow_threshold,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` //nolint:revive XXX_unrecognized []byte `json:"-"` //nolint:revive XXX_sizecache int32 `json:"-"` //nolint:revive }
func NewSQLiteOptions ¶
func NewSQLiteOptions() *SQLiteOptions
func (SQLiteOptions) GetConnectionString ¶ added in v1.1.12
func (o SQLiteOptions) GetConnectionString() string
func (SQLiteOptions) GetDBName ¶ added in v1.1.12
func (o SQLiteOptions) GetDBName() string
func (SQLiteOptions) GetPeer ¶ added in v1.1.12
func (o SQLiteOptions) GetPeer() (string, int)
func (SQLiteOptions) GetType ¶ added in v1.1.12
func (o SQLiteOptions) GetType() string
func (SQLiteOptions) GetUsername ¶ added in v1.1.12
func (o SQLiteOptions) GetUsername() string
type SessionClient ¶ added in v1.2.3
type TLSOptions ¶ added in v1.2.4
type TLSOptions struct {
// contains filtered or unexported fields
}
func (TLSOptions) MarshalJSON ¶ added in v1.2.4
func (o TLSOptions) MarshalJSON() ([]byte, error)
func (*TLSOptions) UnmarshalJSON ¶ added in v1.2.4
func (o *TLSOptions) UnmarshalJSON(data []byte) (err error)
Click to show internal directories.
Click to hide internal directories.