mortems

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDate = errors.New("no date of format \"July 1, 2020\" (no st, nd, th)")
View Source
var ErrNoDetect = errors.New("no time to detect of format \"| Time to Detect | x unit[, y smaller_unit] |\"")
View Source
var ErrNoDowntime = errors.New("no total downtime format \"| Total Downtime | x unit[, y smaller_unit] |\"")
View Source
var ErrNoOwner = errors.New("no owner of format \"Owner: First Last\"")
View Source
var ErrNoResolve = errors.New("no time to resolve of format \"| Time to Resolve | x unit[, y smaller_unit] |\"")
View Source
var ErrNoSeverity = errors.New("no severity of format \"| Severity | sev |\"")
View Source
var ErrNoTitle = errors.New("no title of format \"# Title Here\"")

Functions

func GenerateReadme

func GenerateReadme(mortems []MortemData) string

func ParseDate

func ParseDate(content string) (time.Time, error)

func ParseDetect

func ParseDetect(content string) (time.Duration, error)

func ParseDowntime

func ParseDowntime(content string) (time.Duration, error)

func ParseOwner

func ParseOwner(content string) (string, error)

func ParseResolve

func ParseResolve(content string) (time.Duration, error)

func ParseSeverity

func ParseSeverity(content string) (string, error)

func ParseTitle

func ParseTitle(content string) (string, error)

Types

type DatadogReporter added in v1.2.1

type DatadogReporter struct {
	// contains filtered or unexported fields
}

func (*DatadogReporter) ReportDetect added in v1.2.1

func (d *DatadogReporter) ReportDetect(detect time.Duration, severity string) error

func (*DatadogReporter) ReportDowntime added in v1.2.1

func (d *DatadogReporter) ReportDowntime(downtime time.Duration, severity string) error

func (*DatadogReporter) ReportResolve added in v1.2.1

func (d *DatadogReporter) ReportResolve(resolve time.Duration, severity string) error

func (*DatadogReporter) ReportSeverity added in v1.2.1

func (d *DatadogReporter) ReportSeverity(severity string) error

type File

type File struct {
	Path    string
	Mode    string
	Type    string
	Content string
}

func (*File) GetContent

func (f *File) GetContent() string

func (*File) GetMode

func (f *File) GetMode() string

func (*File) GetPath

func (f *File) GetPath() string

func (*File) GetType

func (f *File) GetType() string

type GitHub

type GitHub struct {
	// contains filtered or unexported fields
}

func (*GitHub) CommitNewFiles

func (g *GitHub) CommitNewFiles(updateEntries *RepoFiles) error

func (*GitHub) GetFiles

func (g *GitHub) GetFiles() (*RepoFiles, error)

type LocalFileService

type LocalFileService struct {
	// contains filtered or unexported fields
}

func (*LocalFileService) CommitNewFiles

func (s *LocalFileService) CommitNewFiles(files *RepoFiles) error

func (*LocalFileService) GetFiles

func (s *LocalFileService) GetFiles() (*RepoFiles, error)

type MortemCollector

type MortemCollector struct {
	Repo     RepoFileService
	Reporter ReportingService
	// contains filtered or unexported fields
}

func NewMortemCollector

func NewMortemCollector(fileService RepoFileService) MortemCollector

func NewMortemReportingCollector added in v1.2.1

func NewMortemReportingCollector(fileService RepoFileService, reportingService ReportingService) MortemCollector

func (*MortemCollector) Check

func (m *MortemCollector) Check() (RepoFiles, error)

func (*MortemCollector) Collect

func (m *MortemCollector) Collect() error

type MortemData

type MortemData struct {
	File     string        `json:"file"`
	Title    string        `json:"title"`
	Owner    string        `json:"owner"`
	Date     time.Time     `json:"date"`
	Severity string        `json:"severity"`
	Detect   time.Duration `json:"detect"`
	Resolve  time.Duration `json:"resolve"`
	Downtime time.Duration `json:"total_down"`
}

func NewMortemData

func NewMortemData(content, path string) (MortemData, error)

type RepoFileService

type RepoFileService interface {
	GetFiles() (*RepoFiles, error)
	CommitNewFiles(*RepoFiles) error
}

func NewGitHubService

func NewGitHubService(token, fullRepository, ref string) RepoFileService

func NewLocalFileService

func NewLocalFileService(repoPath string) RepoFileService

type RepoFiles

type RepoFiles struct {
	Files []*File
}

func (*RepoFiles) AddExecutableFile added in v1.2.1

func (r *RepoFiles) AddExecutableFile(path, content string)

func (*RepoFiles) AddFile

func (r *RepoFiles) AddFile(path, content string)

func (*RepoFiles) GetFile

func (r *RepoFiles) GetFile(path string) *File

func (*RepoFiles) Size

func (r *RepoFiles) Size() int

func (*RepoFiles) ToTreeEntries

func (r *RepoFiles) ToTreeEntries() []*github.TreeEntry

type ReportingService added in v1.2.1

type ReportingService interface {
	ReportSeverity(string) error
	ReportDetect(detect time.Duration, severity string) error
	ReportResolve(resolve time.Duration, severity string) error
	ReportDowntime(downtime time.Duration, severity string) error
}

func NewDatadogReporter added in v1.2.1

func NewDatadogReporter() ReportingService

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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