models

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DS_GRAPHITE      = "graphite"
	DS_INFLUXDB      = "influxdb"
	DS_INFLUXDB_08   = "influxdb_08"
	DS_ES            = "elasticsearch"
	DS_OPENTSDB      = "opentsdb"
	DS_CLOUDWATCH    = "cloudwatch"
	DS_KAIROSDB      = "kairosdb"
	DS_PROMETHEUS    = "prometheus"
	DS_ACCESS_DIRECT = "direct"
	DS_ACCESS_PROXY  = "proxy"
)

Variables

View Source
var (
	ErrDashboardNotFound           = errors.New("Dashboard not found")
	ErrDashboardSnapshotNotFound   = errors.New("Dashboard snapshot not found")
	ErrDashboardWithSameNameExists = errors.New("A dashboard with the same name already exists")
	ErrDashboardVersionMismatch    = errors.New("The dashboard has been changed by someone else")
)

Typed errors

View Source
var (
	DashTypeJson     = "file"
	DashTypeDB       = "db"
	DashTypeScript   = "script"
	DashTypeSnapshot = "snapshot"
)
View Source
var (
	ErrOrgNotFound  = errors.New("Organization not found")
	ErrOrgNameTaken = errors.New("Organization name is taken")
)

Typed errors

View Source
var (
	ErrInvalidRoleType     = errors.New("Invalid role type")
	ErrLastOrgAdmin        = errors.New("Cannot remove last organization admin")
	ErrOrgUserNotFound     = errors.New("Cannot find the organization user")
	ErrOrgUserAlreadyAdded = errors.New("User is already added to organization")
)

Typed errors

View Source
var (
	ErrPlaylistNotFound           = errors.New("Playlist not found")
	ErrPlaylistWithSameNameExists = errors.New("A playlist with the same name already exists")
)

Typed errors

View Source
var ErrCommandValidationFailed = errors.New("Command missing required fields")
View Source
var (
	ErrDataSourceNotFound = errors.New("Data source not found")
)

Typed errors

View Source
var ErrInvalidApiKey = errors.New("Invalid API Key")
View Source
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
View Source
var ErrInvalidQuotaTarget = errors.New("Invalid quota target")
View Source
var (
	ErrPluginSettingNotFound = errors.New("Plugin setting not found")
)
View Source
var (
	ErrPreferencesNotFound = errors.New("Preferences not found")
)

Typed errors

View Source
var (
	ErrTempUserNotFound = errors.New("User not found")
)

Typed errors

View Source
var (
	ErrUserNotFound = errors.New("User not found")
)

Typed errors

Functions

func IsKnownDataSourcePlugin

func IsKnownDataSourcePlugin(dsType string) bool

Types

type AddApiKeyCommand

type AddApiKeyCommand struct {
	Name  string   `json:"name" binding:"Required"`
	Role  RoleType `json:"role" binding:"Required"`
	OrgId int64    `json:"-"`
	Key   string   `json:"-"`

	Result *ApiKey `json:"-"`
}

--------------------- COMMANDS

type AddDataSourceCommand

type AddDataSourceCommand struct {
	Name              string           `json:"name" binding:"Required"`
	Type              string           `json:"type" binding:"Required"`
	Access            DsAccess         `json:"access" binding:"Required"`
	Url               string           `json:"url"`
	Password          string           `json:"password"`
	Database          string           `json:"database"`
	User              string           `json:"user"`
	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"`

	OrgId int64 `json:"-"`

	Result *DataSource
}

Also acts as api DTO

type AddOrgUserCommand

type AddOrgUserCommand struct {
	LoginOrEmail string   `json:"loginOrEmail" binding:"Required"`
	Role         RoleType `json:"role" binding:"Required"`

	OrgId  int64 `json:"-"`
	UserId int64 `json:"-"`
}

type Address

type Address 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 AdminStats

type AdminStats struct {
	UserCount       int `json:"user_count"`
	OrgCount        int `json:"org_count"`
	DashboardCount  int `json:"dashboard_count"`
	DbSnapshotCount int `json:"db_snapshot_count"`
	DbTagCount      int `json:"db_tag_count"`
	DataSourceCount int `json:"data_source_count"`
	PlaylistCount   int `json:"playlist_count"`
	StarredDbCount  int `json:"starred_db_count"`
}

