utils

package module
v0.0.0-...-5a5c7ff Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 17 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBitMap = NewBitMap(1024)
View Source
var Public = Resource{
	// contains filtered or unexported fields
}

Functions

func Contains

func Contains(array []int, val int) bool

func DateOnly

func DateOnly(t *time.Time) string

func DayNext

func DayNext(s string) string

func HostLocalAddr

func HostLocalAddr() string

HostLocalAddr local address

func HostPublicAddr

func HostPublicAddr() string

HostPublicAddr public address

func HttpGet

func HttpGet(url string, result interface{}) error

HttpGet http get 请求

func HttpPost

func HttpPost(url string, requset interface{}, result interface{}) error

httpPost http post 请求

func JSONFile

func JSONFile(filename string, obj interface{}) error

JSONFile load json file

func LockRun

func LockRun(lock sync.Locker, handler func())

func String2Bytes

func String2Bytes(s string) []byte

String2Bytes hacks string to []byte

func StringOfBytes

func StringOfBytes(b []byte) string

StringOfBytes hacks []byte to string

func StringSplitInts

func StringSplitInts(s, sep string) (v []int)

func StringToFloat64

func StringToFloat64(s string) float64

func StringToInt

func StringToInt(s string) int

func TimeAdd

func TimeAdd(s string, t int) string

func TimeOfString

func TimeOfString(s string) time.Time

func TimeOnly

func TimeOnly(t *time.Time) string

func TimeSince

func TimeSince(s string, t int) string

func TimeString

func TimeString(t *time.Time) string

func Timeout

func Timeout(tm *time.Time, sec float64) bool

func ToString

func ToString(v interface{}) string

func UnixOfString

func UnixOfString(s string) int64

func UnixToString

func UnixToString(sec int64) string

func YamlFile

func YamlFile(filename string, obj interface{}) error

YamlFile load yaml file

Types

type BitMap

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

func NewBitMap

func NewBitMap(n int) *BitMap

func NewBitMapWithBase

func NewBitMapWithBase(n, b int) *BitMap

func (*BitMap) All

func (b *BitMap) All() []int

func (*BitMap) Clear

func (b *BitMap) Clear()

func (*BitMap) Del

func (b *BitMap) Del(n int)

func (*BitMap) Include

func (b *BitMap) Include(n int) bool

func (*BitMap) Set

func (b *BitMap) Set(n int)

func (*BitMap) String

func (b *BitMap) String() string

type Resource

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

func (*Resource) Abs

func (o *Resource) Abs(dirs ...string) string

func (*Resource) Config

func (o *Resource) Config(dir string) string

func (*Resource) Root

func (o *Resource) Root() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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