core

package
v0.27.8 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Configs     *Config
	CoreApp     *Core
	SqlBox      *rice.Box
	CssBox      *rice.Box
	ScssBox     *rice.Box
	JsBox       *rice.Box
	TmplBox     *rice.Box
	EmailBox    *rice.Box
	SetupMode   bool
	AllPlugins  []plugin.PluginActions
	UsingAssets bool
)
View Source
var (
	DbSession sqlbuilder.Database
)

Functions

func CheckHash

func CheckHash(password, hash string) bool

func CheckServices

func CheckServices()

func CheckinProcess

func CheckinProcess()

func CompileSASS

func CompileSASS() error

func CopyToPublic

func CopyToPublic(box *rice.Box, folder, file string)

func CountFailures

func CountFailures() uint64

func CountOnline

func CountOnline() int

func Create

func Create(c *Communication) (int64, error)

func CreateAllAssets

func CreateAllAssets()

func CreateDatabase

func CreateDatabase()

func DatabaseMaintence

func DatabaseMaintence()

func DbConnection

func DbConnection(dbType string) error

func DeleteAllSince

func DeleteAllSince(table string, date time.Time)

func DeleteConfig

func DeleteConfig()

func Disable

func Disable(c *Communication)

func DropDatabase

func DropDatabase()

func Enable

func Enable(c *Communication)

func ExportIndexHTML

func ExportIndexHTML() string

func HasAssets

func HasAssets() bool

func InsertDefaultComms

func InsertDefaultComms()

func LoadComms

func LoadComms()

func LoadDefaultCommunications

func LoadDefaultCommunications()

func LoadSampleData

func LoadSampleData() error

func MakePublicFolder

func MakePublicFolder(folder string)

func OnDeletedService

func OnDeletedService(s *Service)

func OnFailure

func OnFailure(s *Service)

func OnLoad

func OnLoad(db sqlbuilder.Database)

func OnNewService

func OnNewService(s *Service)

func OnNewUser

func OnNewUser(u *User)

func OnSettingsSaved

func OnSettingsSaved(c *Core)

func OnSuccess

func OnSuccess(s *Service)

func OnUpdateService

func OnUpdateService(s *Service)

func OpenAsset

func OpenAsset(file string) string

func Run

func Run(c *Communication)

func RunDatabaseUpgrades

func RunDatabaseUpgrades()

func SaveAsset

func SaveAsset(data, file string)

func SaveFile

func SaveFile(filename string, data []byte) error

func SelectPlugin

func SelectPlugin(name string) plugin.PluginActions

Types

type Checkin

type Checkin types.Checkin

func FindCheckin

func FindCheckin(api string) *Checkin

func SelectCheckinApi

func SelectCheckinApi(api string) *Checkin

func (*Checkin) Ago

func (f *Checkin) Ago() string

func (*Checkin) Create

func (u *Checkin) Create() (int64, error)

func (*Checkin) CreateFailure

func (f *Checkin) CreateFailure()

func (*Checkin) Receivehit

func (c *Checkin) Receivehit()

func (*Checkin) RecheckCheckinFailure

func (c *Checkin) RecheckCheckinFailure(guard chan struct{})

func (*Checkin) Run

func (c *Checkin) Run()

func (*Checkin) String

func (c *Checkin) String() string

type Communication

type Communication types.Communication

func SelectAllCommunications

func SelectAllCommunications() ([]*Communication, error)

func SelectCommunication

func SelectCommunication(id int64) *Communication

func Update

func Update(c *Communication) *Communication

type Config

type Config types.Config

func LoadConfig

func LoadConfig() (*Config, error)

type Core

type Core struct {
	Name        string `db:"name"`
	Description string `db:"description"`
	Config      string `db:"config"`
	ApiKey      string `db:"api_key"`
	ApiSecret   string `db:"api_secret"`
	Style       string `db:"style"`
	Footer      string `db:"footer"`
	Domain      string `db:"domain"`
	Version     string `db:"version"`
	Services    []*Service
	Plugins     []plugin.Info
	Repos       []PluginJSON
	//PluginFields   []PluginSelect
	Communications []*Communication
	OfflineAssets  bool
}

func SelectCore

func SelectCore() (*Core, error)

func (Core) AllOnline

func (c Core) AllOnline() bool

func (Core) BaseSASS

func (c Core) BaseSASS() string

func (Core) SassVars

func (c Core) SassVars() string

func (*Core) Update

func (c *Core) Update() (*Core, error)

func (Core) UsingAssets

func (c Core) UsingAssets() bool

type DateScan

type DateScan struct {
	CreatedAt time.Time `json:"x"`
	Value     int64     `json:"y"`
}

