core

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogClient

func LogClient(res *resty.Response) string

This will return customize log message from client response

func SetupLog

func SetupLog() *logrus.Logger

func SetupMySql added in v1.1.0

func SetupMySql() *gorm.DB

func SetupNewrelicApp

func SetupNewrelicApp() *newrelic.Application

func SetupNewrelicFiber

func SetupNewrelicFiber(a *newrelic.Application) fibernewrelic.Config

func SetupResty

func SetupResty() *resty.Request

Types

type AppValidator

type AppValidator struct {
	Validator *validator.Validate
}

func SetupValidator

func SetupValidator() *AppValidator

func (*AppValidator) Validate

func (v *AppValidator) Validate(c *fiber.Ctx, payload any) (fields []ErrorField, err error)

type Cache added in v1.2.2

type Cache struct {
	Redis        *redis.Client
	RedisStorage *storeRedis.Storage
}

func SetupCache added in v1.2.2

func SetupCache() *Cache

type Core

type Core struct {
	Newrelic  *newrelic.Application
	Log       *logrus.Logger
	Cache     *Cache
	Client    *resty.Request
	Database  *Database
	Validator *AppValidator
}

func SetupCore

func SetupCore() *Core

type Database added in v1.1.0

type Database struct {
	Db *gorm.DB
}

func SetupDb added in v1.1.0

func SetupDb() *Database

type ErrorField

type ErrorField struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

type LogrusTextFormatter

type LogrusTextFormatter struct {
}

func (*LogrusTextFormatter) Format

func (f *LogrusTextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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