Documentation ¶
Index ¶
- Variables
- func CastRefelectValue(value string, targetType reflect.Type) reflect.Value
- func GenerateRandomString(length int) string
- func GetColorer() *color.Color
- func GetEnv() *viper.Viper
- func GetLogger() *zap.Logger
- func GetRawType(source interface{}) reflect.Type
- func GetRawTypeName(source interface{}) string
- func GetRawTypeShortName(source interface{}) string
- func GetRegexp(pattern string) *regexp.Regexp
- func IsLANAddress(host string) bool
- func MergeSlices[T comparable](slices ...[]T) []T
- func ReadParamList(data map[string]string, obj any) error
- type BaseTimingServer
- type TimingServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Prefix = "netdoop" MaxProcs = 1 VerboseMode = false DebugMode = false ConfigFile = "" WorkDir = "/opt/netdoop" DataPath = "data" ConfPath = "conf" DefaultConfigFile = WorkDir + "/" + ConfPath + "/netdoop.yaml" )
Functions ¶
func CastRefelectValue ¶
func GenerateRandomString ¶
func GetColorer ¶
func GetRawType ¶
func GetRawTypeName ¶
func GetRawTypeName(source interface{}) string
func GetRawTypeShortName ¶
func GetRawTypeShortName(source interface{}) string
func IsLANAddress ¶
func MergeSlices ¶
func MergeSlices[T comparable](slices ...[]T) []T
Types ¶
type BaseTimingServer ¶
type BaseTimingServer struct {
// contains filtered or unexported fields
}
func (*BaseTimingServer) Run ¶
func (s *BaseTimingServer) Run()
func (*BaseTimingServer) StartTimer ¶
func (s *BaseTimingServer) StartTimer(key string, d time.Duration, f func())
func (*BaseTimingServer) Stop ¶
func (s *BaseTimingServer) Stop()
func (*BaseTimingServer) StopTimer ¶
func (s *BaseTimingServer) StopTimer(key string)
type TimingServer ¶
type TimingServer interface { Run() Stop() StartTimer(key string, d time.Duration, f func()) StopTimer(key string) }
func GetTimingServer ¶
func GetTimingServer() TimingServer
func NewBaseTimingServer ¶
func NewBaseTimingServer(tick time.Duration, size int64) (TimingServer, error)
Click to show internal directories.
Click to hide internal directories.