type ApiKey

type ApiKey struct {
	Id      int64
	OrgId   int64
	Name    string
	Key     string
	Role    RoleType
	Created time.Time
	Updated time.Time
}

type ApiKeyDTO

type ApiKeyDTO struct {
	Id   int64    `json:"id"`
	Name string   `json:"name"`
	Role RoleType `json:"role"`
}

type ChangeUserPasswordCommand

type ChangeUserPasswordCommand struct {
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`

	UserId int64 `json:"-"`
}

type CreateDashboardSnapshotCommand

type CreateDashboardSnapshotCommand struct {
	Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
	Name      string           `json:"name"`
	Expires   int64            `json:"expires"`

	// these are passed when storing an external snapshot ref
	External  bool   `json:"external"`
	Key       string `json:"key"`
	DeleteKey string `json:"deleteKey"`

	OrgId  int64 `json:"-"`
	UserId int64 `json:"-"`

	Result *DashboardSnapshot
}

type CreateOrgCommand

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

	// initial admin user for account
	UserId int64 `json:"-"`
	Result Org   `json:"-"`
}

type CreatePlaylistCommand

type CreatePlaylistCommand struct {
	Name     string            `json:"name" binding:"Required"`
	Interval string            `json:"interval"`
	Items    []PlaylistItemDTO `json:"items"`

	OrgId  int64 `json:"-"`
	Result *Playlist
}

type CreateTempUserCommand

type CreateTempUserCommand struct {
	Email           string
	Name            string
	OrgId           int64
	InvitedByUserId int64
	Status          TempUserStatus
	Code            string
	Role            RoleType
	RemoteAddr      string

	Result *TempUser
}

type CreateUserCommand

type CreateUserCommand struct {
	Email         string
	Login         string
	Name          string
	Company       string
	OrgName       string
	Password      string
	EmailVerified bool
	IsAdmin       bool
	SkipOrgSetup  bool

	Result User
}

type Dashboard

type Dashboard struct {
	Id       int64
	Slug     string
	OrgId    int64
	GnetId   int64
	Version  int
	PluginId string

	Created time.Time
	Updated time.Time

	UpdatedBy int64
	CreatedBy int64

	Title string
	Data  *simplejson.Json
}

Dashboard model

func NewDashboard

func NewDashboard(title string) *Dashboard

NewDashboard creates a new dashboard

func NewDashboardFromJson

func NewDashboardFromJson(data *simplejson.Json) *Dashboard

func (*Dashboard) GetString

func (dash *Dashboard) GetString(prop string, defaultValue string) string

GetString a

func (*Dashboard) GetTags

func (dash *Dashboard) GetTags() []string

GetTags turns the tags in data json into go string array

func (*Dashboard) UpdateSlug

func (dash *Dashboard) UpdateSlug()

UpdateSlug updates the slug

type DashboardSnapshot

type DashboardSnapshot struct {
	Id          int64
	Name        string
	Key         string
	DeleteKey   string
	OrgId       int64
	UserId      int64
	External    bool
	ExternalUrl string

	Expires time.Time
	Created time.Time
	Updated time.Time

	Dashboard *simplejson.Json
}

DashboardSnapshot model

type DashboardSnapshotDTO

type DashboardSnapshotDTO struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Key         string `json:"key"`
	DeleteKey   string `json:"deleteKey"`
	OrgId       int64  `json:"orgId"`
	UserId      int64  `json:"userId"`
	External    bool   `json:"external"`
	ExternalUrl string `json:"externalUrl"`

	Expires time.Time `json:"expires"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`
}

DashboardSnapshotDTO without dashboard map

type DashboardSnapshots

type DashboardSnapshots []*DashboardSnapshot

type DashboardTagCloudItem

type DashboardTagCloudItem struct {
	Term  string `json:"term"`
	Count int    `json:"count"`
}

type DataSource

type DataSource struct {
	Id      int64
	OrgId   int64
	Version int

	Name              string
	Type              string
	Access            DsAccess
	Url               string
	Password          string
	User              string
	Database          string
	BasicAuth         bool
	BasicAuthUser     string
	BasicAuthPassword string
	WithCredentials   bool
	IsDefault         bool
	JsonData          *simplejson.Json

	Created time.Time
	Updated time.Time
}

type DataSourceCreatedEvent

type DataSourceCreatedEvent struct {
}

--------------------- EVENTS

type DataSourceStats

type DataSourceStats struct {
	Count int
	Type  string
}

type DeleteApiKeyCommand

type DeleteApiKeyCommand struct {
	Id    int64 `json:"id"`
	OrgId int64 `json:"-"`
}

type DeleteDashboardCommand

type DeleteDashboardCommand struct {
	Slug  string
	OrgId int64
}

type DeleteDashboardSnapshotCommand

type DeleteDashboardSnapshotCommand struct {
	DeleteKey string `json:"-"`
}

type DeleteDataSourceCommand

type DeleteDataSourceCommand struct {
	Id    int64
	OrgId int64
}

type DeleteOrgCommand

type DeleteOrgCommand struct {
	Id int64
}

type DeletePlaylistCommand

type DeletePlaylistCommand struct {
	Id    int64
	OrgId int64
}

type DeleteUserCommand

type DeleteUserCommand struct {
	UserId int64
}

type DsAccess

type DsAccess string

type GetAdminStatsQuery

type GetAdminStatsQuery struct {
	Result *AdminStats
}

type GetApiKeyByIdQuery

type GetApiKeyByIdQuery struct {
	ApiKeyId int64
	Result   *ApiKey
}

type GetApiKeyByNameQuery

type GetApiKeyByNameQuery struct {
	KeyName string
	OrgId   int64
	Result  *ApiKey
}

type GetApiKeysQuery

type GetApiKeysQuery struct {
	OrgId  int64
	Result []*ApiKey
}

type GetDashboardQuery

type GetDashboardQuery struct {
	Slug  string
	OrgId int64

	Result *Dashboard
}

type GetDashboardSlugByIdQuery

type GetDashboardSlugByIdQuery struct {
	Id     int64
	Result string
}

type GetDashboardSnapshotQuery

type GetDashboardSnapshotQuery struct {
	Key string

	Result *DashboardSnapshot
}

type GetDashboardSnapshotsQuery

type GetDashboardSnapshotsQuery struct {
	Name  string
	Limit int
	OrgId int64

	Result DashboardSnapshots
}

type GetDashboardTagsQuery

type GetDashboardTagsQuery struct {
	OrgId  int64
	Result []*DashboardTagCloudItem
}

type GetDashboardsByPluginIdQuery

type GetDashboardsByPluginIdQuery struct {
	OrgId    int64
	PluginId string
	Result   []*Dashboard
}

type GetDashboardsQuery

type GetDashboardsQuery struct {
	DashboardIds []int64
	Result       []*Dashboard
}

type GetDataSourceByIdQuery

type GetDataSourceByIdQuery struct {
	Id     int64
	OrgId  int64
	Result DataSource
}

type GetDataSourceByNameQuery

type GetDataSourceByNameQuery struct {
	Name   string
	OrgId  int64
	Result DataSource
}

type GetDataSourceStatsQuery

type GetDataSourceStatsQuery struct {
	Result []*DataSourceStats
}

type GetDataSourcesQuery

type GetDataSourcesQuery struct {
	OrgId  int64
	Result []*DataSource
}

type GetGlobalQuotaByTargetQuery

type GetGlobalQuotaByTargetQuery struct {
	Target  string
	Default int64
	Result  *GlobalQuotaDTO
}

type GetOrgByIdQuery

type GetOrgByIdQuery struct {
	Id     int64
	Result *Org
}

type GetOrgByNameQuery

type GetOrgByNameQuery struct {
	Name   string
	Result *Org
}

type GetOrgQuotaByTargetQuery

type GetOrgQuotaByTargetQuery struct {
	Target  string
	OrgId   int64
	Default int64
	Result  *OrgQuotaDTO
}

type GetOrgQuotasQuery

type GetOrgQuotasQuery struct {
	OrgId  int64
	Result []*OrgQuotaDTO
}

type GetOrgUsersQuery

type GetOrgUsersQuery struct {
	OrgId  int64
	Result []*OrgUserDTO
}

type GetPlaylistByIdQuery

type GetPlaylistByIdQuery struct {
	Id     int64
	Result *Playlist
}

type GetPlaylistItemsByIdQuery

type GetPlaylistItemsByIdQuery struct {
	PlaylistId int64
	Result     *[]PlaylistItem
}

type GetPlaylistsQuery

type GetPlaylistsQuery struct {
	Name  string
	Limit int
	OrgId int64

	Result Playlists
}

type GetPluginSettingByIdQuery

type GetPluginSettingByIdQuery struct {
	PluginId string
	OrgId    int64
	Result   *PluginSetting
}

type GetPluginSettingsQuery

type GetPluginSettingsQuery struct {
	OrgId  int64
	Result []*PluginSettingInfoDTO
}

--------------------- QUERIES

type GetPreferencesQuery

type GetPreferencesQuery struct {
	Id     int64
	OrgId  int64
	UserId int64

	Result *Preferences
}

type GetPreferencesWithDefaultsQuery

type GetPreferencesWithDefaultsQuery struct {
	Id     int64
	OrgId  int64
	UserId int64

	Result *Preferences
}

type GetSignedInUserQuery

type GetSignedInUserQuery struct {
	UserId int64
	Login  string
	Email  string
	Result *SignedInUser
}

type GetSystemStatsQuery

type GetSystemStatsQuery struct {
	Result *SystemStats
}

type GetTempUserByCodeQuery

type GetTempUserByCodeQuery struct {
	Code string

	Result *TempUserDTO
}

type GetTempUsersQuery

type GetTempUsersQuery struct {
	OrgId  int64
	Email  string
	Status TempUserStatus

	Result []*TempUserDTO
}

type GetUserByIdQuery

type GetUserByIdQuery struct {
	Id     int64
	Result *User
}

type GetUserByLoginQuery

type GetUserByLoginQuery struct {
	LoginOrEmail string
	Result       *User
}

type GetUserOrgListQuery

type GetUserOrgListQuery struct {
	UserId int64
	Result []*UserOrgDTO
}

type GetUserProfileQuery

type GetUserProfileQuery struct {
	UserId int64
	Result UserProfileDTO
}

type GetUserQuotaByTargetQuery

type GetUserQuotaByTargetQuery struct {
	Target  string
	UserId  int64
	Default int64
	Result  *UserQuotaDTO
}

type GetUserQuotasQuery

type GetUserQuotasQuery struct {
	UserId int64
	Result []*UserQuotaDTO
}

type GetUserStarsQuery

type GetUserStarsQuery struct {
	UserId int64

	Result map[int64]bool // dashboard ids
}

type GlobalQuotaDTO

type GlobalQuotaDTO struct {
	Target string `json:"target"`
	Limit  int64  `json:"limit"`
	Used   int64  `json:"used"`
}

type HomeDashboard

type HomeDashboard struct {
	Id        int64
	UserId    int64
	AccountId int64

	Created time.Time
	Updated time.Time

	Data map[string]interface{}
}

type IsStarredByUserQuery

type IsStarredByUserQuery struct {
	UserId      int64
	DashboardId int64

	Result bool
}

type OAuthType

type OAuthType int
const (
	GITHUB OAuthType = iota + 1
	GOOGLE
	TWITTER
)

type Org

type Org struct {
	Id      int64
	Version int
	Name    string

	Address1 string
	Address2 string
	City     string
	ZipCode  string
	State    string
	Country  string

	Created time.Time
	Updated time.Time
}

type OrgDTO

type OrgDTO struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type OrgDetailsDTO

type OrgDetailsDTO struct {
	Id      int64   `json:"id"`
	Name    string  `json:"name"`
	Address Address `json:"address"`
}

type OrgQuotaDTO

type OrgQuotaDTO struct {
	OrgId  int64  `json:"org_id"`
	Target string `json:"target"`
	Limit  int64  `json:"limit"`
	Used   int64  `json:"used"`
}

type OrgUser

type OrgUser struct {
	Id      int64
	OrgId   int64
	UserId  int64
	Role    RoleType
	Created time.Time
	Updated time.Time
}

type OrgUserDTO

type OrgUserDTO struct {
	OrgId  int64  `json:"orgId"`
	UserId int64  `json:"userId"`
	Email  string `json:"email"`
	Login  string `json:"login"`
	Role   string `json:"role"`
}

type Playlist

type Playlist struct {
	Id       int64  `json:"id"`
	Name     string `json:"name"`
	Interval string `json:"interval"`
	OrgId    int64  `json:"-"`
}

Playlist model

type PlaylistDTO

type PlaylistDTO struct {
	Id       int64             `json:"id"`
	Name     string            `json:"name"`
	Interval string            `json:"interval"`
	OrgId    int64             `json:"-"`
	Items    []PlaylistItemDTO `json:"items"`
}

type PlaylistDashboard

type PlaylistDashboard struct {
	Id    int64  `json:"id"`
	Slug  string `json:"slug"`
	Title string `json:"title"`
}

func (PlaylistDashboard) TableName

func (this PlaylistDashboard) TableName() string

type PlaylistDashboardDto

type PlaylistDashboardDto struct {
	Id    int64  `json:"id"`
	Slug  string `json:"slug"`
	Title string `json:"title"`
	Uri   string `json:"uri"`
}

type PlaylistDashboards

type PlaylistDashboards []*PlaylistDashboard

type PlaylistItem

type PlaylistItem struct {
	Id         int64
	PlaylistId int64
	Type       string
	Value      string
	Order      int
	Title      string
}

type PlaylistItemDTO

type PlaylistItemDTO struct {
	Id         int64  `json:"id"`
	PlaylistId int64  `json:"playlistid"`
	Type       string `json:"type"`
	Title      string `json:"title"`
	Value      string `json:"value"`
	Order      int    `json:"order"`
}

type Playlists

type Playlists []*Playlist

type PluginSetting

type PluginSetting struct {
	Id             int64
	PluginId       string
	OrgId          int64
	Enabled        bool
	Pinned         bool
	JsonData       map[string]interface{}
	SecureJsonData SecureJsonData
	PluginVersion  string

	Created time.Time
	Updated time.Time
}

type PluginSettingInfoDTO

type PluginSettingInfoDTO struct {
	OrgId         int64
	PluginId      string
	Enabled       bool
	Pinned        bool
	PluginVersion string
}

type PluginStateChangedEvent

type PluginStateChangedEvent struct {
	PluginId string
	OrgId    int64
	Enabled  bool
}

type Preferences

type Preferences struct {
	Id              int64
	OrgId           int64
	UserId          int64
	Version         int
	HomeDashboardId int64
	Timezone        string
	Theme           string
	Created         time.Time
	Updated         time.Time
}

type Quota

type Quota struct {
	Id      int64
	OrgId   int64
	UserId  int64
	Target  string
	Limit   int64
	Created time.Time
	Updated time.Time
}

type QuotaScope

type QuotaScope struct {
	Name         string
	Target       string
	DefaultLimit int64
}

func GetQuotaScopes

func GetQuotaScopes(target string) ([]QuotaScope, error)

type RemoveOrgUserCommand

type RemoveOrgUserCommand struct {
	UserId int64
	OrgId  int64
}

type RoleType

type RoleType string
const (
	ROLE_VIEWER           RoleType = "Viewer"
	ROLE_EDITOR           RoleType = "Editor"
	ROLE_READ_ONLY_EDITOR RoleType = "Read Only Editor"
	ROLE_ADMIN            RoleType = "Admin"
)

func (RoleType) Includes

func (r RoleType) Includes(other RoleType) bool

func (RoleType) IsValid

func (r RoleType) IsValid() bool

func (*RoleType) UnmarshalJSON

func (r *RoleType) UnmarshalJSON(data []byte) error

type SaveDashboardCommand

type SaveDashboardCommand struct {
	Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
	UserId    int64            `json:"userId"`
	OrgId     int64            `json:"-"`
	Overwrite bool             `json:"overwrite"`
	PluginId  string           `json:"-"`

	Result *Dashboard
}

func (*SaveDashboardCommand) GetDashboardModel

func (cmd *SaveDashboardCommand) GetDashboardModel() *Dashboard

GetDashboardModel turns the command into the savable model

type SavePreferencesCommand

type SavePreferencesCommand struct {
	UserId int64
	OrgId  int64

	HomeDashboardId int64  `json:"homeDashboardId"`
	Timezone        string `json:"timezone"`
	Theme           string `json:"theme"`
}

--------------------- COMMANDS

type SearchHit

type SearchHit struct {
	Id        int64    `json:"id"`
	Title     string   `json:"title"`
	Uri       string   `json:"uri"`
	Type      string   `json:"type"`
	Tags      []string `json:"tags"`
	IsStarred bool     `json:"isStarred"`
}

type SearchOrgsQuery

type SearchOrgsQuery struct {
	Query string
	Name  string
	Limit int
	Page  int

	Result []*OrgDTO
}

type SearchUsersQuery

type SearchUsersQuery struct {
	Query string
	Page  int
	Limit int

	Result []*UserSearchHitDTO
}

type SecureJsonData

type SecureJsonData map[string][]byte

func (SecureJsonData) Decrypt

func (s SecureJsonData) Decrypt() map[string]string

type SendEmailCommand

type SendEmailCommand struct {
	To       []string
	Template string
	Data     map[string]interface{}
	Massive  bool
	Info     string
}

type SendResetPasswordEmailCommand

type SendResetPasswordEmailCommand struct {
	User *User
}

type SetUsingOrgCommand

type SetUsingOrgCommand struct {
	UserId int64
	OrgId  int64
}

type SignedInUser

type SignedInUser struct {
	UserId         int64
	OrgId          int64
	OrgName        string
	OrgRole        RoleType
	Login          string
	Name           string
	Email          string
	ApiKeyId       int64
	IsGrafanaAdmin bool
}

type Star

type Star struct {
	Id          int64
	UserId      int64
	DashboardId int64
}

type StarDashboardCommand

type StarDashboardCommand struct {
	UserId      int64
	DashboardId int64
}

type SystemStats

type SystemStats struct {
	DashboardCount int
	UserCount      int
	OrgCount       int
	PlaylistCount  int
}

type TempUser

type TempUser struct {
	Id              int64
	OrgId           int64
	Version         int
	Email           string
	Name            string
	Role            RoleType
	InvitedByUserId int64
	Status          TempUserStatus

	EmailSent   bool
	EmailSentOn time.Time
	Code        string
	RemoteAddr  string

	Created time.Time
	Updated time.Time
}

TempUser holds data for org invites and unconfirmed sign ups

type TempUserDTO

type TempUserDTO struct {
	Id             int64          `json:"id"`
	OrgId          int64          `json:"orgId"`
	Name           string         `json:"name"`
	Email          string         `json:"email"`
	Role           RoleType       `json:"role"`
	InvitedByLogin string         `json:"invitedByLogin"`
	InvitedByEmail string         `json:"invitedByEmail"`
	InvitedByName  string         `json:"invitedByName"`
	Code           string         `json:"code"`
	Status         TempUserStatus `json:"status"`
	Url            string         `json:"url"`
	EmailSent      bool           `json:"emailSent"`
	EmailSentOn    time.Time      `json:"emailSentOn"`
	Created        time.Time      `json:"createdOn"`
}

type TempUserStatus

type TempUserStatus string
const (
	TmpUserSignUpStarted TempUserStatus = "SignUpStarted"
	TmpUserInvitePending TempUserStatus = "InvitePending"
	TmpUserCompleted     TempUserStatus = "Completed"
	TmpUserRevoked       TempUserStatus = "Revoked"
)

type UnstarDashboardCommand

type UnstarDashboardCommand struct {
	UserId      int64
	DashboardId int64
}

type UpdateApiKeyCommand

type UpdateApiKeyCommand struct {
	Id   int64    `json:"id"`
	Name string   `json:"name"`
	Role RoleType `json:"role"`

	OrgId int64 `json:"-"`
}

type UpdateDataSourceCommand

type UpdateDataSourceCommand struct {
	Name              string           `json:"name" binding:"Required"`
	Type              string           `json:"type" binding:"Required"`
	Access            DsAccess         `json:"access" binding:"Required"`
	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"`

	OrgId int64 `json:"-"`
	Id    int64 `json:"-"`
}