type DbConfig

type DbConfig types.DbConfig

func (*DbConfig) Clean

func (c *DbConfig) Clean() *DbConfig

func (*DbConfig) Save

func (c *DbConfig) Save() error

type ErrorResponse

type ErrorResponse struct {
	Error string
}

type Failure

type Failure types.Failure

func (*Failure) Ago

func (f *Failure) Ago() string

func (*Failure) Delete

func (f *Failure) Delete() error

func (*Failure) ParseError

func (f *Failure) ParseError() string

type FailureData

type FailureData types.FailureData

type Hit

type Hit types.Hit

type HitData

type HitData struct {
	Latency float64
}

type PluginJSON

type PluginJSON types.PluginJSON

type PluginRepos

type PluginRepos types.PluginRepos

type Service

type Service struct {
	Id             int64      `db:"id,omitempty" json:"id"`
	Name           string     `db:"name" json:"name"`
	Domain         string     `db:"domain" json:"domain"`
	Expected       string     `db:"expected" json:"expected"`
	ExpectedStatus int        `db:"expected_status" json:"expected_status"`
	Interval       int        `db:"check_interval" json:"check_interval"`
	Type           string     `db:"check_type" json:"type"`
	Method         string     `db:"method" json:"method"`
	PostData       string     `db:"post_data" json:"post_data"`
	Port           int        `db:"port" json:"port"`
	CreatedAt      time.Time  `db:"created_at" json:"created_at"`
	Online         bool       `json:"online"`
	Latency        float64    `json:"latency"`
	Online24Hours  float32    `json:"24_hours_online"`
	AvgResponse    string     `json:"avg_response"`
	TotalUptime    string     `json:"uptime"`
	OrderId        int64      `json:"order_id"`
	Failures       []*Failure `json:"failures"`
	Checkins       []*Checkin `json:"checkins"`

	LastResponse   string
	LastStatusCode int
	LastOnline     time.Time
	// contains filtered or unexported fields
}

func SelectAllServices

func SelectAllServices() ([]*Service, error)

func SelectService

func SelectService(id int64) *Service

func (*Service) AvgTime

func (s *Service) AvgTime() float64

func (*Service) AvgUptime

func (s *Service) AvgUptime() string

func (*Service) Check

func (s *Service) Check() *Service

func (*Service) CheckQueue

func (s *Service) CheckQueue()

func (*Service) Create

func (u *Service) Create() (int64, error)

func (*Service) CreateFailure

func (s *Service) CreateFailure(data FailureData) (int64, error)

func (*Service) CreateHit

func (s *Service) CreateHit(d HitData) (int64, error)

func (*Service) Delete

func (u *Service) Delete() error

func (*Service) DeleteFailures

func (u *Service) DeleteFailures()

func (*Service) Failure

func (s *Service) Failure(issue string)

func (*Service) GraphData

func (s *Service) GraphData() string

func (*Service) Hits

func (s *Service) Hits() ([]Hit, error)

func (*Service) LimitedFailures

func (s *Service) LimitedFailures() []*Failure

func (*Service) LimitedHits

func (s *Service) LimitedHits() ([]*Hit, error)

func (*Service) Online24

func (s *Service) Online24() float32

func (*Service) Record

func (s *Service) Record(response *http.Response)

func (*Service) RemoveArray

func (u *Service) RemoveArray() []*Service

func (*Service) SelectAllCheckins

func (s *Service) SelectAllCheckins() []*Checkin

func (*Service) SelectAllFailures

func (s *Service) SelectAllFailures() []*Failure

func (*Service) SelectHitsGroupBy

func (s *Service) SelectHitsGroupBy(group string) ([]Hit, error)

func (*Service) StartCheckins

func (s *Service) StartCheckins()

func (*Service) Sum

func (s *Service) Sum() (float64, error)

func (*Service) TotalFailures

func (s *Service) TotalFailures() (uint64, error)

func (*Service) TotalFailures24Hours

func (s *Service) TotalFailures24Hours() (uint64, error)

func (*Service) TotalHits

func (s *Service) TotalHits() (uint64, error)

func (*Service) Update

func (u *Service) Update()

type User

type User types.User

func AuthUser

func AuthUser(username, password string) (*User, bool)

func SelectAllUsers

func SelectAllUsers() ([]User, error)

func SelectUser

func SelectUser(id int64) (*User, error)

func SelectUsername

func SelectUsername(username string) (*User, error)

func (*User) Create

func (u *User) Create() (int64, error)

func (*User) Delete

func (u *User) Delete() error

Jump to

Keyboard shortcuts

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