utils

package
v0.0.0-...-adfa035 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Utils

type Utils struct{}

func NewUtils

func NewUtils() *Utils

func (*Utils) Base10Version

func (u *Utils) Base10Version(hex int) int64

Base10Version() returns base10 app version

func (*Utils) FlattenDoubleSlice

func (u *Utils) FlattenDoubleSlice(data [][]string) []string

FlattenDoubleSlice turns 2d slice into a 1d slice.

func (*Utils) FlattenMap

func (u *Utils) FlattenMap(slice []any) []any

func (*Utils) FromJSON

func (u *Utils) FromJSON(src any) any

Deserialize JSON data from DB.

func (*Utils) GetContext

func (u *Utils) GetContext(dur time.Duration) (context.Context, context.CancelFunc)

func (*Utils) JsonLineAndCharErr

func (u *Utils) JsonLineAndCharErr(offset int64, pay []byte) (int, int, error)

func (*Utils) LogConfigToFile

func (u *Utils) LogConfigToFile()

func (*Utils) ParseBuildstampVersion

func (u *Utils) ParseBuildstampVersion(bs string) int

Parses semantic version string in the following formats:

1.2, 1.2abc, 1.2.3, 1.2.3-abc, v0.12.34-rc5

Unparceable values are replaced with zeros.

func (*Utils) ToAbsolutePath

func (u *Utils) ToAbsolutePath(base, path string) string

Convert relative filepath to absolute.

func (*Utils) ToJSON

func (u *Utils) ToJSON(src any) []byte

Jump to

Keyboard shortcuts

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