misc

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: BSD-3-Clause Imports: 4 Imported by: 1

README

miscellaneous

GoDoc Go Report

Description

Miscellaneous utility collections.

Requirements

Go 1.5 or above.

Installation

Run the following command to install the package:

go get amuz.es/src/go/misc

Documentation

Overview

Package misc contains Miscellaneous utility collections.

Index

Constants

This section is empty.

Variables

View Source
var (
	// JSONCodec is a static JSON serializer and JSON deserializer handler.
	JSONCodec = json.ConfigFastest
)

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// NotifyError is an error notifier method within a concurrency environment that avoids falling in deadlock.
	NotifyError(err error)
	// Error method is a Error channel for cancellation.
	Error() <-chan error
	// Done method is a Done channel for cancellation.
	Done() <-chan struct{}
	// GracefulWait is a graceful shutdown method while the dependents are safely released.
	// It acts like a "WaitGroup.Wait" method.
	GracefulWait()
	// IncreaseWait is an acquiring method for a dependent.
	// It acts like a "WaitGroup.Add(1)" method.
	IncreaseWait()
	// DecreaseWait is an release method for a dependent.
	// It acts like a "WaitGroup.Done" method.
	DecreaseWait()
}

Handler is context handler with sync.WaitGroup and error notifier.

func NewHandler

func NewHandler(ctx context.Context) Handler

NewHandler returns an initialized Handler interface.

Directories

Path Synopsis
Package backoff contains backoff algorithm helper functions.
Package backoff contains backoff algorithm helper functions.
Package crypto contains encryption-decryption helper functions.
Package crypto contains encryption-decryption helper functions.
Package dbg contains debugging helper functions.
Package dbg contains debugging helper functions.
Package dttm contains date-time and locale-related data structures.
Package dttm contains date-time and locale-related data structures.
Package han contains utility functions for regional issues in Korea.
Package han contains utility functions for regional issues in Korea.
Package monetary contain monetary related data structures.
Package monetary contain monetary related data structures.
Package networking is simple network utility collections.
Package networking is simple network utility collections.
Package nums contain number related utility functions.
Package nums contain number related utility functions.
q
Package q contain non-blocking unlimited queue data structures.
Package q contain non-blocking unlimited queue data structures.
Package sqls contain database/sql related utility functions.
Package sqls contain database/sql related utility functions.
Package strutil contain string conversion utility collection.
Package strutil contain string conversion utility collection.
Package types contain misc data structures.
Package types contain misc data structures.

Jump to

Keyboard shortcuts

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