helper

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressGzip added in v0.9.6

func CompressGzip(f string) string

func Concat

func Concat(splitcode string, args ...string) string

func CounterZeroNumber added in v0.3.6

func CounterZeroNumber(length int) string

func Decrypt

func Decrypt(ciphertext string) string

func Encrypt

func Encrypt(plaintext string) string

func Get added in v0.1.7

func Get(url string, headers map[string]string, transport PHttp) ([]byte, string, int, string, error)

@return param : respBody, response.Status, response.StatusCode, strlog, err

func GetCurrentTime added in v0.9.6

func GetCurrentTime(loc *time.Location, val string) time.Time

func GetFormatTime

func GetFormatTime(loc *time.Location, layout string) string

func GetIpAddress

func GetIpAddress(c *fiber.Ctx) string

func GetTomorrow added in v0.9.6

func GetTomorrow(loc *time.Location, day time.Duration, layout string) time.Time

func GetTrxID added in v0.9.6

func GetTrxID(loc *time.Location) string

func GetUniqId

func GetUniqId(loc *time.Location) string

func GetYesterday added in v0.9.6

func GetYesterday(loc *time.Location, day time.Duration, layout string) time.Time

func HttpClient added in v0.1.7

func HttpClient(p PHttp) *http.Client

HttpClient (time.Duration, time.Duration, bool)

func HttpDial added in v0.1.7

func HttpDial(url string, t time.Duration) error

HttpDial (string)

func HttpDial2 added in v0.1.7

func HttpDial2(url string, t time.Duration) bool

func MakeLogger

func MakeLogger(s Setup) *logrus.Logger

func Post added in v0.1.7

func Post(url string, headers map[string]string, body []byte, transport PHttp) ([]byte, string, int, string, error)

@return param : respBody, response.Status, response.StatusCode, strlog, err

func ReduceWords added in v0.3.6

func ReduceWords(words string, start int, length int) string

func SigHandler

func SigHandler(obj SigCH)

func Throw added in v1.3.90

func Throw(up Exception)

Types

type Block added in v1.3.90

type Block struct {
	Try     func()
	Catch   func(Exception)
	Finally func()
}

func (Block) Do added in v1.3.90

func (tcf Block) Do()

type Exception added in v1.3.90

type Exception interface{}

type MyFormatter

type MyFormatter struct{}

func (*MyFormatter) Format

func (mf *MyFormatter) Format(entry *logrus.Entry) ([]byte, error)

type PHttp added in v0.1.7

type PHttp struct {
	DialTimeout        time.Duration
	Timeout            time.Duration
	KeepAlive          time.Duration
	IsDisableKeepAlive bool
	MaxIdleConns       int
	IdleConnTimeout    time.Duration
	DisableCompression bool
}

type Setup added in v0.1.1

type Setup struct {
	Env     string
	Logname string
	Display bool
	Level   string
}

type SigCH

type SigCH struct {
	Logs    *logrus.Logger
	Sigch   chan os.Signal
	Forever chan bool
	DB      *gorm.DB
	Rabbit  rmqp.AMQP
}

Jump to

Keyboard shortcuts

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