Documentation
¶
Index ¶
- func NewLogger(cfg LoggerConfig) *slog.Logger
- func NewRedisClient(cfg RedisConfig) *redis.Client
- func NewS3Client(cfg S3Config) (*s3.S3, error)
- func NewServer(cfg ServerConfig) (*fiber.App, error)
- func RedisHealthCheck(ctx context.Context, client *redis.Client) error
- func RunWithGracefulShutdown(cfg RabbitmqConfig) error
- func S3HealthCheck(ctx context.Context, client *s3.S3, bucketName string) error
- type ChatRoomConfig
- type DatabaseConfig
- type GoogleAppConfig
- type JwtConfig
- type Logger
- type LoggerConfig
- type Rabbitmq
- type RabbitmqConfig
- type RedisConfig
- type S3Config
- type ServerConfig
- type TxDB
- func (t *TxDB) Drop(ctx context.Context) error
- func (t *TxDB) GetDB(ctx context.Context) bun.IDB
- func (t *TxDB) Migrate(ctx context.Context) error
- func (t *TxDB) RegisterModel(models ...interface{})
- func (t *TxDB) RunInTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- func (tx *TxDB) Seed()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
func NewLogger(cfg LoggerConfig) *slog.Logger
func NewRedisClient ¶
func NewRedisClient(cfg RedisConfig) *redis.Client
func NewS3Client ¶
NewS3Client creates a new S3 client using the provided configuration.
func RunWithGracefulShutdown ¶
func RunWithGracefulShutdown(cfg RabbitmqConfig) error
RunWithGracefulShutdown runs the application with RabbitMQ and handles graceful shutdown
Types ¶
type ChatRoomConfig ¶
type DatabaseConfig ¶
type GoogleAppConfig ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
DebugContext(ctx context.Context, msg string, args ...any)
Error(msg string, args ...any)
ErrorContext(ctx context.Context, msg string, args ...any)
Info(msg string, args ...any)
InfoContext(ctx context.Context, msg string, args ...any)
Warn(msg string, args ...any)
WarnContext(ctx context.Context, msg string, args ...any)
}
type LoggerConfig ¶
type Rabbitmq ¶
type Rabbitmq struct {
Conn *amqp.Connection
Channel *amqp.Channel
}
func NewRabbitmqClient ¶
func NewRabbitmqClient(cfg RabbitmqConfig) (*Rabbitmq, error)
NewRabbitmqClient initializes a RabbitMQ client with proper error handling
type RabbitmqConfig ¶
type RedisConfig ¶
type S3Config ¶
type S3Config struct {
AccessKey string
SecretKey string
Region string
BucketName string
Endpoint string
RoomsImageFolder string
RoomImageMaxUploadSize int64
MaxUploadSize int64
PreSignedExpireMin int
}
S3Config holds the configuration for the S3 client.
type ServerConfig ¶
type TxDB ¶
type TxDB struct {
// contains filtered or unexported fields
}
func NewDBWithTX ¶
func NewDBWithTX(cfg DatabaseConfig) (*TxDB, func(), error)
func (*TxDB) RegisterModel ¶
func (t *TxDB) RegisterModel(models ...interface{})
func (*TxDB) RunInTransaction ¶
Click to show internal directories.
Click to hide internal directories.