gsr

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 2 Imported by: 0

README

gsr

Go Standard Recommendations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheCallback

type CacheCallback func(key string, obj any) error

type Cacher

type Cacher interface {
	Exists(ctx context.Context, key string) bool
	Get(ctx context.Context, key string, obj any) error
	Set(ctx context.Context, key string, value any, ttl time.Duration) error
	GetSet(ctx context.Context, key string, ttl time.Duration, obj any, funCallback CacheCallback) error
	Del(ctx context.Context, key string) error
	ExpiresAt(ctx context.Context, key string, expiresAt time.Time) error
	ExpiresIn(ctx context.Context, key string, ttl time.Duration) error
}

type Enver

type Enver interface {
	GetEnver
}

type GetEnver

type GetEnver interface {
	Get(key string, defaultValue any) any
	GetBool(key string, defaultValue bool) bool
	GetInt(key string, defaultValue int) int
	GetInt32(key string, defaultValue int32) int32
	GetInt64(key string, defaultValue int64) int64
	GetFloat64(key string, defaultValue float64) float64
	GetStringSlice(key string, defaultValue []string) []string
	GetString(key string, defaultValue string) string
	GetStringMapString(key string, defaultValue map[string]string) map[string]string
	GetStringMapStringSlice(key string, defaultValue map[string][]string) map[string][]string
	GetTime(key string, defaultValue time.Time) time.Time
}

type GetProvider

type GetProvider interface {
	Get(key string, defaultValue any) any
	GetBool(key string, defaultValue bool) bool
	GetInt(key string, defaultValue int) int
	GetInt32(key string, defaultValue int32) int32
	GetInt64(key string, defaultValue int64) int64
	GetFloat64(key string, defaultValue float64) float64
	GetStringSlice(key string, defaultValue []string) []string
	GetString(key string, defaultValue string) string
	GetStringMapString(key string, defaultValue map[string]string) map[string]string
	GetStringMapStringSlice(key string, defaultValue map[string][]string) map[string][]string
	GetTime(key string, defaultValue time.Time) time.Time
}

type Logger

type Logger interface {
	Debug(format string, args ...LoggerField)
	Info(format string, args ...LoggerField)
	Notice(format string, args ...LoggerField)
	Error(format string, args ...LoggerField)
	Warn(format string, args ...LoggerField)
	Fatal(format string, args ...LoggerField)
}

type LoggerField

type LoggerField interface {
	GetKey() string
	GetValue() any
}

type Provider

type Provider interface {
	GetProvider
	SetProvider
}

type SetProvider

type SetProvider interface {
	Set(key string, value any)
}

Jump to

Keyboard shortcuts

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