initialize

package
v0.0.0-...-3a65944 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Define a counter metric
	RequestCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "myapp_requests_total",
			Help: "Total number of requests processed by the MyApp web server.",
		},
		[]string{"method", "path", "status"},
	)

	ErrorCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "myapp_requests_errors_total",
			Help: "Total number of error requests processed by the MyApp web server.",
		},
		[]string{"method", "path", "status"},
	)

	// Define a histogram metric
	RequestDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_request_duration_seconds",
			Help:    "Histogram of response time for handler in seconds",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"method", "path"},
	)

	// Request size in bytes
	RequestSizeBytes = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_request_size_bytes",
			Help:    "Size of HTTP requests in bytes",
			Buckets: prometheus.ExponentialBuckets(100, 10, 6),
		},
		[]string{"method", "path"},
	)

	// Response size in bytes
	ResponseSizeBytes = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_response_size_bytes",
			Help:    "Size of HTTP responses in bytes",
			Buckets: prometheus.ExponentialBuckets(100, 10, 6),
		},
		[]string{"method", "path"},
	)
)
View Source
var KafkaProducer *kafka.Writer

Ininitialize kafka producer

Functions

func CloseKafka

func CloseKafka()

close kafka producer

func InitCronJob

func InitCronJob()

func InitKafka

func InitKafka()

Initial kafka

func InitLogger

func InitLogger()

Initial Logger

func InitLogstash

func InitLogstash()

init logstash

func InitMongo

func InitMongo()

init mongo

func InitMysql

func InitMysql()

Initial my sql

func InitMysqlC

func InitMysqlC()

Initial my sql

func InitPrometheus

func InitPrometheus()

handle initialize global variables

func InitRabbitMQ

func InitRabbitMQ()

func InitRabbitMQExchangeChannel

func InitRabbitMQExchangeChannel()

init rabbitmq exchange channel handle logging to discord

func InitRedis

func InitRedis()

Initial redis

func InitRedisSentinel

func InitRedisSentinel()

init redis sentinel

func InitRouter

func InitRouter() *gin.Engine

Initial router

func InitServiceInterface

func InitServiceInterface()

initialize services

func LoadConfig

func LoadConfig()

func load configuration with viper

func MigrateTables

func MigrateTables()

migrate tables

func MigrateTablesC

func MigrateTablesC()

migrate tables

func RegisterMetrics

func RegisterMetrics()

handle register metric collection

func Run

func Run() *gin.Engine

Run all initialization

func SetPool

func SetPool()

InitMysql().SetPool()

func SetPoolC

func SetPoolC()

InitMysql().SetPool()

Types

This section is empty.

Jump to

Keyboard shortcuts

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