daemon

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncRequest

func AsyncRequest(endpoint string, body interface{}) (map[string]interface{}, error)

func SimpleRequest

func SimpleRequest(endpoint string, body interface{}) error

func SyncRequest

func SyncRequest(endpoint string, body interface{}) (interface{}, error)

Types

type CheckboxPromptBody

type CheckboxPromptBody struct {
	PromptEnvelope
	Choices        []string
	DefaultSet     bool
	DefaultIndex   []int
	DefaultValue   []string
	DefaultIsValue bool
}

CheckboxPromptBody is the JSON body for a checkbox prompt

func (CheckboxPromptBody) MarshalJSON

func (n CheckboxPromptBody) MarshalJSON() ([]byte, error)

MarshalJSON marshals the correct set of fields for the CheckboxPromptBody

type ConfirmPromptBody

type ConfirmPromptBody struct {
	PromptEnvelope
	Default bool `json:"default"`
}

ConfirmPromptBody is the JSON body for a confirm prompt

type DatetimePromptBody

type DatetimePromptBody struct {
	PromptEnvelope
	Variant string `json:"variant"`
	Default string `json:"default,omitempty"`
	Maximum string `json:"maximum,omitempty"`
	Minimum string `json:"minimum,omitempty"`
}

DatetimePromptBody is the JSON body for a datetime prompt

type EditorPromptBody

type EditorPromptBody struct {
	PromptEnvelope
	Default string `json:"default"`
}

EditorPromptBody is the JSON body for a editor prompt

type EventsBody

type EventsBody struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type GetSecretBody

type GetSecretBody struct {
	Key    string `json:"key"`
	Hidden bool   `json:"hidden"`
}

GetSecretBody is the JSON body expected by the /secret/get endpoint

type InputPromptBody

type InputPromptBody struct {
	PromptEnvelope
	Default    string `json:"default,omitempty"`
	AllowEmpty bool   `json:"allowEmpty"`
}

InputPromptBody is the JSON body for an input prompt

type ListPromptBody

type ListPromptBody struct {
	PromptEnvelope
	Choices        []string
	DefaultSet     bool
	DefaultIndex   int
	DefaultValue   string
	DefaultIsValue bool
}

ListPromptBody is the JSON body for a list or autocomplete prompt

func (ListPromptBody) MarshalJSON

func (n ListPromptBody) MarshalJSON() ([]byte, error)

MarshalJSON marshals the correct set of fields for the ListPromptBody

type NumberPromptBody

type NumberPromptBody struct {
	PromptEnvelope
	DefaultValue int
	DefaultSet   bool
	MaximumValue int
	MaximumSet   bool
	MinimumValue int
	MinimumSet   bool
}

NumberPromptBody is the JSON body for a number prompt

func (NumberPromptBody) MarshalJSON

func (n NumberPromptBody) MarshalJSON() ([]byte, error)

MarshalJSON marshals the correct set of fields for the NumberPromptBody

type PasswordPromptBody

type PasswordPromptBody struct {
	PromptEnvelope
	Confirm bool `json:"confirm"`
}

PasswordPromptBody is the JSON body for a password prompt

type PrintBody

type PrintBody struct {
	Text string `json:"text"`
}

type ProgressBarAdvanceBody

type ProgressBarAdvanceBody struct {
	Increment int `json:"increment,omitempty"`
}

type ProgressBarStartBody

type ProgressBarStartBody struct {
	Length  int    `json:"length"`
	Initial int    `json:"initial"`
	Text    string `json:"text"`
}

type ProgressBarStopBody

type ProgressBarStopBody = SpinnerStopBody

type PromptEnvelope

type PromptEnvelope struct {
	Name       string `json:"name"`
	PromptType string `json:"type"`
	Message    string `json:"message"`
	Flag       string `json:"flag,omitempty"`
}

PromptEnvelope is the common fields for all prompt type JSON bodies

type SecretPromptBody

type SecretPromptBody = PromptEnvelope

SecretPromptBody is the JSON body for a secret prompt

type SetSecretBody

type SetSecretBody struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type SpinnerStartBody

type SpinnerStartBody = PrintBody

type SpinnerStopBody

type SpinnerStopBody struct {
	Text string `json:"text,omitempty"`
}

Jump to

Keyboard shortcuts

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