question

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package question is used to create questions for the initialize command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAnswers

type ClientAnswers struct {
	ServerURL string `survey:"server-url"`
	Username  string `survey:"username"`
	Password  string `survey:"password"`
}

ClientAnswers are answers to the default client survey.

type Question

type Question struct {
	BeforeText string
	survey.Question
}

Question is a question to ask the user during initialization.

func CreatePasswordQuestion

func CreatePasswordQuestion(cfg *config.Config) *Question

CreatePasswordQuestion returns the default password question.

type RelevantClientQuestion

type RelevantClientQuestion func(*ClientAnswers, *config.Config) (*Question, bool)

RelevantClientQuestion is a function that returns a question and a bool indicating if the question is relevant.

func CreateClientQuestions

func CreateClientQuestions() []RelevantClientQuestion

CreateClientQuestions creates the default set of client questions.

type RelevantServerQuestion

type RelevantServerQuestion func(*ServerAnswers, *config.Config) (*Question, bool)

RelevantServerQuestion is a function that returns a question and a bool indicating if the question is relevant.

func CreateServerQuestions

func CreateServerQuestions() []RelevantServerQuestion

CreateServerQuestions creates the default set of server questions.

type ServerAnswers

type ServerAnswers struct {
	Host           string `survey:"host"`
	Port           string `survey:"port"`
	RemoteURL      string `survey:"remote-url"`
	SecretKey      string `survey:"secret-key"`
	SessionsSecret string `survey:"sessions-secret"`
	Username       string `survey:"username"`
	Password       string `survey:"password"`
}

ServerAnswers are answers to the default server survey

Jump to

Keyboard shortcuts

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