Documentation ¶
Index ¶
- func BytesToInt(b []byte) int
- func CheckOrCreateDir(dir string) (string, error)
- func CreateFile(fname string) (*os.File, error)
- func DeJSON(data []byte, v interface{}) error
- func DeepCopy(src, dest interface{}) error
- func EnJSON(v interface{}) ([]byte, error)
- func EnJSONStr(v interface{}) (string, error)
- func GenerateSelfSignedCertificate(keyFile, certFile, domain string) error
- func Index(s interface{}, slice interface{}) int
- func IndexA(a []interface{}, fn func(i int) bool) int
- func IndexS(slice interface{}, fn func(i int) bool) int
- func IndexStringArray(s string, a []string) int
- func Int10Ints(num int) []int
- func IntTInts(num int, base uint8) []int
- func IntToByte(n int) []byte
- func IntfaceToInt64(x interface{}) (int64, error)
- func IntfaceToString(x interface{}) (string, error)
- func Ints10Int(mods []int) int
- func IntsTInt(mods []int, base uint8) int
- func IntsToString(arr []int) string
- func JSONConvert(m interface{}, dest interface{}) (err error)
- func LoadCertificate(keyFile, certFile, domain string) (tls.Certificate, error)
- func RandomString(n int) string
- func RemoveDuplicatesInts(nums []int) []int
- func ReversBytes(bs []byte)
- func ReversInts(bs []int)
- func ReverseString(s string) string
- func SnakeName(base string) string
- func TransFieldName(name string) string
- type InterfaceHeap
- type Item
- type JsonConvert
- type ModelConvertor
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSelfSignedCertificate ¶
生成自定义的签名证书
func IntfaceToInt64 ¶
IntfaceToInt64 将interface转换为int64
func IntfaceToString ¶
IntfaceToString 将interface转换为string
func IntsToString ¶
func JSONConvert ¶
func JSONConvert(m interface{}, dest interface{}) (err error)
func LoadCertificate ¶
func LoadCertificate(keyFile, certFile, domain string) (tls.Certificate, error)
LoadCertificate loads a certificate given a private key and certificate PEM files. Only in case the associated domain is localhost and no files are specified a self signed certificate will be automatically generated.
func RemoveDuplicatesInts ¶
func ReversBytes ¶
func ReversBytes(bs []byte)
func ReversInts ¶
func ReversInts(bs []int)
func ReverseString ¶
Types ¶
type InterfaceHeap ¶
type InterfaceHeap []interface{}
InterfaceHeap 任意堆,用于在具体实现时进行继承
func (InterfaceHeap) Less ¶
func (h InterfaceHeap) Less(i, j int) bool
func (InterfaceHeap) Swap ¶
func (h InterfaceHeap) Swap(i, j int)
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
An Item is something we manage in a priority queue.
type JsonConvert ¶
type JsonConvert struct{}
func (*JsonConvert) Convert ¶
func (j *JsonConvert) Convert(src, dest interface{}) error
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.