util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BandwidthMeasurementClient

func BandwidthMeasurementClient(conn net.Conn, bytesDownlink int, timeout time.Duration) (float32, float32, error)

func BandwidthMeasurementClientContext

func BandwidthMeasurementClientContext(ctx context.Context, conn net.Conn, bytesDownlink int, timeout time.Duration) (float32, float32, error)

func BandwidthMeasurementServer

func BandwidthMeasurementServer(conn net.Conn, bytesDownlink int, timeout time.Duration) error

func BandwidthMeasurementServerContext

func BandwidthMeasurementServerContext(ctx context.Context, conn net.Conn, bytesDownlink int, timeout time.Duration) error

func CopyFile

func CopyFile(src, dst string) error

func DeepCopyMap

func DeepCopyMap(value map[string]interface{}) map[string]interface{}

func DelayMeasurement

func DelayMeasurement(network, address string, timeout time.Duration) (time.Duration, error)

func DelayMeasurementContext

func DelayMeasurementContext(ctx context.Context, network, address string, timeout time.Duration) (time.Duration, error)

func DownloadJsonFile

func DownloadJsonFile(ctx context.Context, url, filename string) error

func Enqueue

func Enqueue(jobChan chan<- Job, job Job)

func Exists

func Exists(path string) bool

func Process

func Process(job Job, wg *sync.WaitGroup)

func ReadJSON

func ReadJSON(fileName string, value interface{}) error

func WorkPool

func WorkPool(workerNum int, jobChan chan Job, wg *sync.WaitGroup)

func Worker

func Worker(jobChan <-chan Job, wg *sync.WaitGroup)

func WriteJSON

func WriteJSON(path string, data interface{}) error

Types

type Job

type Job func()

Jump to

Keyboard shortcuts

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