core

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 29 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

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

type Cache struct {
	Redis  *redis.Client
	Memory *memory.Cache
}

func SetupCache

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

type Database struct {
	Db *gorm.DB
}

func SetupDb

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