stringutils

package
v1.4.120 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MulanPSL-2.0 Imports: 22 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool2Str

func Bool2Str(b bool) string

func BoolPtr2Str

func BoolPtr2Str(b *bool) string

func Camel2Case

func Camel2Case(name string) string

func Capitalize

func Capitalize(str string) string

func Case2Camel

func Case2Camel(name string) string

下划线写法转为驼峰写法

func CheckQueryParamUsing

func CheckQueryParamUsing(param *interface{}) (ok bool)

func Int64ToLocalDateInt

func Int64ToLocalDateInt(sec int64) basemodel.LocalDateInt

func Int64ToLocalDateIntPtr

func Int64ToLocalDateIntPtr(sec int64) *basemodel.LocalDateInt

func Int64ToLocalTimeInt

func Int64ToLocalTimeInt(sec int64) basemodel.LocalTimeInt

func Int64ToLocalTimeIntPtr

func Int64ToLocalTimeIntPtr(sec int64) *basemodel.LocalTimeInt

func Int64ToLocalTimeIntUtcPtr

func Int64ToLocalTimeIntUtcPtr(sec int64) *basemodel.LocalTimeUTCInt

func Int64ToLocalTimeUtcInt

func Int64ToLocalTimeUtcInt(sec int64) basemodel.LocalTimeUTCInt

func Inttime2Str

func Inttime2Str(timestamp int64) string

func Ip4

func Ip4() string

LocalTimeInt

func Lcfirst

func Lcfirst(str string) string

首字母小写

func LcfirstCase2Camel added in v1.0.11

func LcfirstCase2Camel(str string) string

func List2string

func List2string(lst *list.List) string

func List2stringBy

func List2stringBy(lst *list.List, sep string) string

func LogList

func LogList(lst *list.List)

func ParseTemplateString

func ParseTemplateString(str string, vars interface{}) string

func PrintList

func PrintList(lst *list.List)

func RandomString

func RandomString(n int) string

func SendEmailNotice

func SendEmailNotice(ctx context.Context, receivers, subject, msg string) error

func Str2BoolPtr

func Str2BoolPtr(s string) *bool

func Str2Float64

func Str2Float64(in string) float64

func Str2Int

func Str2Int(in string) int

func Str2Int32 added in v1.0.13

func Str2Int32(in string) int32

func Str2Int64

func Str2Int64(in string) int64

func Strtime2Int

func Strtime2Int(datetime string) (timestamp int64)

func Strtime2Time

func Strtime2Time(datetime string) time.Time

func ToStringWith

func ToStringWith(in any) (str string)

func Ucfirst

func Ucfirst(str string) string

首字母大写

func UcfirstCase2Camel

func UcfirstCase2Camel(str string) string

func UnzipStr

func UnzipStr(zipContent string) (originInfo []byte)

func ZipStr

func ZipStr(origin string) (content string)

Types

type Buffer

type Buffer struct {
	*bytes.Buffer
}

内嵌bytes.Buffer,支持连写

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(i interface{}) *Buffer

type Client

type Client struct {
	// contains filtered or unexported fields
}
var (
	DefaultEmailHelper *Client
)

func NewClient

func NewClient(user, pwd, host, port string) *Client

func (*Client) SendEmail

func (e *Client) SendEmail(req *SendRequest) error

type Config

type Config struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     string `json:"port"`
}

type SendRequest

type SendRequest struct {
	Receivers []string `json:"receivers"`
	Subject   string   `json:"subject"`
	Message   string   `json:"message"`
}

type UnixTime

type UnixTime timestamp.Timestamp

func (UnixTime) MarshalJSON

func (t UnixTime) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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