Documentation ¶
Index ¶
- Constants
- Variables
- type AutoPProfOpt
- type Conn
- func (conn *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (conn *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
- func (conn *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (conn *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- type Driver
- type DriverTx
- type GrpcClient
- type GrpcServer
- type HTTPServer
- type Hooks
- type InfraOption
- func WithAutoPProf(autoPProfOpts *AutoPProfOpt, opts ...holmes.Option) InfraOption
- func WithEnableAPM(otelEndpoint, logPathPrefix string, maxLogCnt uint) InfraOption
- func WithMetric(collectors ...prometheus.Collector) InfraOption
- func WithMySQL(url string) InfraOption
- func WithRedis(url string) InfraOption
- type Status
- type Stmt
Constants ¶
View Source
const ( MetricTypeHTTP = "http" MetricTypeGRPC = "grpc" LibraryTypeMySQL = "mysql" LibraryTypeRedis = "redis" )
Variables ¶
View Source
var DBUtils = &dbUtils{}
View Source
var EndPoint = &endPoint{ stop: make(chan struct{}, 1), }
View Source
var HttpStatus = httpStatus{}
View Source
var Infra = &infra{}
View Source
var Logger = &logger{}
View Source
var ( MetricsReg = newCustomMetricRegistry(map[string]string{ "host": internal.BuildInfo.Hostname(), "app": internal.BuildInfo.AppName(), }) )
View Source
var RedisLimiter = &redisLimit{}
View Source
var SQLParser = &sqlParser{}
View Source
var Tracer trace.Tracer
Functions ¶
This section is empty.
Types ¶
type AutoPProfOpt ¶
type Conn ¶
func (*Conn) BeginTx ¶
BeginTx starts and returns a new transaction. If the context is canceled by the user the sql package will call Tx.Rollback before discarding and closing the connection.
This must check opts.Isolation to determine if there is a set isolation level. If the driver does not support a non-default level and one is set or if there is a non-default isolation level that is not supported, an error must be returned.
This must also check opts.ReadOnly to determine if the read-only value is true to either set the read-only transaction property if supported or return an error if it is not supported.
func (*Conn) ExecContext ¶
func (conn *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
nolint:dupl
func (*Conn) PrepareContext ¶
type GrpcClient ¶
type GrpcClient struct {
*grpc.ClientConn
}
func NewGrpcClient ¶
func NewGrpcClient(addr, server string) *GrpcClient
type GrpcServer ¶
func NewGrpcServer ¶
func NewGrpcServer(addr string) *GrpcServer
func (*GrpcServer) Close ¶
func (s *GrpcServer) Close()
func (*GrpcServer) Start ¶
func (s *GrpcServer) Start()
type HTTPServer ¶
func NewHTTPServer ¶
func NewHTTPServer(addr string) *HTTPServer
func (*HTTPServer) Close ¶
func (s *HTTPServer) Close()
func (*HTTPServer) HandleFunc ¶
func (s *HTTPServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start()
func (*HTTPServer) Stop ¶
func (s *HTTPServer) Stop()
type InfraOption ¶
type InfraOption func(i *infra)
func WithAutoPProf ¶
func WithAutoPProf(autoPProfOpts *AutoPProfOpt, opts ...holmes.Option) InfraOption
func WithEnableAPM ¶
func WithEnableAPM(otelEndpoint, logPathPrefix string, maxLogCnt uint) InfraOption
func WithMetric ¶
func WithMetric(collectors ...prometheus.Collector) InfraOption
func WithMySQL ¶
func WithMySQL(url string) InfraOption
func WithRedis ¶
func WithRedis(url string) InfraOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.