namepool

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThemeKungFuPanda = "kungfu-panda"
	ThemeToyStory    = "toy-story"
	ThemeGhibli      = "ghibli"
	ThemeStarWars    = "star-wars"
	ThemeDune        = "dune"
	ThemeMatrix      = "matrix"
)

Theme names

Variables

This section is empty.

Functions

func GetThemeNames

func GetThemeNames(theme string) ([]string, error)

GetThemeNames returns the names for a given theme

func IsThemedName

func IsThemedName(name string) bool

IsThemedName checks if a name belongs to any theme

func ListThemes

func ListThemes() []string

ListThemes returns all available theme names

func ThemeForProject

func ThemeForProject(projectName string) string

ThemeForProject returns a consistent theme for a project name. The same project name will always get the same theme.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func Load

func Load(cfg *config.Config) (*Pool, error)

Load loads a namepool from the config file (legacy/fallback method)

func LoadForProject

func LoadForProject(projectName string) (*Pool, error)

LoadForProject loads a themed namepool based on the project name. The project name is hashed to consistently select a theme.

func LoadTheme

func LoadTheme(themeName string) (*Pool, error)

LoadTheme loads a specific theme by name

func NewPool

func NewPool(names []string) *Pool

NewPool creates a Pool with the given names (useful for testing)

func (*Pool) Allocate

func (p *Pool) Allocate(usedNames []string) (string, error)

func (*Pool) Names

func (p *Pool) Names() []string

func (*Pool) Theme

func (p *Pool) Theme() string

Jump to

Keyboard shortcuts

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