utils

package
v0.17.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(key, defaultVal string) string

Env get enviroment variables with default value

func Int32Ptr

func Int32Ptr(i int32) *int32

Int32Ptr convert int32 value to a pointer.

func Int64Ptr

func Int64Ptr(i int64) *int64

Int64Ptr convert int64 value to a pointer.

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile read bytes from file

func StringPtr

func StringPtr(s string) *string

StringPtr convert string value to a pointer.

func StringToBool

func StringToBool(s string) (bool, error)

func StringToInt64

func StringToInt64(s string) (int64, error)

func ToValidUTF8

func ToValidUTF8(s, replacement []byte) []byte

ToValidUTF8 treats s as UTF-8-encoded bytes and returns a copy with each run of bytes representing invalid UTF-8 replaced with the bytes in replacement, which may be empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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