minsse

package
v0.0.0-...-515d911 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets []Asset
View Source
var Stats map[string]StatBlock

Functions

func FakeMovie

func FakeMovie() string

func HandleDetails

func HandleDetails(w http.ResponseWriter, r *http.Request)

func HandleMain

func HandleMain(w http.ResponseWriter, r *http.Request)

HandleMain handler the '/min/' GET route

func HandleStart

func HandleStart(w http.ResponseWriter, r *http.Request)

func HandleStop

func HandleStop(w http.ResponseWriter, r *http.Request)

func MakeUpdate

func MakeUpdate(ctx context.Context, updateCh chan<- Asset)

func Routes

func Routes(r chi.Router)

func Simulate

func Simulate(w http.ResponseWriter, r *http.Request)

func UpdateAsset

func UpdateAsset()

func UpdateCountBlock

func UpdateCountBlock(name string)

func UpdateStatBlock

func UpdateStatBlock(name string, status string)

Types

type Asset

type Asset struct {
	ID      string        `json:"id"`
	Title   string        `json:"title"`
	Status  string        `json:"Status"`
	History []History     `json:"history"`
	Elapsed time.Duration `json:"elapsed"`
	Update  bool          `json:"-"` // flags an asset to be updated, do NOT store in DB
	Monitor string        `json:"-"` // flags an asset to be broadcast on Update, do NOT store in DB
	Counts  StatBlock     `json:"-"` // transport for HeroCard block, do NOT store in DB
	Metrics StatBlock     `json:"-"` // transport for HeroCard block, do NOT store in DB
}

func MakeAsset

func MakeAsset() Asset

type History

type History struct {
	Process     string        `json:"process"`
	Status      string        `json:"status"`
	Description string        `json:"description"`
	Start       time.Time     `json:"start"`
	End         time.Time     `json:"end,omitempty"`
	Elapsed     time.Duration `json:"duration"`
}

type StatBlock

type StatBlock struct {
	Name        string `json:"name"`        // name of this block
	Total       int    `json:"total"`       // total numbers of events processed
	Errors      int    `json:"errors"`      // number of in error status
	ErrorP      string `json:"errorp"`      // percentage of errors
	Failures    int    `json:"failures"`    // number of in failure status
	FailureP    string `json:"failurep"`    // percentage of failures
	Processings int    `json:"processings"` // number of in processing status
	ProcessingP string `json:"processingp"` // Ppercentage of processings
	Pendings    int    `json:"pendings"`    // number of in pending status
	PendingP    string `json:"pendingp"`    // percentage of pendings
	Completeds  int    `json:"completeds"`  // number of in completed status
	CompletedP  string `json:"completedp"`  // percentage of completeds
	Others      int    `json:"others"`      // number of in other status
	OtherP      string `json:"othersp"`     // percentage of others
}

func (*StatBlock) Compute

func (t *StatBlock) Compute()

Jump to

Keyboard shortcuts

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