Compare commits

...

1 Commits

6 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -15,10 +15,10 @@ type CacheConfig struct {
Logger *libpack_logger.Logger
Client CacheClient
Redis struct {
Enable bool `json:"enable"`
URL string `json:"url"`
Password string `json:"password"`
DB int `json:"db"`
Enable bool `json:"enable"`
}
TTL int `json:"ttl"`
}
+3 -3
View File
@@ -11,10 +11,10 @@ import (
)
type RedisConfig struct {
client *redis.Client
ctx context.Context
prefix string
client *redis.Client
builderPool *sync.Pool
prefix string
}
func (c *RedisConfig) prependKeyName(key string) string {
@@ -29,8 +29,8 @@ func (c *RedisConfig) prependKeyName(key string) string {
type RedisClientConfig struct {
RedisServer string
RedisPassword string
RedisDB int
Prefix string
RedisDB int
}
func New(redisClientConfig *RedisClientConfig) *RedisConfig {
+3 -3
View File
@@ -42,16 +42,16 @@ const (
var defaultOutput = os.Stdout
type Logger struct {
output io.Writer
format string
minLogLevel int
showCaller bool
output io.Writer
}
type LogMessage struct {
Message string
Pairs map[string]any
output io.Writer
Pairs map[string]any
Message string
}
func (m *LogMessage) String() string {
+3 -3
View File
@@ -59,13 +59,13 @@ func (suite *LoggerTestSuite) Test_LogsLevelsPrint() {
logger := New().SetOutput(output)
tests := []struct {
pairs map[string]any
name string
method string
message string
loggerMinLevel int
messageLogLevel int
message string
pairs map[string]any
wantOutput bool // Whether we expect output to be written
wantOutput bool
}{
{
name: "Log: Debug, Level: Debug - no pairs",
+1 -1
View File
@@ -14,8 +14,8 @@ import (
// Cache for sorted label keys to avoid repeated sorting
var sortedLabelKeysCache = struct {
sync.RWMutex
m map[string][]string
sync.RWMutex
}{m: make(map[string][]string)}
func (ms *MetricsSetup) get_metrics_name(name string, labels map[string]string) string {
+1 -1
View File
@@ -167,9 +167,9 @@ func TestEnsureDefaultLabels(t *testing.T) {
libpack_config.PKG_NAME = "example_microservice"
tests := []struct {
name string
inputLabels map[string]string
expectedLabels map[string]string
name string
}{
{
name: "Nil labels",