dtos

package
v0.0.0-...-900be4e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WeightCreate = (iota - 20) * 100
	WeightDashboard
	WeightExplore
	WeightProfile
	WeightAlerting
	WeightPlugin
	WeightConfig
	WeightAdmin
	WeightHelp
)
View Source
const NavIDCfg = "cfg"

NavIDCfg is the id for org configuration navigation node

Variables

This section is empty.

Functions

func GetGravatarUrl

func GetGravatarUrl(text string) string

func GetGravatarUrlWithDefault

func GetGravatarUrlWithDefault(text string, defaultText string) string

func IsHiddenUser

func IsHiddenUser(userLogin string, signedInUser *models.SignedInUser, cfg *setting.Cfg) bool

Types

type AddInviteForm

type AddInviteForm struct {
	LoginOrEmail string          `json:"loginOrEmail" binding:"Required"`
	Name         string          `json:"name"`
	Role         models.RoleType `json:"role" binding:"Required"`
	SendEmail    bool            `json:"sendEmail"`
}

type AdminCreateUserForm

type AdminCreateUserForm struct {
	Email    string `json:"email"`
	Login    string `json:"login"`
	Name     string `json:"name"`
	Password string `json:"password" binding:"Required"`
	OrgId    int64  `json:"orgId"`
}

type AdminUpdateUserPasswordForm

type AdminUpdateUserPasswordForm struct {
	Password string `json:"password" binding:"Required"`
}

type AdminUpdateUserPermissionsForm

type AdminUpdateUserPermissionsForm struct {
	IsGrafargAdmin bool `json:"isGrafargAdmin"`
}

type AlertNotification

type AlertNotification struct {
	Id                    int64            `json:"id"`
	Uid                   string           `json:"uid"`
	Name                  string           `json:"name"`
	Type                  string           `json:"type"`
	IsDefault             bool             `json:"isDefault"`
	SendReminder          bool             `json:"sendReminder"`
	DisableResolveMessage bool             `json:"disableResolveMessage"`
	Frequency             string           `json:"frequency"`
	Created               time.Time        `json:"created"`
	Updated               time.Time        `json:"updated"`
	Settings              *simplejson.Json `json:"settings"`
	SecureFields          map[string]bool  `json:"secureFields"`
}

func NewAlertNotification

func NewAlertNotification(notification *models.AlertNotification) *AlertNotification

type AlertNotificationLookup

type AlertNotificationLookup struct {
	Id        int64  `json:"id"`
	Uid       string `json:"uid"`
	Name      string `json:"name"`
	Type      string `json:"type"`
	IsDefault bool   `json:"isDefault"`
}

func NewAlertNotificationLookup

func NewAlertNotificationLookup(notification *models.AlertNotification) *AlertNotificationLookup

type AlertTestCommand

type AlertTestCommand struct {
	Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
	PanelId   int64            `json:"panelId" binding:"Required"`
}

type AlertTestResult

type AlertTestResult struct {
	Firing         bool                  `json:"firing"`
	State          models.AlertStateType `json:"state"`
	ConditionEvals string                `json:"conditionEvals"`
	TimeMs         string                `json:"timeMs"`
	Error          string                `json:"error,omitempty"`
	EvalMatches    []*EvalMatch          `json:"matches,omitempty"`
	Logs           []*AlertTestResultLog `json:"logs,omitempty"`
}

type AlertTestResultLog

