util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonContentType = "application/json"
	FormContentType = "application/x-www-form-urlencoded"
)

Variables

View Source
var HttpClient = &http.Client{}

HttpClient client

View Source
var WebhookContentTypeList = []string{JsonContentType, FormContentType}

Functions

func GetExecRootDir

func GetExecRootDir() string

func NewLogRotate

func NewLogRotate(filename string, maxSize, maxBackups int) zerolog.Logger

func NewMultiLevelWriter

func NewMultiLevelWriter(writer ...io.Writer) zerolog.Logger

func NewRotate

func NewRotate(filename string, maxSize, maxBackups int) io.Writer

func ValidateContentType

func ValidateContentType(contentType string) bool

Types

type Logger

type Logger struct {
	Driver zerolog.Logger
	Rotate *lumberjack.Logger
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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