generators

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package generators provides custom hostname generation for use with Splice.

Index

Constants

This section is empty.

Variables

View Source
var (
	// RootKey is the root registry key for generator configuration
	RootKey = `SOFTWARE\Splice\Generators`

	// ErrInvalidGenerator indicates that an invalid generator name was requested
	ErrInvalidGenerator = errors.New("invalid generator name")
	// ErrLongName is returned in cases where a name may exceed Active Directory limits
	ErrLongName = errors.New("names greater than 15 characters may fail to join")
	// ErrNotConfigured indicates that a generator has not yet been configured.
	// Try calling ConfigureAll() first.
	ErrNotConfigured = errors.New("generator is not configured")
)

Functions

func ConfigureAll

func ConfigureAll() error

ConfigureAll configures all generators for use. This should be called once at setup, but can be called subsequently to reconfigure.

func List

func List() []string

List returns a list of the available generators by name.

func Register

func Register(name string, g generator)

Register registers a new generator.

func Run

func Run(name string, input []byte) (string, error)

Run performs a hostname generation using the given generator and input.

Types

This section is empty.

Directories

Path Synopsis
Package prefix provides a generator that generates names with a specific prefix.
Package prefix provides a generator that generates names with a specific prefix.

Jump to

Keyboard shortcuts

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