util

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkdirAllX added in v0.24.0

func MkdirAllX(path string, perm os.FileMode) error

MkdirAllX calls os.MkdirAll with passed permissions but with +x for user and group. This makes created dir openable regardless of the passed permissions.

func NewSaltingWriter added in v0.14.1

func NewSaltingWriter(w io.Writer, salt []byte) io.Writer

NewSaltingWriter returns io.Writer instance that applies salt to written data and write the result to w.

func SaltXOR

func SaltXOR(data, salt []byte) []byte

SaltXOR xors bits of data with salt repeating salt if necessary.

func SaltXOROffset added in v0.14.1

func SaltXOROffset(data, salt []byte, off int) (result []byte)

SaltXOROffset xors bits of data with salt starting from off byte repeating salt if necessary.

Types

type PseudoWorkerPool added in v0.26.0

type PseudoWorkerPool struct{}

PseudoWorkerPool represents pseudo worker pool which executes submitted job immediately in the caller's routine..

func (PseudoWorkerPool) Submit added in v0.26.0

func (PseudoWorkerPool) Submit(fn func()) error

Submit executes passed function immediately.

Always returns nil.

type WorkerPool

type WorkerPool interface {
	// Submit queues a function for execution
	// in a separate routine.
	//
	// Implementation must return any error encountered
	// that prevented the function from being queued.
	Submit(func()) error
}

WorkerPool represents the tool for control the execution of go-routine pool.

Jump to

Keyboard shortcuts

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