util

package
v0.5.0-dev25 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAES

func DecryptAES(key []byte, ciphertext []byte) ([]byte, error)

DecryptAES decrypts ciphertext with key, see https://golang.org/pkg/crypto/cipher/#NewCFBDecrypter

func EncryptAES

func EncryptAES(key []byte, plaintext []byte) ([]byte, error)

EncryptAES encrypts plaintext with key, see https://golang.org/pkg/crypto/cipher/#NewCFBEncrypter

func HashBytes

func HashBytes(input []byte) string

func HashString

func HashString(input string) string

func PanicOnError

func PanicOnError(err error)

PanicOnError panics if the given error is not nil

Types

type ShutdownWaitGroup

type ShutdownWaitGroup struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewShutdownWaitGroup

func NewShutdownWaitGroup() *ShutdownWaitGroup

func (*ShutdownWaitGroup) Expect

func (s *ShutdownWaitGroup) Expect()

func (*ShutdownWaitGroup) IsExpected

func (s *ShutdownWaitGroup) IsExpected() bool

func (*ShutdownWaitGroup) RegisterSignalHandler

func (s *ShutdownWaitGroup) RegisterSignalHandler(shutdownCallback func())

func (*ShutdownWaitGroup) WaitOrTimeout

func (s *ShutdownWaitGroup) WaitOrTimeout(timeout time.Duration) bool

Wait for internal `sync.WorkGroup` to complete and return `true` or `false`, if not shutdown successfully in timeout-limit.

Jump to

Keyboard shortcuts

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