utils

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: LGPL-3.0 Imports: 5 Imported by: 0

README

MonoIncSeqNumGenerator32

MonoIncSeqNumGenerator32 is a goroutine-safe Monotonically Increasing Sequence Number Generator which generates 32bit unsigned ints.

MonoIncSeqNumGenerator64

MonoIncSeqNumGenerator64 is a goroutine-safe Monotonically Increasing Sequence Number Generator which generates 64bit unsigned ints.

Documentation

Overview

Package utils packs with many useful handy code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MD5File

func MD5File(filepath string) ([]byte, error)

MD5File returns the MD5 checksum of the file contents.

`filepath` - Path to the file

func MD5FileString

func MD5FileString(filepath string) (string, error)

MD5FileString returns the MD5 checksum of the file contents, in lowercase hex string.

`filepath` - Path to the file

Types

type MonoIncSeqNumGenerator32

type MonoIncSeqNumGenerator32 uint32

MonoIncSeqNumGenerator32 is a goroutine-safe Monotonically Increasing Sequence Number Generator which generates 32bit unsigned ints.

func NewMonoIncSeqNumGenerator32

func NewMonoIncSeqNumGenerator32(initVal uint32) *MonoIncSeqNumGenerator32

NewMonoIncSeqNumGenerator32 is an easy way to get a new, ready-to-use MonoIncSeqNumGenerator32 object with an initial value.

initVal: Initial value for this MonoIncSeqNumGenerator32

func (*MonoIncSeqNumGenerator32) GetSeqNum

func (m32 *MonoIncSeqNumGenerator32) GetSeqNum() uint32

GetSeqNum returns a sequence number that is bigger than the previously sequence number by 1.

type MonoIncSeqNumGenerator64

type MonoIncSeqNumGenerator64 uint64

MonoIncSeqNumGenerator64 is a goroutine-safe Monotonically Increasing Sequence Number Generator which generates 64bit unsigned ints.

func NewMonoIncSeqNumGenerator64

func NewMonoIncSeqNumGenerator64(initVal uint32) *MonoIncSeqNumGenerator64

NewMonoIncSeqNumGenerator64 is an easy way to get a new, ready-to-use MonoIncSeqNumGenerator64 object with an initial value.

initVal: Initial value for this MonoIncSeqNumGenerator64

func (*MonoIncSeqNumGenerator64) GetSeqNum

func (m64 *MonoIncSeqNumGenerator64) GetSeqNum() uint64

GetSeqNum returns a sequence number that is bigger than the previously sequence number by 1.

Jump to

Keyboard shortcuts

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