helpers

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastIP

func BroadcastIP(network *net.IPNet) (*net.IP, error)

func GenerateHashSHA512

func GenerateHashSHA512(data io.ReadCloser) []byte

func PanicOnError

func PanicOnError(e error)

func PanicOnError2

func PanicOnError2[T any](v T, e error) T

func SignalHandler

func SignalHandler(applicationMain func(), shutdownHandler func(), signals ...os.Signal)

func StripError

func StripError[T any](v T, e error) T

Discouraged! Only around for assured parsing

Types

type Optional

type Optional[T any] struct {
	// contains filtered or unexported fields
}

Remember to use pointers for non-primitives

func NewOptional

func NewOptional[T any](initial T) Optional[T]

func (*Optional[T]) Get

func (opt *Optional[T]) Get() T

func (*Optional[T]) Specified

func (opt *Optional[T]) Specified() bool

func (*Optional[T]) Specify

func (opt *Optional[T]) Specify(value T)

Jump to

Keyboard shortcuts

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