util

package
v0.0.0-...-2781e78 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package util provides some utilities

Index

Constants

This section is empty.

Variables

Functions

func ConvertStringSliceToIntSlice

func ConvertStringSliceToIntSlice(stringSlice []string) (intSlice []int, err error)

ConvertStringSliceToIntSlice converts string slices to int slices.

func DownloadFile

func DownloadFile(fileUrl string) (bytes []byte, err error)

func GenerateMultipartFormBody

func GenerateMultipartFormBody(data []byte) (*bytes.Buffer, string, error)

func LogPrintfInOneLine

func LogPrintfInOneLine(template string, v ...interface{})

func LogPrintlnInOneLine

func LogPrintlnInOneLine(v ...interface{})

Types

type IDMap

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

func NewIDMap

func NewIDMap(expirationLimitSec, expirationCheckingIntervalSec time.Duration) *IDMap

func (*IDMap) Load

func (m *IDMap) Load(id int64) (time.Time, bool)

func (*IDMap) LoadOrStore

func (m *IDMap) LoadOrStore(id int64) (time.Time, bool)

func (*IDMap) StartExpirationCheck

func (m *IDMap) StartExpirationCheck()

func (*IDMap) StopExpirationCheck

func (m *IDMap) StopExpirationCheck()

func (*IDMap) Store

func (m *IDMap) Store(id int64)

Jump to

Keyboard shortcuts

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