utils

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func GetEnv

func GetEnv(key, fallback string) string

func GetEnvBool

func GetEnvBool(key string, fallback bool) bool

func GetEnvInt

func GetEnvInt(key string, fallback int) int

func GetFileExt

func GetFileExt(path string) string

func GetFileIcon

func GetFileIcon(fileName string, isDir bool) string

func HashSha1

func HashSha1(s string) string

HashSha1 sha1 加密

func InetAtoN

func InetAtoN(ip string, port int) int64

func InetNtoA

func InetNtoA(ip int64) string

func IntChangeToSize

func IntChangeToSize(s int64) string

IntChangeToSize 转换单位

func IsAddr

func IsAddr(address string) bool

IsAddr 判断string是否为ip地址 :9091 127.0.0.1:9090 0.0.0.0:9090

func IsUtf8

func IsUtf8(s []byte) bool

func ParseUploadPath

func ParseUploadPath(remote string, filename string) (string, string)

func PathExists

func PathExists(path string) (bool, error)

Types

type SafeMap

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

func NewSafeMap

func NewSafeMap() *SafeMap

func (*SafeMap) Delete

func (s *SafeMap) Delete(key interface{})

func (*SafeMap) Length

func (s *SafeMap) Length() int

func (*SafeMap) Load

func (s *SafeMap) Load(key interface{}) (value interface{}, ok bool)

func (*SafeMap) Range

func (s *SafeMap) Range(f func(key, value interface{}) bool)

func (*SafeMap) Store

func (s *SafeMap) Store(key, value interface{})

Jump to

Keyboard shortcuts

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