core

package
v0.90.74 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.90.14

func New(version, commit string)

func Samples

func Samples() error

func SetDB

func SetDB(database database.Database)

Types

type AllNotifiers

type AllNotifiers interface{}

AllNotifiers contains all the Notifiers loaded

type Core

type Core struct {
	Name          string          `gorm:"not null;column:name" json:"name,omitempty"`
	Description   string          `gorm:"not null;column:description" json:"description,omitempty"`
	ConfigFile    string          `gorm:"column:config" json:"-"`
	ApiSecret     string          `gorm:"column:api_secret" json:"api_secret" scope:"admin"`
	Style         string          `gorm:"not null;column:style" json:"style,omitempty"`
	Footer        null.NullString `gorm:"column:footer" json:"footer"`
	Domain        string          `gorm:"not null;column:domain" json:"domain"`
	Version       string          `gorm:"column:version" json:"version"`
	Commit        string          `gorm:"-" json:"commit"`
	Language      string          `gorm:"column:language" json:"language"`
	Setup         bool            `gorm:"-" json:"setup"`
	MigrationId   int64           `gorm:"column:migration_id" json:"migration_id,omitempty"`
	UseCdn        null.NullBool   `gorm:"column:use_cdn;default:false" json:"using_cdn,omitempty"`
	AllowReports  null.NullBool   `gorm:"column:allow_reports;default:false" json:"allow_reports,omitempty"`
	CreatedAt     time.Time       `gorm:"column:created_at" json:"created_at"`
	UpdatedAt     time.Time       `gorm:"column:updated_at" json:"updated_at"`
	Started       time.Time       `gorm:"-" json:"started_on"`
	Notifications []AllNotifiers  `gorm:"-" json:"-"`
	Integrations  []Integrator    `gorm:"-" json:"-"`

	OAuth `json:"-"`
}

Core struct contains all the required fields for Statping. All application settings will be saved into 1 row in the 'core' table. You can use the core.CoreApp global variable to interact with the attributes to the application, such as services.

var (
	App *Core
)

func Example added in v0.90.56

func Example() *Core

func Select

func Select() (*Core, error)

func (*Core) AfterFind added in v0.90.53

func (c *Core) AfterFind()

func (*Core) Create

func (c *Core) Create() error

func (*Core) Delete

func (c *Core) Delete() error

func (Core) TableName

func (Core) TableName() string

func (*Core) Update

func (c *Core) Update() error

type Integrator

type Integrator interface{}

type OAuth added in v0.90.23

type OAuth struct {
	Providers           string        `gorm:"column:oauth_providers;" json:"oauth_providers"`
	GithubClientID      string        `gorm:"column:gh_client_id" json:"gh_client_id"`
	GithubClientSecret  string        `gorm:"column:gh_client_secret" json:"gh_client_secret" scope:"admin"`
	GithubUsers         string        `gorm:"column:gh_users" json:"gh_users" scope:"admin"`
	GithubOrgs          string        `gorm:"column:gh_orgs" json:"gh_orgs" scope:"admin"`
	GoogleClientID      string        `gorm:"column:google_client_id" json:"google_client_id"`
	GoogleClientSecret  string        `gorm:"column:google_client_secret" json:"google_client_secret" scope:"admin"`
	GoogleUsers         string        `gorm:"column:google_users" json:"google_users" scope:"admin"`
	SlackClientID       string        `gorm:"column:slack_client_id" json:"slack_client_id"`
	SlackClientSecret   string        `gorm:"column:slack_client_secret" json:"slack_client_secret" scope:"admin"`
	SlackTeam           string        `gorm:"column:slack_team" json:"slack_team" scope:"admin"`
	SlackUsers          string        `gorm:"column:slack_users" json:"slack_users" scope:"admin"`
	CustomName          string        `gorm:"column:custom_name" json:"custom_name"`
	CustomClientID      string        `gorm:"column:custom_client_id" json:"custom_client_id"`
	CustomClientSecret  string        `gorm:"column:custom_client_secret" json:"custom_client_secret" scope:"admin"`
	CustomEndpointAuth  string        `gorm:"column:custom_endpoint_auth" json:"custom_endpoint_auth"`
	CustomEndpointToken string        `gorm:"column:custom_endpoint_token" json:"custom_endpoint_token" scope:"admin"`
	CustomScopes        string        `gorm:"column:custom_scopes" json:"custom_scopes"`
	CustomIsOpenID      null.NullBool `gorm:"column:custom_open_id" json:"custom_open_id"`
}

Jump to

Keyboard shortcuts

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