Skip to content

A simple naming library for use with internal naming rules.

Notifications You must be signed in to change notification settings

honeytrap/namecon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Namecon

Namecon is a simple library which provides a base for generating predefined names based on any standards provided by a type which implements the NameGenerator interface. This is useful for creating simple names that match needed criterias based on giving rules.

Concept

Namecon is rather simple, you create a structure which implements the rules you desire for the giving standard to be used for the template provided and then use that to generate namers which will create new names based based on a provided base.

This concept is very simple but can grow into a power system which streamlines how you name instances, daemons, running apps, ...etc.

Example

import (
	"github.com/honeytrap/namecon"
)

func main() {

	// Create the name generator with the base template and NameGenerator rule enforcer.
	simpleNamer := namecon.GenerateNamer(namecon.SimpleNamer{}, "app-%s:%s")

	// create a new name based on a specifc group/app/subdomain.
	simpleNamer("trapper") // => app-trapper:454u34334909
	simpleNamer("trapper") // => app-trapper:u89J9232232
	simpleNamer("hippy")   // => app-hippy:fge6023ghu
}

About

A simple naming library for use with internal naming rules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages