idgenerator

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package idgenerator provides an ID generator that generates UIDs and GIDs in a specific range.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDGenerator

type IDGenerator struct {
	UIDMin uint32
	UIDMax uint32
	GIDMin uint32
	GIDMax uint32
}

IDGenerator is an ID generator that generates UIDs and GIDs in a specific range.

func (*IDGenerator) GenerateGID

func (g *IDGenerator) GenerateGID() (uint32, error)

GenerateGID generates a random GID in the configured range.

func (*IDGenerator) GenerateUID

func (g *IDGenerator) GenerateUID() (uint32, error)

GenerateUID generates a random UID in the configured range.

type IDGeneratorMock

type IDGeneratorMock struct {
	UIDsToGenerate []uint32
	GIDsToGenerate []uint32
}

IDGeneratorMock is a mock implementation of the IDGenerator interface. revive:disable-next-line:exported // We don't want to call this type just "Mock"

func (*IDGeneratorMock) GenerateGID

func (g *IDGeneratorMock) GenerateGID() (uint32, error)

GenerateGID generates a GID.

func (*IDGeneratorMock) GenerateUID

func (g *IDGeneratorMock) GenerateUID() (uint32, error)

GenerateUID generates a UID.

Jump to

Keyboard shortcuts

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