summary

package
v0.0.0-...-bde10b7 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSGroup

type CSGroup struct {
	Group string `json:"group"`
	Hosts []Host `json:"hosts"`
}

CSGroup is a concourse summary group

type CSGroups

type CSGroups []CSGroup

CSGroups is a collection of concourse summary groups

type Config

type Config struct {
	RefreshInterval   int
	CSGroups          CSGroups
	Hosts             []Host
	SkipSSLValidation bool
	Templates         *template.Template
	Protocol          string
	Team              string
}

Config - configuration object for summary

func SetupConfig

func SetupConfig(refreshInterval, groupsJSON, hostsJSON, skipSSLValidationString, teamName string) (*Config, error)

SetupConfig sets up a config object for summary, adding default values where appropriate

func (*Config) GroupSummary

func (config *Config) GroupSummary(w http.ResponseWriter, r *http.Request)

GroupSummary renders and serves the group

func (*Config) HostSummary

func (config *Config) HostSummary(w http.ResponseWriter, r *http.Request)

HostSummary renders and serves the host page

func (*Config) Index

func (config *Config) Index(w http.ResponseWriter, r *http.Request)

Index renders and serves the index page

type Data

type Data struct {
	Pipeline       string
	Group          string
	URL            string `json:"pipeline_url"`
	Running        bool
	Paused         bool
	BrokenResource bool
	Statuses       map[string]int
}

Data concourse data structure

func (Data) Percent

func (d Data) Percent(status string) int

Percent calculate the a percentage value for a particular status from data statuses

type GroupData

type GroupData struct {
	Host     string
	Statuses []Data
}

GroupData a grouping structure for Data

type Host

type Host struct {
	FQDN      string     `json:"fqdn"`
	Pipelines []Pipeline `json:"pipelines"`
}

Host is a concourse host defined within a concourse summary group

type Pipeline

type Pipeline struct {
	Name   string   `json:"name"`
	Groups []string `json:"groups"`
}

Pipeline is a pipeline definted within a concourse summary group host

type Server

type Server struct {
	Config *Config
}

Server struct

func CreateServer

func CreateServer(config *Config) *Server

CreateServer - creates a server

func (*Server) Start

func (s *Server) Start() *mux.Router

Start - starts the web server

Jump to

Keyboard shortcuts

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