Also acts as api DTO

type UpdateOrgAddressCommand

type UpdateOrgAddressCommand struct {
	OrgId int64
	Address
}

type UpdateOrgCommand

type UpdateOrgCommand struct {
	Name  string
	OrgId int64
}

type UpdateOrgQuotaCmd

type UpdateOrgQuotaCmd struct {
	Target string `json:"target"`
	Limit  int64  `json:"limit"`
	OrgId  int64  `json:"-"`
}

type UpdateOrgUserCommand

type UpdateOrgUserCommand struct {
	Role RoleType `json:"role" binding:"Required"`

	OrgId  int64 `json:"-"`
	UserId int64 `json:"-"`
}

type UpdatePlaylistCommand

type UpdatePlaylistCommand struct {
	OrgId    int64             `json:"-"`
	Id       int64             `json:"id" binding:"Required"`
	Name     string            `json:"name" binding:"Required"`
	Interval string            `json:"interval"`
	Items    []PlaylistItemDTO `json:"items"`

	Result *PlaylistDTO
}

type UpdatePluginDashboardError

type UpdatePluginDashboardError struct {
	PluginId string
}

func (UpdatePluginDashboardError) Error

type UpdatePluginSettingCmd

type UpdatePluginSettingCmd struct {
	Enabled        bool                   `json:"enabled"`
	Pinned         bool                   `json:"pinned"`
	JsonData       map[string]interface{} `json:"jsonData"`
	SecureJsonData map[string]string      `json:"secureJsonData"`
	PluginVersion  string                 `json:"version"`

	PluginId string `json:"-"`
	OrgId    int64  `json:"-"`
}

