util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddListener added in v0.3.0

func AddListener(path string, l Listener)

func CheckFileExists

func CheckFileExists(filePath string) bool

func CompressFile

func CompressFile(fileIn string, fileOut string) error

func Contains

func Contains[T comparable](items []T, item T) bool

func CopyDir

func CopyDir(src string, dst string) (err error)

func CopyFile

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

func DiskUsage

func DiskUsage(dirpath string) float64

func FsWatcherShutdown added in v0.3.0

func FsWatcherShutdown()

func GetFilecount

func GetFilecount(path string) int

func GetFilesize

func GetFilesize(filePath string) int64

func Max

func Max[T constraints.Ordered](a, b T) T

func Mean

func Mean(input []float64) (float64, error)

func Median

func Median(input []float64) (median float64, err error)

func Min

func Min[T constraints.Ordered](a, b T) T

func UncompressFile

func UncompressFile(fileIn string, fileOut string) error

Types

type Float added in v0.5.0

type Float float64

Go's JSON encoder for floats does not support NaN (https://github.com/golang/go/issues/3480). This program uses NaN as a signal for missing data. For the HTTP JSON API to be able to handle NaN values, we have to use our own type which implements encoding/json.Marshaler itself.

var (
	NaN Float = Float(math.NaN())
)

func ConvertToFloat added in v0.5.0

func ConvertToFloat(input float64) Float

func (Float) Double added in v0.5.0

func (f Float) Double() float64

func (Float) IsNaN added in v0.5.0

func (f Float) IsNaN() bool

func (Float) MarshalJSON added in v0.5.0

func (f Float) MarshalJSON() ([]byte, error)

func (*Float) UnmarshalJSON added in v0.5.0

func (f *Float) UnmarshalJSON(input []byte) error

type FloatArray added in v0.5.0

type FloatArray []Float

Same as `[]Float`, but can be marshaled to JSON with less allocations.

func (FloatArray) MarshalJSON added in v0.5.0

func (fa FloatArray) MarshalJSON() ([]byte, error)

type Listener added in v0.3.0

type Listener interface {
	EventCallback()
	EventMatch(event string) bool
}

type Selector added in v0.5.0

type Selector []SelectorElement

type SelectorElement added in v0.5.0

type SelectorElement struct {
	String string
	Group  []string
	Any    bool
}

func (*SelectorElement) MarshalJSON added in v0.5.0

func (se *SelectorElement) MarshalJSON() ([]byte, error)

func (*SelectorElement) UnmarshalJSON added in v0.5.0

func (se *SelectorElement) UnmarshalJSON(input []byte) error

Jump to

Keyboard shortcuts

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