utils

package
v0.0.0-...-8ade5a4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFile

func AppendFile(buf bytes.Buffer, pre string) *bytes.Buffer

func CheckHttpHeader

func CheckHttpHeader(responseHeader http.Header, domain string, expectHeader map[string]string) bool

CheckHttpHeader verify http header support cross-origin

func ConvertToString

func ConvertToString(targetStrung []byte) string

func GetFileBufferBySize

func GetFileBufferBySize(size uint64) bytes.Buffer

func GetNonce

func GetNonce(endpoint string, header map[string]string) (*http.Header, string, error)

func GetParamFromCSV

func GetParamFromCSV(path string, skipFirstRow bool) [][]string

func GetRandomAccountName

func GetRandomAccountName() string

GetRandomAccountName generate random account name

func GetRandomBucketName

func GetRandomBucketName() string

GetRandomBucketName generate random bucket name.

func GetRandomGroupName

func GetRandomGroupName() string

GetRandomGroupName generate random group name.

func GetRandomObjectName

func GetRandomObjectName() string

GetRandomObjectName generate random object name.

func GetSizeByString

func GetSizeByString(size string) int64

func HttpGetWithHeaders

func HttpGetWithHeaders(url string, header map[string]string) (*http.Header, string, error)

func HttpOptionsWithHeaders

func HttpOptionsWithHeaders(url string, header map[string]string) (*http.Response, string, error)

func HttpPostWithHeaders

func HttpPostWithHeaders(url string, jsonStr string, header map[string]string) (*http.Header, string, error)

func IsContain

func IsContain(items []string, item string) bool

func OptionsGetNonce

func OptionsGetNonce(endpoint string, header map[string]string) (*http.Response, string, error)

func RandHexKey

func RandHexKey() string

func RandInt64

func RandInt64(min, max int64) int64

RandInt64 generate random int64 between min and max

func RandStringWithLong

func RandStringWithLong(n int64) string

func RandomNum

func RandomNum(n, scope int) int

func RandomString

func RandomString(n int) string

func RandomStringToLower

func RandomStringToLower(n int) string

func RandomStringToUpper

func RandomStringToUpper(n int) string

func WriteToCSV

func WriteToCSV(data [][]string, path string) error

Types

type File

type File struct {
	Reader    *bytes.Reader
	Path      string
	Size      int64
	Name      string
	Extension string
}

func GetFile

func GetFile(path string) (*File, error)

type ParametersIterator

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

func NewParametersIterator

func NewParametersIterator(slice interface{}) ParametersIterator

func (*ParametersIterator) Add

func (iter *ParametersIterator) Add(inter interface{})

func (*ParametersIterator) GetParameters

func (iter *ParametersIterator) GetParameters() []interface{}

func (*ParametersIterator) Len

func (iter *ParametersIterator) Len() int

func (*ParametersIterator) Next

func (iter *ParametersIterator) Next() interface{}

func (*ParametersIterator) NextWithOutLoop

func (iter *ParametersIterator) NextWithOutLoop() interface{}

Jump to

Keyboard shortcuts

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