utils

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestIDKey requestID key
	RequestIDKey = "x-request-id"
	// UsernameKey username key
	UsernameKey = "x-username"
)

Variables

View Source
var Cols = []string{"", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}

Functions

func ConvertNumToChars added in v1.3.25

func ConvertNumToChars(num int) (string, error)

func GetHeaderFirst

func GetHeaderFirst(ctx context.Context, key string) string

GetHeaderFirst get header first value

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID request id from header

func GetUsername

func GetUsername(ctx context.Context) string

GetUsername get username from header

func HttpGet added in v1.4.11

func HttpGet(url string) ([]byte, error)

func HttpPost added in v1.4.11

func HttpPost(url, content string) ([]byte, error)

func NewRequestID

func NewRequestID() string

NewRequestID generate a RequestId

func WritePDF added in v1.4.1

func WritePDF(filename string, content interface{}) gofpdf.Pdf

func WriteXlsx added in v1.3.25

func WriteXlsx(sheet string, records interface{}) *excelize.File

WriteXlsx 填充excel

Types

This section is empty.

Jump to

Keyboard shortcuts

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