naming_hint

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamingConstraints

type NamingConstraints struct {
	LowerCaseLetters  bool
	UpperCaseLetters  bool
	Numbers           bool
	SpecialCharacters string
	MaxLength         uint
}

type Translator

type Translator interface {
	Translate(input string) (string, error)
}

func NewNameHintTranslator

func NewNameHintTranslator(constraints *NamingConstraints) (Translator, error)

type UniqueGenerator

type UniqueGenerator interface {

	// Generate create unique and consistent name that can be used in the target data source to create access elements.
	// The argument ap is an access provider pointer. Each next ap that is provided to the class should have an ascending ID to guarantee a deterministic ID generation
	// The output is a map that will point AccessIDs to the unique generate name
	Generate(ap *sync_to_target.AccessProvider) (map[string]string, error)
	GenerateOrdered(ap *sync_to_target.AccessProvider) ([]string, error)
}

func NewUniqueNameGenerator

func NewUniqueNameGenerator(logger hclog.Logger, prefix string, constraints *NamingConstraints) (UniqueGenerator, error)

NewUniqueNameGenerator will create an implementation of the UniqueGenerator interface. The UniqueGenerator will ensure the constraints provided in the first argument

Jump to

Keyboard shortcuts

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