type AlertTestResultLog struct {
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type AnyId

type AnyId struct {
	Id int64 `json:"id"`
}

type CalculateDiffOptions

type CalculateDiffOptions struct {
	Base     CalculateDiffTarget `json:"base" binding:"Required"`
	New      CalculateDiffTarget `json:"new" binding:"Required"`
	DiffType string              `json:"diffType" binding:"Required"`
}

type CalculateDiffTarget

type CalculateDiffTarget struct {
	DashboardId      int64            `json:"dashboardId"`
	Version          int              `json:"version"`
	UnsavedDashboard *simplejson.Json `json:"unsavedDashboard"`
}

type CompleteInviteForm

type CompleteInviteForm struct {
	InviteCode      string `json:"inviteCode"`
	Email           string `json:"email" binding:"Required"`
	Name            string `json:"name"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirmPassword"`
}

type CreateShortURLCmd

type CreateShortURLCmd struct {
	Path string `json:"path"`
}

type CurrentUser

type CurrentUser struct {
	IsSignedIn                 bool              `json:"isSignedIn"`
	Id                         int64             `json:"id"`
	Login                      string            `json:"login"`
	Email                      string            `json:"email"`
	Name                       string            `json:"name"`
	LightTheme                 bool              `json:"lightTheme"`
	OrgCount                   int               `json:"orgCount"`
	OrgId                      int64             `json:"orgId"`
	OrgName                    string            `json:"orgName"`
	OrgRole                    models.RoleType   `json:"orgRole"`
	IsGrafargAdmin             bool              `json:"isGrafargAdmin"`
	GravatarUrl                string            `json:"gravatarUrl"`
	Timezone                   string            `json:"timezone"`
	Locale                     string            `json:"locale"`
	HelpFlags1                 models.HelpFlags1 `json:"helpFlags1"`
	HasEditPermissionInFolders bool              `json:"hasEditPermissionInFolders"`
}

type DashboardAclUpdateItem

type DashboardAclUpdateItem struct {
	UserID     int64                 `json:"userId"`
	TeamID     int64                 `json:"teamId"`
	Role       *models.RoleType      `json:"role,omitempty"`
	Permission models.PermissionType `json:"permission"`
}

type DashboardFullWithMeta

type DashboardFullWithMeta struct {
	Meta      DashboardMeta    `json:"meta"`
	Dashboard *simplejson.Json `json:"dashboard"`
}

type DashboardMeta

type DashboardMeta struct {
	IsStarred             bool      `json:"isStarred,omitempty"`
	IsHome                bool      `json:"isHome,omitempty"`
	IsSnapshot            bool      `json:"isSnapshot,omitempty"`
	Type                  string    `json:"type,omitempty"`
	CanSave               bool      `json:"canSave"`
	CanEdit               bool      `json:"canEdit"`
	CanAdmin              bool      `json:"canAdmin"`
	CanStar               bool      `json:"canStar"`
	Slug                  string    `json:"slug"`
	Url                   string    `json:"url"`
	Expires               time.Time `json:"expires"`
	Created               time.Time `json:"created"`
	Updated               time.Time `json:"updated"`
	UpdatedBy             string    `json:"updatedBy"`
	CreatedBy             string    `json:"createdBy"`
	Version               int       `json:"version"`
	HasAcl                bool      `json:"hasAcl"`
	IsFolder              bool      `json:"isFolder"`
	FolderId              int64     `json:"folderId"`
	FolderTitle           string    `json:"folderTitle"`
	FolderUrl             string    `json:"folderUrl"`
	Provisioned           bool      `json:"provisioned"`
	ProvisionedExternalId string    `json:"provisionedExternalId"`
}

type DashboardRedirect

type DashboardRedirect struct {
	RedirectUri string `json:"redirectUri"`
}

type DataSource

type DataSource struct {
	Id                int64            `json:"id"`
	UID               string           `json:"uid"`
	OrgId             int64            `json:"orgId"`
	Name              string           `json:"name"`
	Type              string           `json:"type"`
	TypeLogoUrl       string           `json:"typeLogoUrl"`
	Access            models.DsAccess  `json:"access"`
	Url               string           `json:"url"`
	Password          string           `json:"password"`
	User              string           `json:"user"`
	Database          string           `json:"database"`
	BasicAuth         bool             `json:"basicAuth"`
	BasicAuthUser     string           `json:"basicAuthUser"`
	BasicAuthPassword string           `json:"basicAuthPassword"`
	WithCredentials   bool             `json:"withCredentials"`
	IsDefault         bool             `json:"isDefault"`
	JsonData          *simplejson.Json `json:"jsonData,omitempty"`
	SecureJsonFields  map[string]bool  `json:"secureJsonFields"`
	Version           int              `json:"version"`
	ReadOnly          bool             `json:"readOnly"`
}

type DataSourceList

type DataSourceList []DataSourceListItemDTO

func (DataSourceList) Len

func (slice DataSourceList) Len() int

func (DataSourceList) Less

func (slice DataSourceList) Less(i, j int) bool

func (DataSourceList) Swap

func (slice DataSourceList) Swap(i, j int)

type DataSourceListItemDTO

type DataSourceListItemDTO struct {
	Id          int64            `json:"id"`
	UID         string           `json:"uid"`
	OrgId       int64            `json:"orgId"`
	Name        string           `json:"name"`
	Type        string           `json:"type"`
	TypeName    string           `json:"typeName"`
	TypeLogoUrl string           `json:"typeLogoUrl"`
	Access      models.DsAccess  `json:"access"`
	Url         string           `json:"url"`
	Password    string           `json:"password"`
	User        string           `json:"user"`
	Database    string           `json:"database"`
	BasicAuth   bool             `json:"basicAuth"`
	IsDefault   bool             `json:"isDefault"`
	JsonData    *simplejson.Json `json:"jsonData,omitempty"`
	ReadOnly    bool             `json:"readOnly"`
}

type DeleteAnnotationsCmd

type DeleteAnnotationsCmd struct {
	AlertId      int64 `json:"alertId"`
	DashboardId  int64 `json:"dashboardId"`
	PanelId      int64 `json:"panelId"`
	AnnotationId int64 `json:"annotationId"`
}

type EvalMatch

type EvalMatch struct {
	Tags   map[string]string `json:"tags,omitempty"`
	Metric string            `json:"metric"`
	Value  null.Float        `json:"value"`
}

type Folder

type Folder struct {
	Id        int64     `json:"id"`
	Uid       string    `json:"uid"`
	Title     string    `json:"title"`
	Url       string    `json:"url"`
	HasAcl    bool      `json:"hasAcl"`
	CanSave   bool      `json:"canSave"`
	CanEdit   bool      `json:"canEdit"`
	CanAdmin  bool      `json:"canAdmin"`
	CreatedBy string    `json:"createdBy"`
	Created   time.Time `json:"created"`
	UpdatedBy string    `json:"updatedBy"`
	Updated   time.Time `json:"updated"`
	Version   int       `json:"version"`
}

type FolderSearchHit

type FolderSearchHit struct {
	Id    int64  `json:"id"`
	Uid   string `json:"uid"`
	Title string `json:"title"`
}

type ImportDashboardCommand

type ImportDashboardCommand struct {
	PluginId  string                         `json:"pluginId"`
	Path      string                         `json:"path"`
	Overwrite bool                           `json:"overwrite"`
	Dashboard *simplejson.Json               `json:"dashboard"`
	Inputs    []plugins.ImportDashboardInput `json:"inputs"`
	FolderId  int64                          `json:"folderId"`
}

type IndexViewData

type IndexViewData struct {
	User                    *CurrentUser
	Settings                map[string]interface{}
	AppUrl                  string
	AppSubUrl               string
	GoogleAnalyticsId       string
	GoogleTagManagerId      string
	NavTree                 []*NavLink
	BuildVersion            string
	BuildCommit             string
	Theme                   string
	NewGrafargVersionExists bool
	NewGrafargVersion       string
	AppName                 string
	AppNameBodyClass        string
	FavIcon                 template.URL
	AppleTouchIcon          template.URL
	AppTitle                string
	Sentry                  *setting.Sentry
	ContentDeliveryURL      string
	// Nonce is a cryptographic identifier for use with Content Security Policy.
	Nonce string
}

type InviteInfo

type InviteInfo struct {
	Email     string `json:"email"`
	Name      string `json:"name"`
	Username  string `json:"username"`
	InvitedBy string `json:"invitedBy"`
}

type LoginCommand

type LoginCommand struct {
	User     string `json:"user" binding:"Required"`
	Password string `json:"password" binding:"Required"`
	Remember bool   `json:"remember"`
}

type MetricRequest

type MetricRequest struct {
	From    string             `json:"from"`
	To      string             `json:"to"`
	Queries []*simplejson.Json `json:"queries"`
	Debug   bool               `json:"debug"`
}
type NavLink struct {
	Id           string     `json:"id,omitempty"`
	Text         string     `json:"text,omitempty"`
	Description  string     `json:"description,omitempty"`
	SubTitle     string     `json:"subTitle,omitempty"`
	Icon         string     `json:"icon,omitempty"`
	Img          string     `json:"img,omitempty"`
	Url          string     `json:"url,omitempty"`
	Target       string     `json:"target,omitempty"`
	SortWeight   int64      `json:"sortWeight,omitempty"`
	Divider      bool       `json:"divider,omitempty"`
	HideFromMenu bool       `json:"hideFromMenu,omitempty"`
	HideFromTabs bool       `json:"hideFromTabs,omitempty"`
	Children     []*NavLink `json:"children,omitempty"`
}

type NewApiKeyResult

type NewApiKeyResult struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type NotificationTestCommand

type NotificationTestCommand struct {
	ID                    int64             `json:"id,omitempty"`
	Name                  string            `json:"name"`
	Type                  string            `json:"type"`
	SendReminder          bool              `json:"sendReminder"`
	DisableResolveMessage bool              `json:"disableResolveMessage"`
	Frequency             string            `json:"frequency"`
	Settings              *simplejson.Json  `json:"settings"`
	SecureSettings        map[string]string `json:"secureSettings"`
}

type PatchAnnotationsCmd

type PatchAnnotationsCmd struct {
	Id      int64    `json:"id"`
	Time    int64    `json:"time"`
	TimeEnd int64    `json:"timeEnd,omitempty"` // Optional
	Text    string   `json:"text"`
	Tags    []string `json:"tags"`
}

type PauseAlertCommand

type PauseAlertCommand struct {
	AlertId int64 `json:"alertId"`
	Paused  bool  `json:"paused"`
}

type PauseAllAlertsCommand

type PauseAllAlertsCommand struct {
	Paused bool `json:"paused"`
}

type PlaylistDashboard

type PlaylistDashboard struct {
	Id    int64  `json:"id"`
	Slug  string `json:"slug"`
	Title string `json:"title"`
	Uri   string `json:"uri"`
	Url   string `json:"url"`
	Order int    `json:"order"`
}

type PlaylistDashboardsSlice

type PlaylistDashboardsSlice []PlaylistDashboard

func (PlaylistDashboardsSlice) Len

func (slice PlaylistDashboardsSlice) Len() int

func (PlaylistDashboardsSlice) Less

func (slice PlaylistDashboardsSlice) Less(i, j int) bool

func (PlaylistDashboardsSlice) Swap

func (slice PlaylistDashboardsSlice) Swap(i, j int)

type PluginList

type PluginList []PluginListItem

func (PluginList) Len

func (slice PluginList) Len() int

func (PluginList) Less

func (slice PluginList) Less(i, j int) bool

func (PluginList) Swap

func (slice PluginList) Swap(i, j int)

type PluginListItem

type PluginListItem struct {
	Name          string                        `json:"name"`
	Type          string                        `json:"type"`
	Id            string                        `json:"id"`
	Enabled       bool                          `json:"enabled"`
	Pinned        bool                          `json:"pinned"`
	Info          *plugins.PluginInfo           `json:"info"`
	LatestVersion string                        `json:"latestVersion"`
	HasUpdate     bool                          `json:"hasUpdate"`
	DefaultNavUrl string                        `json:"defaultNavUrl"`
	Category      string                        `json:"category"`
	State         plugins.PluginState           `json:"state"`
	Signature     plugins.PluginSignatureStatus `json:"signature"`
	SignatureType plugins.PluginSignatureType   `json:"signatureType"`
	SignatureOrg  string                        `json:"signatureOrg"`
}

type PluginSetting

type PluginSetting struct {
	Name          string                      `json:"name"`
	Type          string                      `json:"type"`
	Id            string                      `json:"id"`
	Enabled       bool                        `json:"enabled"`
	Pinned        bool                        `json:"pinned"`
	Module        string                      `json:"module"`
	BaseUrl       string                      `json:"baseUrl"`
	Info          *plugins.PluginInfo         `json:"info"`
	Includes      []*plugins.PluginInclude    `json:"includes"`
	Dependencies  *plugins.PluginDependencies `json:"dependencies"`
	JsonData      map[string]interface{}      `json:"jsonData"`
	DefaultNavUrl string                      `json:"defaultNavUrl"`

	LatestVersion string                        `json:"latestVersion"`
	HasUpdate     bool                          `json:"hasUpdate"`
	State         plugins.PluginState           `json:"state"`
	Signature     plugins.PluginSignatureStatus `json:"signature"`
	SignatureType plugins.PluginSignatureType   `json:"signatureType"`
	SignatureOrg  string                        `json:"signatureOrg"`
}

type PostAnnotationsCmd

type PostAnnotationsCmd struct {
	DashboardId int64            `json:"dashboardId"`
	PanelId     int64            `json:"panelId"`
	Time        int64            `json:"time"`
	TimeEnd     int64            `json:"timeEnd,omitempty"` // Optional
	Text        string           `json:"text"`
	Tags        []string         `json:"tags"`
	Data        *simplejson.Json `json:"data"`
}

type PostGraphiteAnnotationsCmd

type PostGraphiteAnnotationsCmd struct {
	When int64       `json:"when"`
	What string      `json:"what"`
	Data string      `json:"data"`
	Tags interface{} `json:"tags"`
}

type Prefs

type Prefs struct {
	Theme           string `json:"theme"`
	HomeDashboardID int64  `json:"homeDashboardId"`
	Timezone        string `json:"timezone"`
}

type ResetUserPasswordForm

type ResetUserPasswordForm struct {
	Code            string `json:"code"`
	NewPassword     string `json:"newPassword"`
	ConfirmPassword string `json:"confirmPassword"`
}

type RestoreDashboardVersionCommand

type RestoreDashboardVersionCommand struct {
	Version int `json:"version" binding:"Required"`
}

type SendResetPasswordEmailForm

type SendResetPasswordEmailForm struct {
	UserOrEmail string `json:"userOrEmail" binding:"Required"`
}

type ShortURL

type ShortURL struct {
	UID string `json:"uid"`
	URL string `json:"url"`
}

type SignUpForm

type SignUpForm struct {
	Email string `json:"email" binding:"Required"`
}

type SignUpStep2Form

type SignUpStep2Form struct {
	Email    string `json:"email"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
	Code     string `json:"code"`
	OrgName  string `json:"orgName"`
}

type UpdateAnnotationsCmd

type UpdateAnnotationsCmd struct {
	Id      int64    `json:"id"`
	Time    int64    `json:"time"`
	TimeEnd int64    `json:"timeEnd,omitempty"` // Optional
	Text    string   `json:"text"`
	Tags    []string `json:"tags"`
}

type UpdateDashboardAclCommand

type UpdateDashboardAclCommand struct {
	Items []DashboardAclUpdateItem `json:"items"`
}

type UpdateOrgAddressForm

type UpdateOrgAddressForm struct {
	Address1 string `json:"address1"`
	Address2 string `json:"address2"`
	City     string `json:"city"`
	ZipCode  string `json:"zipcode"`
	State    string `json:"state"`
	Country  string `json:"country"`
}

type UpdateOrgForm

type UpdateOrgForm struct {
	Name string `json:"name" binding:"Required"`
}

type UpdatePrefsCmd

type UpdatePrefsCmd struct {
	Theme           string `json:"theme"`
	HomeDashboardID int64  `json:"homeDashboardId"`
	Timezone        string `json:"timezone"`
}

type UserLookupDTO

type UserLookupDTO struct {
	UserID    int64  `json:"userId"`
	Login     string `json:"login"`
	AvatarURL string `json:"avatarUrl"`
}

type UserToken

type UserToken struct {
	Id                     int64     `json:"id"`
	IsActive               bool      `json:"isActive"`
	ClientIp               string    `json:"clientIp"`
	Device                 string    `json:"device"`
	OperatingSystem        string    `json:"os"`
	OperatingSystemVersion string    `json:"osVersion"`
	Browser                string    `json:"browser"`
	BrowserVersion         string    `json:"browserVersion"`
	CreatedAt              time.Time `json:"createdAt"`
	SeenAt                 time.Time `json:"seenAt"`
}

Jump to

Keyboard shortcuts

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