common

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHeaders

func AuthHeaders(apiKey string) map[string]string

func Counter

func Counter(desc *prometheus.Desc, value float64, labels ...string) prometheus.Metric

func DatabaseTLSConfig added in v1.9.0

func DatabaseTLSConfig(creds TLSCredentials, insecureSkipVerify bool) (*tls.Config, error)

func Desc

func Desc(name, help string, labels ...string) *prometheus.Desc

func Gauge

func Gauge(desc *prometheus.Desc, value float64, labels ...string) prometheus.Metric

func NewLoggerProvider added in v1.11.1

func NewLoggerProvider(serviceName string, resourceAttrs ...attribute.KeyValue) (*sdk.LoggerProvider, error)

func SetAuthHeaders

func SetAuthHeaders(r *http.Request, apiKey string)

func ShutdownLogs added in v1.11.1

func ShutdownLogs(ctx context.Context) error

func SplitHostPort added in v1.3.0

func SplitHostPort(addr string) (host string, port int, err error)

func TlsConfig added in v1.6.4

func TlsConfig() *tls.Config

func TopN added in v1.9.0

func TopN[T any](s []T, n int, less func(a, b T) bool) []T

func TopNMap added in v1.9.0

func TopNMap[K comparable, V any, S cmp.Ordered](m map[K]V, n int, val func(V) S) map[K]V

func TopNMapByValue added in v1.9.0

func TopNMapByValue[K comparable, V cmp.Ordered](m map[K]V, n int) map[K]V

Types

type Endpoint added in v1.11.2

type Endpoint struct {
	Host string
	Port string
}

type LogEmitter added in v1.11.2

type LogEmitter struct {
	// contains filtered or unexported fields
}

func NewLogEmitter added in v1.11.2

func NewLogEmitter(serviceName string) (*LogEmitter, error)

func (*LogEmitter) Callback added in v1.11.2

func (e *LogEmitter) Callback() logparser.OnMsgCallbackF

func (*LogEmitter) Stop added in v1.11.2

func (e *LogEmitter) Stop()

type TLSCredentials added in v1.9.0

type TLSCredentials struct {
	CA, Cert, Key string
}

Jump to

Keyboard shortcuts

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