common

package
v0.0.0-...-45c2553 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SUCCESS = "success"

Variables

View Source
var (
	Instance = container.New()
)

Functions

func GetDBConnect

func GetDBConnect() *sqlx.DB

*** Get common object from container **

func GetUUID

func GetUUID() string

** Get uuid **

func PrintSlice

func PrintSlice[T any](s []T)

*** Print slice support any data type **

Types

type Config

type Config struct {
	Port        int
	Ip          string
	ImgrateMode string //up and down
}

*** Config struct ***

func GetConfig

func GetConfig() Config

type DBHelper

type DBHelper interface {
	GetConnect() *sqlx.DB
}

*** DBHelper interface, manipulate database table ***

type DBModelHelper

type DBModelHelper struct {
	DB *sqlx.DB
}

*** DBModelHelper as a DBHelper instance. share the instance in container (IoC) by DBHelper interface ***

func (*DBModelHelper) GetConnect

func (model *DBModelHelper) GetConnect() *sqlx.DB

*** GetConnect return current connect Public function ***

type ImgrateHelper

type ImgrateHelper struct {
}

func (*ImgrateHelper) Start

func (imgrateHelper *ImgrateHelper) Start()

Jump to

Keyboard shortcuts

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