Also acts as api DTO

func (*UpdatePluginSettingCmd) GetEncryptedJsonData

func (cmd *UpdatePluginSettingCmd) GetEncryptedJsonData() SecureJsonData

type UpdatePluginSettingVersionCmd

type UpdatePluginSettingVersionCmd struct {
	PluginVersion string
	PluginId      string `json:"-"`
	OrgId         int64  `json:"-"`
}

specific command, will only update version

type UpdateTempUserStatusCommand

type UpdateTempUserStatusCommand struct {
	Code   string
	Status TempUserStatus
}

type UpdateUserCommand

type UpdateUserCommand struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Login string `json:"login"`
	Theme string `json:"theme"`

	UserId int64 `json:"-"`
}

type UpdateUserPermissionsCommand

type UpdateUserPermissionsCommand struct {
	IsGrafanaAdmin bool
	UserId         int64 `json:"-"`
}

type UpdateUserQuotaCmd

type UpdateUserQuotaCmd struct {
	Target string `json:"target"`
	Limit  int64  `json:"limit"`
	UserId int64  `json:"-"`
}

type User

type User struct {
	Id            int64
	Version       int
	Email         string
	Name          string
	Login         string
	Password      string
	Salt          string
	Rands         string
	Company       string
	EmailVerified bool
	Theme         string

	IsAdmin bool
	OrgId   int64

	Created time.Time
	Updated time.Time
}

