utils

package
v2.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 13 Imported by: 37

Documentation

Index

Constants

View Source
const (
	IPV4 string = "tcp4"
	IPV6 string = "tcp6"
)

Variables

View Source
var (
	// OtelTracerNameKey is OpenTelemetry context key
	OtelTracerNameKey = &ContextKey{name: "tracer_name"} //nolint:gochecknoglobals

	// PsrContextKey is a context key. It can be used in the http attributes
	// immutable
	PsrContextKey = &ContextKey{"psr_attributes"} //nolint:gochecknoglobals
)

Functions

func AsBytes

func AsBytes(s string) []byte

AsBytes returns a slice that refers to the data backing the string s.

func AsString

func AsString(b []byte) string

AsString returns a string that refers to the data backing the slice s.

func Bool

func Bool(v bool) *bool

Bool returns a pointer value for the bool value passed in.

func BoolMap

func BoolMap(vs map[string]bool) map[string]*bool

BoolMap returns a map of bool pointers from the values passed in.

func BoolSlice

func BoolSlice(vs []bool) []*bool

BoolSlice returns a slice of bool pointers from the values passed in.

func Byte

func Byte(v byte) *byte

Byte returns a pointer value for the byte value passed in.

func ByteMap

func ByteMap(vs map[string]byte) map[string]*byte

ByteMap returns a map of byte pointers from the values passed in.

func ByteSlice

func ByteSlice(vs []byte) []*byte

ByteSlice returns a slice of byte pointers from the values passed in.

func CreateListener

func CreateListener(address string) (net.Listener, error)

CreateListener

CreateListener crates socket listener based on DSN definition.

func ExecuteFromUser

func ExecuteFromUser(cmd *exec.Cmd, u string) error

ExecuteFromUser may work only if run RR under root user

func Float32

func Float32(v float32) *float32

Float32 returns a pointer value for the float32 value passed in.

func Float32Map

func Float32Map(vs map[string]float32) map[string]*float32

Float32Map returns a map of float32 pointers from the values passed in.

func Float32Slice

func Float32Slice(vs []float32) []*float32

Float32Slice returns a slice of float32 pointers from the values passed in.

func Float64

func Float64(v float64) *float64

Float64 returns a pointer value for the float64 value passed in.

func Float64Map

func Float64Map(vs map[string]float64) map[string]*float64

Float64Map returns a map of float64 pointers from the values passed in.

func Float64Slice

func Float64Slice(vs []float64) []*float64

Float64Slice returns a slice of float64 pointers from the values passed in.

func Int

func Int(v int) *int

Int returns a pointer value for the int value passed in.

func Int16

func Int16(v int16) *int16

Int16 returns a pointer value for the int16 value passed in.

func Int16Map

func Int16Map(vs map[string]int16) map[string]*int16

Int16Map returns a map of int16 pointers from the values passed in.

func Int16Slice

func Int16Slice(vs []int16) []*int16

Int16Slice returns a slice of int16 pointers from the values passed in.

func Int32

func Int32(v int32) *int32

Int32 returns a pointer value for the int32 value passed in.

func Int32Map

func Int32Map(vs map[string]int32) map[string]*int32

Int32Map returns a map of int32 pointers from the values passed in.

func Int32Slice

func Int32Slice(vs []int32) []*int32

Int32Slice returns a slice of int32 pointers from the values passed in.

func Int64

func Int64(v int64) *int64

Int64 returns a pointer value for the int64 value passed in.

func Int64Map

func Int64Map(vs map[string]int64) map[string]*int64

Int64Map returns a map of int64 pointers from the values passed in.

func Int64Slice

func Int64Slice(vs []int64) []*int64

Int64Slice returns a slice of int64 pointers from the values passed in.

func Int8

func Int8(v int8) *int8

Int8 returns a pointer value for the int8 value passed in.

func Int8Map

func Int8Map(vs map[string]int8) map[string]*int8

Int8Map returns a map of int8 pointers from the values passed in.

func Int8Slice

func Int8Slice(vs []int8) []*int8

Int8Slice returns a slice of int8 pointers from the values passed in.

func IntMap

func IntMap(vs map[string]int) map[string]*int

IntMap returns a map of int pointers from the values passed in.

func IntSlice

func IntSlice(vs []int) []*int

IntSlice returns a slice of int pointers from the values passed in.

func IsolateProcess

func IsolateProcess(cmd *exec.Cmd)

IsolateProcess change gpid for the process to avoid bypassing signals to php processes.

func SetChecker

func SetChecker(_ []byte)

func String

func String(v string) *string

String returns a pointer value for the string value passed in.

func StringMap

func StringMap(vs map[string]string) map[string]*string

StringMap returns a map of string pointers from the values passed in.

func StringSlice

func StringSlice(vs []string) []*string

StringSlice returns a slice of string pointers from the values passed in.

func Time

func Time(v time.Time) *time.Time

Time returns a pointer value for the time.Time value passed in.

func TimeMap

func TimeMap(vs map[string]time.Time) map[string]*time.Time

TimeMap returns a map of time.Time pointers from the values passed in.

func TimeSlice

func TimeSlice(vs []time.Time) []*time.Time

TimeSlice returns a slice of time.Time pointers from the values passed in.

func Uint

func Uint(v uint) *uint

Uint returns a pointer value for the uint value passed in.

func Uint16

func Uint16(v uint16) *uint16

Uint16 returns a pointer value for the uint16 value passed in.

func Uint16Map

func Uint16Map(vs map[string]uint16) map[string]*uint16

Uint16Map returns a map of uint16 pointers from the values passed in.

func Uint16Slice

func Uint16Slice(vs []uint16) []*uint16

Uint16Slice returns a slice of uint16 pointers from the values passed in.

func Uint32

func Uint32(v uint32) *uint32

Uint32 returns a pointer value for the uint32 value passed in.

func Uint32Map

func Uint32Map(vs map[string]uint32) map[string]*uint32

Uint32Map returns a map of uint32 pointers from the values passed in.

func Uint32Slice

func Uint32Slice(vs []uint32) []*uint32

Uint32Slice returns a slice of uint32 pointers from the values passed in.

func Uint64

func Uint64(v uint64) *uint64

Uint64 returns a pointer value for the uint64 value passed in.

func Uint64Map

func Uint64Map(vs map[string]uint64) map[string]*uint64

Uint64Map returns a map of uint64 pointers from the values passed in.

func Uint64Slice

func Uint64Slice(vs []uint64) []*uint64

Uint64Slice returns a slice of uint64 pointers from the values passed in.

func Uint8

func Uint8(v uint8) *uint8

Uint8 returns a pointer value for the uint8 value passed in.

func Uint8Map

func Uint8Map(vs map[string]uint8) map[string]*uint8

Uint8Map returns a map of uint8 pointers from the values passed in.

func Uint8Slice

func Uint8Slice(vs []uint8) []*uint8

Uint8Slice returns a slice of uint8 pointers from the values passed in.

func UintMap

func UintMap(vs map[string]uint) map[string]*uint

UintMap returns a map of uint pointers from the values passed in.

func UintSlice

func UintSlice(vs []uint) []*uint

UintSlice returns a slice of uint pointers from the values passed in.

Types

type ContextKey added in v2.13.3

type ContextKey struct {
	// contains filtered or unexported fields
}

func (*ContextKey) String added in v2.13.3

func (ck *ContextKey) String() string

Jump to

Keyboard shortcuts

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