models

package
v0.0.0-...-687c1ae Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	BaseModel
	AlertChannal   *AlertChannal `json:"alert_channal,omitempty"`
	AlertChannalID uint          `json:"alert_channal_id"`
	Status         uint          `json:"status"`
	User           *User         `json:"user,omitempty"`
	UserID         uint          `json:"user_id"`
}

swagger:parameters Alert

type AlertChannal

type AlertChannal struct {
	BaseModel
	Name      string  `json:"name"`
	Alerts    []Alert `json:"alerts"`
	User      *User   `json:"user,omitempty"`
	UserID    uint    `json:"user_id"`
	IsEnabled bool    `json:"is_enabled"`
	Type      uint    `json:"type"`
	Config    []byte  `json:"config"`
}

swagger:parameters AlertChannal

type BaseModel

type BaseModel struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
	DeletedAt time.Time `json:"-" gorm:"index"`
}

type Endpoint

type Endpoint struct {
	BaseModel
	// in:body
	Name      string  `json:"name"`
	User      *User   `json:"user,omitempty"`
	UserID    uint    `json:"user_id"`
	URL       string  `json:"url"`
	Interval  uint    `json:"interval"`
	IsEnabled bool    `json:"is_enabled"`
	IsPublic  bool    `json:"is_public"`
	Alerts    []Alert `json:"alerts"`
}

swagger:response Endpoint

type User

type User struct {
	BaseModel

	Username      string         `json:"username" gorm:"index"`
	Password      string         `json:"password,omitempty"`
	Email         string         `json:"email"`
	IsAdmin       bool           `json:"is_admin"`
	Endpoints     []Endpoint     `json:"endpoints"`
	Alerts        []Alert        `json:"alerts"`
	AlertChannals []AlertChannal `json:"alert_channals"`
}

Jump to

Keyboard shortcuts

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