func (*User) NameOrFallback

func (u *User) NameOrFallback() string

type UserIdDTO

type UserIdDTO struct {
	Id      int64  `json:"id"`
	Message string `json:"message"`
}

type UserOrgDTO

type UserOrgDTO struct {
	OrgId int64    `json:"orgId"`
	Name  string   `json:"name"`
	Role  RoleType `json:"role"`
}

type UserProfileDTO

type UserProfileDTO struct {
	Email          string `json:"email"`
	Name           string `json:"name"`
	Login          string `json:"login"`
	Theme          string `json:"theme"`
	OrgId          int64  `json:"orgId"`
	IsGrafanaAdmin bool   `json:"isGrafanaAdmin"`
}

type UserQuotaDTO

type UserQuotaDTO struct {
	UserId int64  `json:"user_id"`
	Target string `json:"target"`
	Limit  int64  `json:"limit"`
	Used   int64  `json:"used"`
}

type UserSearchHitDTO

type UserSearchHitDTO struct {
	Id      int64  `json:"id"`
	Name    string `json:"name"`
	Login   string `json:"login"`
	Email   string `json:"email"`
	IsAdmin bool   `json:"isAdmin"`
}

type ValidateResetPasswordCodeQuery

type ValidateResetPasswordCodeQuery struct {
	Code   string
	Result *User
}

Jump to

Keyboard shortcuts

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