registry

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const CLIVersion string = "2.2.8"

CLIVersion version of Create Go App CLI.

Variables

View Source
var (
	// EmbedMiscFiles misc files and configs.
	//go:embed misc/*
	EmbedMiscFiles embed.FS

	// EmbedRoles Ansible roles.
	//go:embed roles/*
	EmbedRoles embed.FS

	// EmbedTemplates template files.
	//go:embed templates/*
	EmbedTemplates embed.FS

	// CreateQuestions survey's questions for `create` command.
	CreateQuestions = []*survey.Question{
		{
			Name: "backend",
			Prompt: &survey.Select{
				Message: "Choose a backend framework:",
				Options: []string{
					"net/http",
					"fiber",
				},
				Default:  "fiber",
				PageSize: 2,
			},
			Validate: survey.Required,
		},
		{
			Name: "frontend",
			Prompt: &survey.Select{
				Message: "Choose a frontend framework/library:",
				Help:    "Option with a `*-ts` tail will create a TypeScript template.",
				Options: []string{
					"none",
					"vanilla",
					"vanilla-ts",
					"react",
					"react-ts",
					"preact",
					"preact-ts",
					"vue",
					"vue-ts",
					"svelte",
					"svelte-ts",
					"lit-element",
					"lit-element-ts",
				},
				Default:  "none",
				PageSize: 13,
			},
		},
		{
			Name: "proxy",
			Prompt: &survey.Select{
				Message: "Choose a web/proxy server:",
				Options: []string{
					"none",
					"traefik",
					"traefik-acme-dns",
					"nginx",
				},
				Default:  "none",
				PageSize: 4,
			},
		},
		{
			Name: "agree",
			Prompt: &survey.Confirm{
				Message: "If everything is okay, can I create this project for you? ;)",
				Default: true,
			},
		},
	}

	// CustomCreateQuestions survey's questions for `create -c` command.
	CustomCreateQuestions = []*survey.Question{
		{
			Name: "backend",
			Prompt: &survey.Input{
				Message: "Enter URL to the custom backend repository:",
				Help:    "No need to specify `http://` or `https://` protocol.",
			},
			Validate: survey.Required,
		},
		{
			Name: "frontend",
			Prompt: &survey.Input{
				Message: "Enter URL to the custom frontend repository:",
				Help:    "No need to specify `http://` or `https://` protocol.",
				Default: "none",
			},
		},
		{
			Name: "proxy",
			Prompt: &survey.Select{
				Message: "Choose a web/proxy server:",
				Options: []string{
					"none",
					"traefik",
					"traefik-acme-dns",
					"nginx",
				},
				Default:  "none",
				PageSize: 4,
			},
		},
		{
			Name: "agree",
			Prompt: &survey.Confirm{
				Message: "If everything is okay, can I create this project for you? ;)",
				Default: true,
			},
		},
	}

	// AnsibleInventoryVariables list of variables for inventory.
	AnsibleInventoryVariables = map[string]*Variables{
		"none": {
			List: map[string]interface{}{
				"Proxy": "none",
			},
		},
		"traefik": {
			List: map[string]interface{}{
				"Proxy":    "traefik",
				"Wildcard": false,
			},
		},
		"traefik-acme-dns": {
			List: map[string]interface{}{
				"Proxy":    "traefik",
				"Wildcard": true,
			},
		},
		"nginx": {
			List: map[string]interface{}{
				"Proxy": "nginx",
			},
		},
	}

	// AnsiblePlaybookVariables list of variables for playbook.
	AnsiblePlaybookVariables = map[string]*Variables{
		"none": {
			List: map[string]interface{}{
				"Proxy": "none",
			},
		},
		"traefik": {
			List: map[string]interface{}{
				"Proxy": "traefik",
			},
		},
		"traefik-acme-dns": {
			List: map[string]interface{}{
				"Proxy": "traefik",
			},
		},
		"nginx": {
			List: map[string]interface{}{
				"Proxy": "nginx",
			},
		},
	}
)

Functions

This section is empty.

Types

type CreateAnswers

type CreateAnswers struct {
	Backend       string
	Frontend      string
	Proxy         string
	AgreeCreation bool `survey:"agree"`
}

CreateAnswers struct for a survey's answers for `create` command.

type Variables

type Variables struct {
	List map[string]interface{}
}

Variables struct for Ansible variables (inventory, hosts).

Jump to

Keyboard shortcuts

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