util

package
v0.0.0-...-7478186 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrFail = 1
)

Variables

This section is empty.

Functions

func FormatFullTime

func FormatFullTime(t time.Time) string

func GetDomainFromHost

func GetDomainFromHost(host string) string

func GetErrorCode

func GetErrorCode(err error) int32

func GraceHttpServe

func GraceHttpServe(addr string, handler http.Handler) error

func HttpGet

func HttpGet(client *http.Client, url string, headers map[string]string, ret interface{}) error

func HttpPost

func HttpPost(client *http.Client, url string, headers map[string]string, params interface{}, ret interface{}) error

func HttpPostWithForm

func HttpPostWithForm(client *http.Client, url string, headers map[string]string, params map[string]string, ret interface{}) error

func IsHttpStatusSuccess

func IsHttpStatusSuccess(code int) bool

func NewErrorWithCode

func NewErrorWithCode(code int32, text string) error

func NewGinEngine

func NewGinEngine() *gin.Engine

func NewHttpClient

func NewHttpClient(skipSSLVerify bool) *http.Client

func NewHttpClientWithShortTimeout

func NewHttpClientWithShortTimeout(skipSSLVerify bool) *http.Client

func ParseConfig

func ParseConfig(defaultPath string, v interface{}) bool

func StringToInt64

func StringToInt64(s string, defaultVal int64) int64

Types

type RobotDingDing

type RobotDingDing struct {
	// contains filtered or unexported fields
}

func (*RobotDingDing) SendMsg

func (this *RobotDingDing) SendMsg(msg string) string

type RobotFeishu

type RobotFeishu struct {
	// contains filtered or unexported fields
}

func (*RobotFeishu) SendMsg

func (this *RobotFeishu) SendMsg(msg string) string

Jump to

Keyboard shortcuts

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