Documentation ¶
Index ¶
- Variables
- func ExternalIP() (string, error)
- func FailError(err error, format string, args ...interface{})
- func GetEnv(key string, defaultValue string) string
- func GetEnvAsBool(key string, defaultValue bool) bool
- func GetEnvAsInt(key string, defaultValue int) int
- func HealthHandler() http.HandlerFunc
- func RegisterService(service *ServiceConfig) error
- func SendMessageToTelegram(message string)
- type HealthCheck
- type MinIOConfig
- type PostgreSQLConfig
- type RabbitMQConfig
- type RedisConfig
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Head = newlinePrintfFunc(color.New(color.FgHiMagenta).Add(color.Bold).Add(color.Underline).PrintfFunc()) Out = newlinePrintfFunc(color.New(color.FgHiWhite).PrintfFunc()) Info = newlinePrintfFunc(color.New(color.FgCyan).PrintfFunc()) Warn = newlinePrintfFunc(color.New(color.FgHiYellow).Add(color.Bold).PrintfFunc()) Err = errorPrintfFunc(color.New(color.FgHiRed).Add(color.Bold).PrintfFunc()) Fatal = func(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) color.New(color.FgHiRed).Add(color.Bold).Add(color.BgBlack).Println(msg) os.Exit(1) } Ok = newlinePrintfFunc(color.New(color.FgHiGreen).PrintfFunc()) TELEGRAM_TOKEN string CHAT_ID string PYTHON_API_HOST string REGISTRY_HOST string )
Functions ¶
func ExternalIP ¶
func GetEnvAsBool ¶
It returns the value if found, otherwise the provided default value.
func GetEnvAsInt ¶
It returns the value if found, otherwise the provided default value.
func HealthHandler ¶
func HealthHandler() http.HandlerFunc
HealthHandler returns an HTTP handler function for the health check endpoint.
func RegisterService ¶
func RegisterService(service *ServiceConfig) error
func SendMessageToTelegram ¶
func SendMessageToTelegram(message string)
SendMessageToChat sends a message to the chat using the Python API.
Types ¶
type HealthCheck ¶
type MinIOConfig ¶
type MinIOConfig struct { Endpoint string AccessKeyID string SecretAccessKey string UseSSL bool TemplatesBucket string // Add bucket name to config }
Config holds the configuration for MinIO.
func LoadMinIOConfig ¶
func LoadMinIOConfig() *MinIOConfig
LoadConfig loads the configuration from environment variables.
type PostgreSQLConfig ¶
func LoadPostgreSQLConfig ¶
func LoadPostgreSQLConfig() *PostgreSQLConfig
LoadConfig loads the PostgreSQL database configuration from environment variables.
type RabbitMQConfig ¶
Config holds the configuration for RabbitMQ
func LoadRabbitMQConfig ¶
func LoadRabbitMQConfig() *RabbitMQConfig
LoadConfig loads the configuration from environment variables
type RedisConfig ¶
func LoadRedisConfig ¶
func LoadRedisConfig() *RedisConfig
LoadConfig loads the Redis configuration from environment variables.
type ServiceConfig ¶
type ServiceConfig struct { ID string `json:"id"` Name string `json:"name"` Address string `json:"address"` Port int `json:"port"` HealthCheck HealthCheck `json:"healthCheck"` }
func LoadServiceConfig ¶
func LoadServiceConfig(jsonData []byte) (*ServiceConfig, error)
Click to show internal directories.
Click to hide internal directories.