utils

package
v0.0.0-...-dc352d1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeLoc = time.Local

Functions

func Base64Decode

func Base64Decode(str string) (string, bool)

func Base64DecodeByte

func Base64DecodeByte(str string) ([]byte, bool)

func Base64Encode

func Base64Encode(str string) string

func BuildToken

func BuildToken(envSecret string) string

func DefaultHeaders

func DefaultHeaders(envSecret string) map[string]string

DefaultHeaders set default header for ffc request

func GetBool

func GetBool(v interface{}) bool

func GetByteArray

func GetByteArray(v interface{}) []byte

func GetFloat64

func GetFloat64(v interface{}) float64

func GetInt

func GetInt(v interface{}) int

func GetInt64

func GetInt64(v interface{}) int64

func GetInt64Slices

func GetInt64Slices(v interface{}) []int64

func GetString

func GetString(v interface{}) string

func HeaderBuilderFor

func HeaderBuilderFor(headers map[string]string) http.Header

HeaderBuilderFor convert http config header to request headers @Param httpConfig @Return http headers

func IfKeyBelongsPercentage

func IfKeyBelongsPercentage(key string, percentageRange []float64) bool

func IsNum

func IsNum(s string) bool

func PercentageOfKey

func PercentageOfKey(key string) float64

func StringsToInterfaces

func StringsToInterfaces(keys []string) []interface{}

func ToBool

func ToBool(str string) bool

func ToInt64

func ToInt64(value interface{}) (d int64)

func ToStr

func ToStr(value interface{}, args ...int) (s string)

Types

type Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Pop

func (q *Queue) Pop() interface{}

func (*Queue) Push

func (q *Queue) Push(item interface{})

type StrTo

type StrTo string

func (StrTo) Bool

func (f StrTo) Bool() (bool, error)

func (*StrTo) Clear

func (f *StrTo) Clear()

func (StrTo) Exist

func (f StrTo) Exist() bool

func (StrTo) Float32

func (f StrTo) Float32() (float32, error)

func (StrTo) Float64

func (f StrTo) Float64() (float64, error)

func (StrTo) Int

func (f StrTo) Int() (int, error)

func (StrTo) Int16

func (f StrTo) Int16() (int16, error)

func (StrTo) Int32

func (f StrTo) Int32() (int32, error)

func (StrTo) Int64

func (f StrTo) Int64() (int64, error)

func (StrTo) Int8

func (f StrTo) Int8() (int8, error)

func (*StrTo) Set

func (f *StrTo) Set(v string)

func (StrTo) String

func (f StrTo) String() string

func (StrTo) Uint

func (f StrTo) Uint() (uint, error)

func (StrTo) Uint16

func (f StrTo) Uint16() (uint16, error)

func (StrTo) Uint32

func (f StrTo) Uint32() (uint32, error)

func (StrTo) Uint64

func (f StrTo) Uint64() (uint64, error)

func (StrTo) Uint8

func (f StrTo) Uint8() (uint8, error)

Jump to

Keyboard shortcuts

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