ux

package
v0.0.0-...-2ae13ec Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationAsText

func DurationAsText(d time.Duration) string

DurationAsText provides a slightly nicer string representation of a duration when compared to default formatting in go, by spelling out the words hour, minute and second and providing some spacing and eliding the fractional component of the seconds part.

func ListAsText

func ListAsText(items []string) string

generates text from a list of strings, for example: ["foo"] => "foo" ["foo", "bar"] => "foo and bar" ["foo", "bar", "axe"] => "foo, bar and axe" ["foo", "bar", ..., ..., "axe"] => "foo, bar, ..., ... and axe"

Types

type ActionResult

type ActionResult struct {
	SuccessMessage string
	FollowUp       string
	Err            error
}

func (*ActionResult) MarshalJSON

func (ar *ActionResult) MarshalJSON() ([]byte, error)

func (*ActionResult) ToString

func (ar *ActionResult) ToString(currentIndentation string) (result string)

type CreatedRepoValue

type CreatedRepoValue struct {
	Name string
	Kind GitHubValueKind
}

func (*CreatedRepoValue) MarshalJSON

func (cr *CreatedRepoValue) MarshalJSON() ([]byte, error)

func (*CreatedRepoValue) ToString

func (cr *CreatedRepoValue) ToString(currentIndentation string) string

type DisplayedResource

type DisplayedResource struct {
	Type  string
	Name  string
	State DisplayedResourceState
}

func (*DisplayedResource) MarshalJSON

func (cr *DisplayedResource) MarshalJSON() ([]byte, error)

func (*DisplayedResource) ToString

func (cr *DisplayedResource) ToString(currentIndentation string) string

type DisplayedResourceState

type DisplayedResourceState string
const (
	SucceededState DisplayedResourceState = "Succeeded"
	FailedState    DisplayedResourceState = "Failed"
)

type DoneMessage

type DoneMessage struct {
	Message string
}

func (*DoneMessage) MarshalJSON

func (d *DoneMessage) MarshalJSON() ([]byte, error)

func (*DoneMessage) ToString

func (d *DoneMessage) ToString(currentIndentation string) string

type EnvironmentDetails

type EnvironmentDetails struct {
	Subscription string
	Location     string
}

func (*EnvironmentDetails) MarshalJSON

func (t *EnvironmentDetails) MarshalJSON() ([]byte, error)

func (*EnvironmentDetails) ToString

func (t *EnvironmentDetails) ToString(currentIndentation string) string

type GitHubValueKind

type GitHubValueKind string
const (
	GitHubSecret   GitHubValueKind = "secret"
	GitHubVariable GitHubValueKind = "variable"
)

type MessageTitle

type MessageTitle struct {
	Title     string
	TitleNote string
}

func (*MessageTitle) MarshalJSON

func (t *MessageTitle) MarshalJSON() ([]byte, error)

func (*MessageTitle) ToString

func (t *MessageTitle) ToString(currentIndentation string) string

type MultilineMessage

type MultilineMessage struct {
	Lines []string
}

func (*MultilineMessage) MarshalJSON

func (mm *MultilineMessage) MarshalJSON() ([]byte, error)

func (*MultilineMessage) ToString

func (mm *MultilineMessage) ToString(currentIndentation string) string

type OperationType

type OperationType string

OperationType defines the valid options for a resource change.

const (
	OperationTypeCreate      OperationType = "Create"
	OperationTypeDelete      OperationType = "Delete"
	OperationTypeDeploy      OperationType = "Deploy"
	OperationTypeIgnore      OperationType = "Ignore"
	OperationTypeModify      OperationType = "Modify"
	OperationTypeNoChange    OperationType = "NoChange"
	OperationTypeUnsupported OperationType = "Unsupported"
)

func (OperationType) String

func (op OperationType) String() (displayName string)

type PreviewProvision

type PreviewProvision struct {
	Operations []*Resource
}

PreviewProvision defines a ux item for displaying a provision preview.

func (*PreviewProvision) MarshalJSON

func (pp *PreviewProvision) MarshalJSON() ([]byte, error)

func (*PreviewProvision) ToString

func (pp *PreviewProvision) ToString(currentIndentation string) string

type Resource

type Resource struct {
	Operation OperationType
	Name      string
	Type      string
}

Resource provides a basic structure for an Azure resource.

type Show

type Show struct {
	AppName         string
	Services        []*ShowService
	Environments    []*ShowEnvironment
	AzurePortalLink string
}

func (*Show) MarshalJSON

func (s *Show) MarshalJSON() ([]byte, error)

func (*Show) ToString

func (s *Show) ToString(currentIndentation string) string

type ShowEnvironment

type ShowEnvironment struct {
	Name      string
	IsCurrent bool
	IsRemote  bool
}

type ShowService

type ShowService struct {
	Name      string
	IngresUrl string
}

type UxItem

type UxItem interface {
	// Defines how the object is transformed into a printable string.
	// The current indentation can be used to make the string to be aligned to the previous lines.
	ToString(currentIndentation string) string
	json.Marshaler
}

type WarningMessage

type WarningMessage struct {
	Description string
	HidePrefix  bool
}

func (*WarningMessage) MarshalJSON

func (t *WarningMessage) MarshalJSON() ([]byte, error)

func (*WarningMessage) ToString

func (t *WarningMessage) ToString(currentIndentation string) string

Jump to

Keyboard shortcuts

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