cbutil

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 21 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateFormat = "2006-01-02"
View Source
var DateTimeFormat = "2006-01-02 15:04:05"
View Source
var RepeatingTaskRecoverFunc func()
View Source
var TimeFormat = "15:04:05"

Functions

func CopyFile

func CopyFile(src, dst string) (int64, error)

func DevRefreshBrowserOnLoadAndTemplateChange

func DevRefreshBrowserOnLoadAndTemplateChange(domain string)

func DistanceBetweenLatLongs

func DistanceBetweenLatLongs(lat1, lon1, lat2, lon2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula

func GetLatLongFromString

func GetLatLongFromString(latLong string) (float64, float64)

func GetTotalMemory added in v0.2.0

func GetTotalMemory() int64

func ProfileGetResults

func ProfileGetResults(enabled bool) []string

func ProfileReset

func ProfileReset(enabled bool)

func ProfileStep

func ProfileStep(enabled bool, step string)

func RandString

func RandString(n int) string

func RandStringPrefix

func RandStringPrefix(prefix string) string

func RecursiveZip

func RecursiveZip(pathToZip, destinationPath string) error

func Sleep

func Sleep(sleepfor time.Duration)

func StringFirstLetterLower

func StringFirstLetterLower(s string) string

func StringReplacer

func StringReplacer(format string, args ...string) string

func Unzip

func Unzip(src string, dest string) ([]string, error)

Types

type InheritanceMultiTemplate

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

func NewInheritanceMultiTemplate

func NewInheritanceMultiTemplate(funcs template.FuncMap) *InheritanceMultiTemplate

func (*InheritanceMultiTemplate) AddTemplate

func (m *InheritanceMultiTemplate) AddTemplate(name string, content []byte) error

func (*InheritanceMultiTemplate) ExecuteTemplate

func (m *InheritanceMultiTemplate) ExecuteTemplate(wr io.Writer, name string, data interface{}) error

type ManualResetEvent

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

func NewManualResetEvent

func NewManualResetEvent(locked bool) *ManualResetEvent

func (*ManualResetEvent) Reset

func (e *ManualResetEvent) Reset()

func (*ManualResetEvent) Set

func (e *ManualResetEvent) Set()

func (*ManualResetEvent) Wait

func (e *ManualResetEvent) Wait()

type MultiManualResetEvent added in v0.1.0

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

func NewMultiManualResetEvent added in v0.1.0

func NewMultiManualResetEvent() *MultiManualResetEvent

func (*MultiManualResetEvent) Get added in v0.1.0

func (m *MultiManualResetEvent) Get(key string, locked bool) (isNew bool, event *ManualResetEvent)

func (*MultiManualResetEvent) Remove added in v0.1.0

func (m *MultiManualResetEvent) Remove(key string)

type MultipleWriter

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

func NewMultipleWriter

func NewMultipleWriter(writers ...io.Writer) MultipleWriter

func (MultipleWriter) Write

func (m MultipleWriter) Write(p []byte) (n int, err error)

type RepeatingTask

type RepeatingTask struct {
	Sleep              time.Duration
	SleepFirst         bool
	ExecuteInGoroutine bool
	Blocking           bool
	Run                func()
}

func (RepeatingTask) Start

func (t RepeatingTask) Start()

Jump to

Keyboard shortcuts

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