std

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeDownload = `application/force-download` //文件下载

	ContentTypeDefault = `text/plain; charset=UTF-8`              //文本
	ContentTypeJSON    = `application/json; charset=UTF-8`        //json
	ContentTypeHTML    = `text/html; charset=UTF-8`               //HTML
	ContentTypeXJS     = `application/x-javascript;charset=UTF-8` //JavaScript
	ContentTypeJS      = `text/javascript; charset=utf-8`         //JavaScript
	ContentTypeCSS     = `text/css; charset=utf-8`                //CSS

	ContentTypeImageJPEG = `image/jpeg`   //jpeg图片
	ContentTypeImageJPG  = `image/jpeg`   //jpg图片
	ContentTypeImagePNG  = `image/png`    //png图片
	ContentTypeImageWEBP = `image/webp`   //webp图片
	ContentTypeImageGIF  = `image/gif`    //gif图片
	ContentTypeImageICON = `image/x-icon` //icon图标

	ContentTypeImageOctetStream = `application/octet-stream` //八位字节流
)

Variables

This section is empty.

Functions

func BitAutoString added in v0.0.24

func BitAutoString(size int64) string

BitAutoString 将字节自动输出成合适的单位内容。

func FileName

func FileName(filename string) string

FileName 将文件名转为合法的文件名

func NumberToChineseCapital added in v0.0.24

func NumberToChineseCapital(number int64) string

NumberToChineseCapital 数字转成中文大写数字

func PhoneAddAreaCode added in v0.0.10

func PhoneAddAreaCode(phone string, countryCode string) string

PhoneAddAreaCode 给号码添加上+号和区号

func PhoneKeepNumbersOnly added in v0.0.10

func PhoneKeepNumbersOnly(phone string) string

PhoneKeepNumbersOnly 只保留下数字

func PhoneRemoveAreaCode added in v0.0.10

func PhoneRemoveAreaCode(phone string, countryCode string) string

PhoneRemoveAreaCode 移除号码前面的+号和区号

Types

type Countries added in v0.0.10

type Countries struct {
	Code     string `json:"code"`
	AreaCode string `json:"area_code"`
	Name     string `json:"name"`
}

func GetCountryInfo added in v0.0.10

func GetCountryInfo(countryCode string) (Countries, error)

GetCountryInfo 获取指定国家或地区的区号及名称-根据国家或地区代码

type ListParams added in v0.0.23

type ListParams struct {
	ID   uint `json:"id"`
	Page int  `json:"page" validate:"required,min=1"`
	Size int  `json:"size" validate:"required,min=1,max=10000"`
}

type Resp added in v0.0.23

type Resp struct {
	Code int      `json:"code"`
	Msg  string   `json:"msg"`
	Data RespData `json:"data"`
}

func NewResp added in v0.0.23

func NewResp(code int, msg string, data any, other any) Resp

func (Resp) String added in v0.0.23

func (r Resp) String() string

type RespData added in v0.0.23

type RespData struct {
	Data  any `json:"data"`
	Other any `json:"other"`
}

Jump to

Keyboard shortcuts

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