data

package
v0.0.0-...-ea57e7b Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmtpyRootDocument = RootDocument{
	Events:     make(map[string]*Event),
	Components: make(map[string]*Component),
}

Functions

This section is empty.

Types

type Component

type Component struct {
	// Not yet used
	ID        string    `json:"id"`
	Indicator string    `json:"indicator"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Database

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

func NewDBFromFilePath

func NewDBFromFilePath(filePath string) Database

func (*Database) EnsureInitialized

func (db *Database) EnsureInitialized() error

func (*Database) Load

func (db *Database) Load() (*RootDocument, error)

func (*Database) Store

func (db *Database) Store(document *RootDocument) error

type Event

type Event struct {
	ID               string           `json:"id"`
	UpdatedAt        time.Time        `json:"updated"`
	MessageReference tb.StoredMessage `json:"message_reference"`
}

An Event is either a incident or a scheduled maintenance, associated with a Telegram message.

type RootDocument

type RootDocument struct {
	GlobalStatusIndicator string                `json:"global_status_indicator"`
	Events                map[string]*Event     `json:"events"`
	Components            map[string]*Component `json:"component"`
}

type Storage

type Storage struct {
	FilePath string
}

A Storage backed by JSON, simplistic

func (*Storage) EnsureInitialized

func (s *Storage) EnsureInitialized(empty interface{}) error

func (*Storage) Load

func (s *Storage) Load(data interface{}) error

func (*Storage) Store

func (s *Storage) Store(data interface{}) error

Jump to

Keyboard shortcuts

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