common

package
v0.0.0-...-c9de50d Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourcePrometheusMetricName           = "prometheus_metric_name"
	ResourcePrometheusLabelName            = "prometheus_label_name"
	ResourcePrometheusLabelValue           = "prometheus_label_value"
	ResourcePrometheusMetricAPPLabelLayout = "prometheus_metric_app_label_layout"
	ResourcePrometheusLabel                = "prometheus_label"
	ResourcePrometheusMetricTarget         = "prometheus_metric_target"
)
View Source
var (
	TargetLabelInstance = "instance"
	TargetLabelJob      = "job"
)

Functions

func AppendErrGroup

func AppendErrGroup(eg *errgroup.Group, f ErrFunc, args ...interface{})

func AppendErrGroupWithContext

func AppendErrGroupWithContext(ctx context.Context, eg *errgroup.Group, f ErrFunc, args ...interface{})

func ShardingInt

func ShardingInt(i int) uint32

现在使用此方法的地方,传参实际在 uint32 范围内,使用此方法是为了方便调用 concurrent 库

Types

type ErrFunc

type ErrFunc func(...interface{}) error

type ORG

type ORG struct {
	ID int       // org id
	DB *mysql.DB // org database connection
}

func NewORG

func NewORG(id int) (*ORG, error)

func (*ORG) GetDB

func (o *ORG) GetDB() *mysql.DB

func (*ORG) GetID

func (o *ORG) GetID() int

func (*ORG) Log

func (o *ORG) Log(format string) string

func (*ORG) Logf

func (o *ORG) Logf(format string, a ...any) string

Jump to

Keyboard shortcuts

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