names.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "time"
  4. "github.com/goombaio/namegenerator"
  5. )
  6. var logoString = retrieveLogo()
  7. // GenerateNodeName - generates a random node name
  8. func GenerateNodeName() string {
  9. seed := time.Now().UTC().UnixNano()
  10. nameGenerator := namegenerator.NewNameGenerator(seed)
  11. return nameGenerator.Generate()
  12. }
  13. // RetrieveLogo - retrieves the ascii art logo for Netmaker
  14. func RetrieveLogo() string {
  15. return logoString
  16. }
  17. // SetLogo - sets the logo ascii art
  18. func SetLogo(logo string) {
  19. logoString = logo
  20. }
  21. func retrieveLogo() string {
  22. return `
  23. __ __ ______ ______ __ __ ______ __ __ ______ ______
  24. /\ "-.\ \ /\ ___\ /\__ _\ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \
  25. \ \ \-. \ \ \ __\ \/_/\ \/ \ \ \-./\ \ \ \ __ \ \ \ _"-. \ \ __\ \ \ __<
  26. \ \_\\"\_\ \ \_____\ \ \_\ \ \_\ \ \_\ \ \_\ \_\ \ \_\ \_\ \ \_____\ \ \_\ \_\
  27. \/_/ \/_/ \/_____/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/
  28. `
  29. }