Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶ added in v1.1.0
func Render(ctx context.Context, out FileWriteFlusher, r DynamicRenderer) error
Render renders r periodically to out. Render stops when there the ctx is canceled or r is done listening to new events. While Render is executing, the terminal cursor is hidden and updates are written in-place.
Types ¶
type DynamicRenderer ¶ added in v1.1.0
type DynamicRenderer interface {
Renderer
Done() <-chan struct{}
}
DynamicRenderer is a Renderer that can notify that its internal states are Done updating. DynamicRenderer is implemented by components that listen to events from a streamer and update their state.
func ListeningResourceRenderer ¶ added in v1.1.0
func ListeningResourceRenderer(streamer StackSubscriber, logicalID, description string, opts RenderOptions) DynamicRenderer
ListeningResourceRenderer returns a tab-separated component that listens for CloudFormation stack events for a particular resource.
func ListeningStackRenderer ¶ added in v1.1.0
func ListeningStackRenderer(streamer StackSubscriber, stackName, description string, changes []Renderer, opts RenderOptions) DynamicRenderer
ListeningStackRenderer returns a tree component that listens for CloudFormation resource events from a stack mutated with a changeSet until the streamer stops.
type FileWriteFlusher ¶ added in v1.1.0
type FileWriteFlusher interface {
FileWriter
WriteFlusher
}
FileWriteFlusher is the interface that groups a FileWriter and WriteFlusher.
type FileWriter ¶ added in v1.1.0
FileWriter is the interface grouping an io.Writer with the file descriptor method Fd. Files in the OS, like os.Stderr, implement the FileWriter interface.
type RenderOptions ¶ added in v1.1.0
type RenderOptions struct {
Padding int // Leading spaces before rendering the component.
}
RenderOptions holds optional style configuration for renderers.
func NestedRenderOptions ¶ added in v1.1.0
func NestedRenderOptions(opts RenderOptions) RenderOptions
NestedRenderOptions takes a RenderOptions and returns the same RenderOptions but with additional padding.
type Renderer ¶ added in v1.1.0
Renderer is the interface to print a component to a writer. It returns the number of lines printed and the error if any.
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner represents an indicator that an asynchronous operation is taking place.
For short operations, less than 4 seconds, display only the spinner with the Start and Stop methods. For longer operations, display intermediate progress events using the Events method.
func NewSpinner ¶
NewSpinner returns a spinner that outputs to w.
type StackSubscriber ¶ added in v1.1.0
type StackSubscriber interface {
Subscribe() <-chan stream.StackEvent
}
StackSubscriber is the interface to subscribe channels to a CloudFormation stack stream event.
type TabbedFileWriter ¶ added in v1.1.0
type TabbedFileWriter struct {
FileWriter
WriteFlusher
}
TabbedFileWriter is a FileWriter that also implements the WriteFlusher interface. A TabbedFileWriter can properly align text separated by the '\t' character.
func NewTabbedFileWriter ¶ added in v1.1.0
func NewTabbedFileWriter(fw FileWriter) *TabbedFileWriter
NewTabbedFileWriter takes a file as input and returns a FileWriteFlusher that can properly write tab-separated text to it.
type WriteFlusher ¶ added in v1.1.0
WriteFlusher is the interface grouping an io.Writer with the Flush method. Flush allows writing buffered writes from Writer all at once.