progress

package
v0.0.0-...-38b8b32 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunServer

func RunServer() error

RunServer starts an embedded nats server

func Serve

func Serve(logfile string, kubeconfig string, port string, status Events)

func ServeDuration

func ServeDuration()

func UpdateProgressComplete

func UpdateProgressComplete(complete bool)

func UpdateProgressCompletedSuccessfully

func UpdateProgressCompletedSuccessfully(completedSuccessfully bool)

Types

type Events

type Events interface {
	Publish(*StatusEvent) error
	Subscribe(func(*StatusEvent)) error
}

Events interface for publish/subscribing to events

func NewNatsPubSub

func NewNatsPubSub(url string, subj string) (Events, error)

NewNatsPubSub returns an Events interface for Publishing and Subscribing to Events

type Status

type Status struct {
	Complete              bool     `json:"complete"`
	CompletedSuccessfully bool     `json:"completedSuccessfully"`
	Messages              []string `json:"messages"`
}

type StatusEvent

type StatusEvent struct {
	Type  string
	Msg   string
	Level string
}

StatusEvent is type that is used for pub/sub of events

func (StatusEvent) String

func (s StatusEvent) String() string

String of StatusEvent

func (StatusEvent) ToLogrusFields

func (s StatusEvent) ToLogrusFields() logrus.Fields

ToLogrusFields is a helper for the logrus library

Jump to

Keyboard shortcuts

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