Documentation
¶
Index ¶
- Constants
- Variables
- func GetDashboardFolderUrl(isFolder bool, uid string, slug string) string
- func GetDashboardUrl(uid string, slug string) string
- func GetFolderUrl(folderUid string, slug string) string
- func GetFullDashboardUrl(uid string, slug string) string
- func GetKioskModeDashboardUrl(uid string, slug string, theme Theme) string
- func SlugifyTitle(title string) string
- type ActiveTokenService
- type AddOrgUserCommand
- type AddTeamMemberCommand
- type Address
- type AdminStats
- type Alert
- type AlertListItemDTO
- type AlertNotification
- type AlertNotificationState
- type AlertNotificationStateType
- type AlertStateInfoDTO
- type AlertStateType
- type AuthModuleConversion
- type BatchDisableUsersCommand
- type ChangeUserPasswordCommand
- type ChannelClientCount
- type ChannelHandler
- type ChannelHandlerFactory
- type ChannelPublisher
- type CreateAlertNotificationCommand
- type CreateFolderCommand
- type CreateLoginAttemptCommand
- type CreateOrgCommand
- type CreateTeamCommand
- type CreateTempUserCommand
- type CreateTokenErr
- type Dashboard
- type DashboardACL
- type DashboardACLInfoDTO
- type DashboardActivityChannel
- type DashboardProvisioning
- type DashboardRef
- type DashboardTagCloudItem
- type DataSourceAccessStats
- type DataSourceStats
- type DeleteAlertNotificationCommand
- type DeleteAlertNotificationWithUidCommand
- type DeleteAuthInfoCommand
- type DeleteDashboardCommand
- type DeleteOldLoginAttemptsCommand
- type DeleteOrgCommand
- type DeleteOrphanedProvisionedDashboardsCommand
- type DeleteShortUrlCommand
- type DeleteTeamCommand
- type DeleteUserCommand
- type DisableUserCommand
- type ExecutionErrorOption
- type ExpireTempUsersCommand
- type ExternalUserInfo
- type FakeJWTService
- type FindPersistedDashboardsQuery
- type Folder
- type GetAdminStatsQuery
- type GetAlertByIdQuery
- type GetAlertNotificationUidQuery
- type GetAlertNotificationsQuery
- type GetAlertNotificationsWithUidQuery
- type GetAlertNotificationsWithUidToSendQuery
- type GetAlertNotifierUsageStatsQuery
- type GetAlertStatesForDashboardQuery
- type GetAlertsQuery
- type GetAllAlertNotificationsQuery
- type GetAllAlertsQuery
- type GetAuthInfoQuery
- type GetDBHealthQuery
- type GetDashboardACLInfoListQuery
- type GetDashboardQuery
- type GetDashboardRefByIdQuery
- type GetDashboardSlugByIdQuery
- type GetDashboardTagsQuery
- type GetDashboardsByPluginIdQuery
- type GetDashboardsBySlugQuery
- type GetDashboardsQuery
- type GetDataSourceAccessStatsQuery
- type GetDataSourceStatsQuery
- type GetExternalUserInfoByLoginQuery
- type GetGlobalQuotaByTargetQuery
- type GetLiveMessageQuery
- type GetOrCreateNotificationStateQuery
- type GetOrgByIdQuery
- type GetOrgByNameQuery
- type GetOrgQuotaByTargetQuery
- type GetOrgQuotasQuery
- type GetOrgUsersQuery
- type GetPluginSettingByIdQuery
- type GetSignedInUserQuery
- type GetSystemStatsQuery
- type GetSystemUserCountStatsQuery
- type GetTeamByIdQuery
- type GetTeamMembersQuery
- type GetTeamsByUserQuery
- type GetTempUserByCodeQuery
- type GetTempUsersQuery
- type GetUserByAuthInfoQuery
- type GetUserByEmailQuery
- type GetUserByIdQuery
- type GetUserByLoginQuery
- type GetUserLoginAttemptCountQuery
- type GetUserOrgListQuery
- type GetUserProfileQuery
- type GetUserQuotaByTargetQuery
- type GetUserQuotasQuery
- type GetUserStarsQuery
- type GlobalQuotaDTO
- type HasAdminPermissionInDashboardsOrFoldersQuery
- type HasEditPermissionInFoldersQuery
- type Hit
- type HitList
- type HitType
- type IsAdminOfTeamsQuery
- type IsStarredByUserQuery
- type JWTClaims
- type JWTService
- type LibraryElementKind
- type LicenseEnvironment
- type Licensing
- type LiveMessage
- type LoginAttempt
- type LoginInfo
- type LoginUserQuery
- type NoDataOption
- type NotifierUsageStats
- type OAuthType
- type Org
- type OrgDTO
- type OrgDetailsDTO
- type OrgQuotaDTO
- type OrgUser
- type OrgUserDTO
- type Password
- type PauseAlertCommand
- type PauseAllAlertCommand
- type PermissionType
- type PluginRequestValidator
- type PluginSetting
- type PluginSettingInfo
- type PluginSettingInfoDTO
- type PluginStateChangedEvent
- type PublishEvent
- type PublishReply
- type Quota
- type QuotaScope
- type RemoveOrgUserCommand
- type RemoveTeamMemberCommand
- type ReqContext
- func (ctx *ReqContext) Handle(cfg *setting.Cfg, status int, title string, err error)
- func (ctx *ReqContext) HasHelpFlag(flag user.HelpFlags1) bool
- func (ctx *ReqContext) HasUserRole(role org.RoleType) bool
- func (ctx *ReqContext) IsApiRequest() bool
- func (ctx *ReqContext) JsonApiErr(status int, message string, err error)
- func (ctx *ReqContext) QueryBoolWithDefault(field string, d bool) bool
- func (ctx *ReqContext) TimeRequest(timer prometheus.Summary)
- type RequestURIKey
- type RevokeAuthTokenCmd
- type SaveDashboardCommand
- type SaveLiveMessageQuery
- type SearchOrgUsersQuery
- type SearchOrgUsersQueryResult
- type SearchOrgsQuery
- type SearchTeamQueryResult
- type SearchTeamsQuery
- type SearchUserQueryResult
- type SearchUsersQuery
- type SendEmailAttachFile
- type SendEmailCommand
- type SendEmailCommandSync
- type SendResetPasswordEmailCommand
- type SendWebhookSync
- type SetAlertNotificationStateToCompleteCommand
- type SetAlertNotificationStateToPendingCommand
- type SetAlertStateCommand
- type SetAuthInfoCommand
- type SetUserHelpFlagCommand
- type SetUsingOrgCommand
- type ShortUrl
- type SortOption
- type SortOptionFilter
- type Star
- type StarDashboardCommand
- type SubscribeEvent
- type SubscribeReply
- type SystemStats
- type SystemUserCountStats
- type Team
- type TeamDTO
- type TeamMember
- type TeamMemberDTO
- type TeamOrgGroupDTO
- type TempUser
- type TempUserDTO
- type TempUserStatus
- type Theme
- type TokenExpiredError
- type TokenRevokedError
- type TrimDashboardCommand
- type UnstarDashboardCommand
- type UpdateAlertNotificationCommand
- type UpdateAlertNotificationWithUidCommand
- type UpdateAuthInfoCommand
- type UpdateFolderCommand
- type UpdateOrgAddressCommand
- type UpdateOrgQuotaCmd
- type UpdateOrgUserCommand
- type UpdatePluginSettingCmd
- type UpdatePluginSettingVersionCmd
- type UpdateTeamCommand
- type UpdateTeamMemberCommand
- type UpdateTempUserStatusCommand
- type UpdateTempUserWithEmailSentCommand
- type UpdateUserCommand
- type UpdateUserLastSeenAtCommand
- type UpdateUserQuotaCmd
- type UpsertUserCommand
- type UserAuth
- type UserIdDTO
- type UserLookupParams
- type UserOrgDTO
- type UserProfileDTO
- type UserQuotaDTO
- type UserSearchHitDTO
- type UserStats
- type UserToken
- type UserTokenBackgroundService
- type UserTokenService
- type ValidateDashboardBeforeSaveResult
- type ValidateResetPasswordCodeQuery
Constants ¶
const ( DashTypeDB = "db" DashTypeSnapshot = "snapshot" )
const FilterIgnoreUser int64 = 0
FilterIgnoreUser is used in a get / search teams query when the caller does not want to filter teams by user ID / membership
const LibraryElementConnectionTableName = "library_element_connection"
const RootFolderName = "General"
Variables ¶
var ( ErrCannotChangeStateOnPausedAlert = fmt.Errorf("cannot change state on pause alert") ErrRequiresNewState = fmt.Errorf("update alert state requires a new state") )
var ( ErrAlertNotificationNotFound = errors.New("alert notification not found") ErrNotificationFrequencyNotFound = errors.New("notification frequency not specified") ErrAlertNotificationStateVersionConflict = errors.New("alert notification state update version conflict") ErrAlertNotificationFailedGenerateUniqueUid = errors.New("failed to generate unique alert notification uid") ErrAlertNotificationFailedTranslateUniqueID = errors.New("failed to translate Notification Id to Uid") ErrAlertNotificationWithSameNameExists = errors.New("alert notification with same name already exists") ErrAlertNotificationWithSameUIDExists = errors.New("alert notification with same uid already exists") )
var ( AlertNotificationStatePending = AlertNotificationStateType("pending") AlertNotificationStateCompleted = AlertNotificationStateType("completed") AlertNotificationStateUnknown = AlertNotificationStateType("unknown") )
var ( ErrDashboardACLInfoMissing = errors.New("user id and team id cannot both be empty for a dashboard permission") ErrDashboardPermissionDashboardEmpty = errors.New("dashboard id must be greater than zero for a dashboard permission") ErrFolderACLInfoMissing = errors.New("user id and team id cannot both be empty for a folder permission") ErrFolderPermissionFolderEmpty = errors.New("folder id must be greater than zero for a folder permission") ErrPermissionsWithRoleNotAllowed = errors.New("permissions cannot have both a user and team") ErrPermissionsWithUserAndTeamNotAllowed = errors.New("team and user permissions cannot have an associated role") )
Typed errors
var ( ErrOrgNotFound = errors.New("organization not found") ErrOrgNameTaken = errors.New("organization name is taken") )
Typed errors
var ( 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
var ( ErrShortURLBadRequest = errutil.NewBase(errutil.StatusBadRequest, "shorturl.bad-request") ErrShortURLNotFound = errutil.NewBase(errutil.StatusNotFound, "shorturl.not-found") ErrShortURLAbsolutePath = errutil.NewBase(errutil.StatusValidationFailed, "shorturl.absolute-path", errutil.WithPublicMessage("Path should be relative")) ErrShortURLInvalidPath = errutil.NewBase(errutil.StatusValidationFailed, "shorturl.invalid-path", errutil.WithPublicMessage("Invalid short URL path")) ErrShortURLInternal = errutil.NewBase(errutil.StatusInternal, "shorturl.internal") )
var ( ErrTeamNotFound = errors.New("team not found") ErrTeamNameTaken = errors.New("team name is taken") ErrTeamMemberNotFound = errors.New("team member not found") ErrLastTeamAdmin = errors.New("not allowed to remove last admin") ErrNotAllowedToUpdateTeam = errors.New("user not allowed to update team") ErrNotAllowedToUpdateTeamInDifferentOrg = errors.New("user not allowed to update team in another org") )
Typed errors
var ErrCommandValidationFailed = errors.New("command missing required fields")
var ErrInvalidEmailCode = errors.New("invalid or expired email code")
var ErrInvalidQuotaTarget = errors.New("invalid quota target")
var (
ErrPluginSettingNotFound = errors.New("plugin setting not found")
)
var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section")
var (
ErrTeamMemberAlreadyAdded = errors.New("user is already added to this team")
)
Typed errors
var (
ErrTempUserNotFound = errors.New("user not found")
)
Typed errors
var (
ErrUserTokenNotFound = errors.New("user token not found")
)
Typed errors
Functions ¶
func GetDashboardFolderUrl ¶
GetDashboardFolderUrl return the html url for a folder if it's folder, otherwise for a dashboard
func GetDashboardUrl ¶
GetDashboardUrl returns the HTML url for a dashboard.
func GetFolderUrl ¶
GetFolderUrl returns the HTML url for a folder.
func GetFullDashboardUrl ¶
GetFullDashboardUrl returns the full URL for a dashboard.
func GetKioskModeDashboardUrl ¶
GetKioskModeDashboardUrl returns the HTML url for a dashboard in kiosk mode.
func SlugifyTitle ¶
Types ¶
type ActiveTokenService ¶
type AddOrgUserCommand ¶
type AddOrgUserCommand struct {
LoginOrEmail string `json:"loginOrEmail" binding:"Required"`
Role org.RoleType `json:"role" binding:"Required"`
OrgId int64 `json:"-"`
UserId int64 `json:"-"`
// internal use: avoid adding service accounts to orgs via user routes
AllowAddingServiceAccount bool `json:"-"`
}
type AddTeamMemberCommand ¶
type AddTeamMemberCommand struct {
UserId int64 `json:"userId" binding:"Required"`
OrgId int64 `json:"-"`
TeamId int64 `json:"-"`
External bool `json:"-"`
Permission PermissionType `json:"-"`
}
type AdminStats ¶
type AdminStats struct {
Orgs int64 `json:"orgs"`
Dashboards int64 `json:"dashboards"`
Snapshots int64 `json:"snapshots"`
Tags int64 `json:"tags"`
Datasources int64 `json:"datasources"`
Playlists int64 `json:"playlists"`
Stars int64 `json:"stars"`
Alerts int64 `json:"alerts"`
Users int64 `json:"users"`
Admins int64 `json:"admins"`
Editors int64 `json:"editors"`
Viewers int64 `json:"viewers"`
ActiveUsers int64 `json:"activeUsers"`
ActiveAdmins int64 `json:"activeAdmins"`
ActiveEditors int64 `json:"activeEditors"`
ActiveViewers int64 `json:"activeViewers"`
ActiveSessions int64 `json:"activeSessions"`
DailyActiveUsers int64 `json:"dailyActiveUsers"`
DailyActiveAdmins int64 `json:"dailyActiveAdmins"`
DailyActiveEditors int64 `json:"dailyActiveEditors"`
DailyActiveViewers int64 `json:"dailyActiveViewers"`
DailyActiveSessions int64 `json:"dailyActiveSessions"`
MonthlyActiveUsers int64 `json:"monthlyActiveUsers"`
}
type Alert ¶
type Alert struct {
Id int64
Version int64
OrgId int64
DashboardId int64
PanelId int64
Name string
Message string
Severity string // Unused
State AlertStateType
Handler int64 // Unused
Silenced bool
ExecutionError string
Frequency int64
For time.Duration
EvalData *simplejson.Json
NewStateDate time.Time
StateChanges int64
Created time.Time
Updated time.Time
Settings *simplejson.Json
}
swagger:model LegacyAlert
func (*Alert) ContainsUpdates ¶
func (*Alert) GetTagsFromSettings ¶
func (*Alert) ValidToSave ¶
type AlertListItemDTO ¶
type AlertListItemDTO struct {
Id int64 `json:"id"`
DashboardId int64 `json:"dashboardId"`
DashboardUid string `json:"dashboardUid"`
DashboardSlug string `json:"dashboardSlug"`
PanelId int64 `json:"panelId"`
Name string `json:"name"`
State AlertStateType `json:"state"`
NewStateDate time.Time `json:"newStateDate"`
EvalDate time.Time `json:"evalDate"`
EvalData *simplejson.Json `json:"evalData"`
ExecutionError string `json:"executionError"`
Url string `json:"url"`
}
type AlertNotification ¶
type AlertNotification struct {
Id int64 `json:"id"`
Uid string `json:"-"`
OrgId int64 `json:"-"`
Name string `json:"name"`
Type string `json:"type"`
SendReminder bool `json:"sendReminder"`
DisableResolveMessage bool `json:"disableResolveMessage"`
Frequency time.Duration `json:"frequency"`
IsDefault bool `json:"isDefault"`
Settings *simplejson.Json `json:"settings"`
SecureSettings map[string][]byte `json:"secureSettings"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}
type AlertNotificationState ¶
type AlertNotificationStateType ¶
type AlertNotificationStateType string
type AlertStateInfoDTO ¶
type AlertStateType ¶
type AlertStateType string
const ( AlertStateNoData AlertStateType = "no_data" AlertStatePaused AlertStateType = "paused" AlertStateAlerting AlertStateType = "alerting" AlertStateOK AlertStateType = "ok" AlertStatePending AlertStateType = "pending" AlertStateUnknown AlertStateType = "unknown" )
func (AlertStateType) IsValid ¶
func (s AlertStateType) IsValid() bool
type AuthModuleConversion ¶
type AuthModuleConversion []string
implement Conversion interface to define custom field mapping (xorm feature)
func (*AuthModuleConversion) FromDB ¶
func (auth *AuthModuleConversion) FromDB(data []byte) error
func (*AuthModuleConversion) ToDB ¶
func (auth *AuthModuleConversion) ToDB() ([]byte, error)
Just a stub, we don't want to write to database
type ChannelClientCount ¶
ChannelClientCount will return the number of clients for a channel
type ChannelHandler ¶
type ChannelHandler interface {
// OnSubscribe is called when a client wants to subscribe to a channel
OnSubscribe(ctx context.Context, user *user.SignedInUser, e SubscribeEvent) (SubscribeReply, backend.SubscribeStreamStatus, error)
// OnPublish is called when a client writes a message to the channel websocket.
OnPublish(ctx context.Context, user *user.SignedInUser, e PublishEvent) (PublishReply, backend.PublishStreamStatus, error)
}
ChannelHandler defines the core channel behavior
type ChannelHandlerFactory ¶
type ChannelHandlerFactory interface {
// GetHandlerForPath gets a ChannelHandler for a path.
// This is called fast and often -- it must be synchronized
GetHandlerForPath(path string) (ChannelHandler, error)
}
ChannelHandlerFactory should be implemented by all core features.
type ChannelPublisher ¶
ChannelPublisher writes data into a channel. Note that permissions are not checked.
type CreateAlertNotificationCommand ¶
type CreateAlertNotificationCommand struct {
Uid string `json:"uid"`
Name string `json:"name" binding:"Required"`
Type string `json:"type" binding:"Required"`
SendReminder bool `json:"sendReminder"`
DisableResolveMessage bool `json:"disableResolveMessage"`
Frequency string `json:"frequency"`
IsDefault bool `json:"isDefault"`
Settings *simplejson.Json `json:"settings"`
SecureSettings map[string]string `json:"secureSettings"`
OrgId int64 `json:"-"`
EncryptedSecureSettings map[string][]byte `json:"-"`
Result *AlertNotification `json:"-"`
}
type CreateFolderCommand ¶
type CreateLoginAttemptCommand ¶
type CreateLoginAttemptCommand struct {
Username string
IpAddress string
Result LoginAttempt
}
type CreateOrgCommand ¶
type CreateTeamCommand ¶
type CreateTempUserCommand ¶
type CreateTokenErr ¶
CreateTokenErr represents a token creation error; used in Enterprise
func (*CreateTokenErr) Error ¶
func (e *CreateTokenErr) Error() string
type Dashboard ¶
type Dashboard struct {
Id int64
Uid string
Slug string
OrgId int64
GnetId int64
Version int
PluginId string
Created time.Time
Updated time.Time
UpdatedBy int64
CreatedBy int64
FolderId int64
IsFolder bool
HasACL bool `xorm:"has_acl"`
Title string
Data *simplejson.Json
}
Dashboard model
func NewDashboardFolder ¶
NewDashboardFolder creates a new dashboard folder
func NewDashboardFromJson ¶
func NewDashboardFromJson(data *simplejson.Json) *Dashboard
func (*Dashboard) GetDashboardIdForSavePermissionCheck ¶
GetDashboardIdForSavePermissionCheck return the dashboard id to be used for checking permission of dashboard
func (*Dashboard) GetUrl ¶
GetUrl return the html url for a folder if it's folder, otherwise for a dashboard
func (*Dashboard) SetVersion ¶
type DashboardACL ¶
type DashboardACL struct {
// nolint:stylecheck
Id int64
OrgID int64 `xorm:"org_id"`
DashboardID int64 `xorm:"dashboard_id"`
UserID int64 `xorm:"user_id"`
TeamID int64 `xorm:"team_id"`
Role *org.RoleType // pointer to be nullable
Permission PermissionType
Created time.Time
Updated time.Time
}
Dashboard ACL model
func (DashboardACL) TableName ¶
func (p DashboardACL) TableName() string
type DashboardACLInfoDTO ¶
type DashboardACLInfoDTO struct {
OrgId int64 `json:"-"`
DashboardId int64 `json:"dashboardId,omitempty"`
FolderId int64 `json:"folderId,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
UserId int64 `json:"userId"`
UserLogin string `json:"userLogin"`
UserEmail string `json:"userEmail"`
UserAvatarUrl string `json:"userAvatarUrl"`
TeamId int64 `json:"teamId"`
TeamEmail string `json:"teamEmail"`
TeamAvatarUrl string `json:"teamAvatarUrl"`
Team string `json:"team"`
Role *org.RoleType `json:"role,omitempty"`
Permission PermissionType `json:"permission"`
PermissionName string `json:"permissionName"`
Uid string `json:"uid"`
Title string `json:"title"`
Slug string `json:"slug"`
IsFolder bool `json:"isFolder"`
Url string `json:"url"`
Inherited bool `json:"inherited"`
}
func (*DashboardACLInfoDTO) IsDuplicateOf ¶
func (dto *DashboardACLInfoDTO) IsDuplicateOf(other *DashboardACLInfoDTO) bool
IsDuplicateOf returns true if other item has same role, same user or same team
type DashboardActivityChannel ¶
type DashboardActivityChannel interface {
// Called when a dashboard is saved -- this includes the error so we can support a
// gitops workflow that knows if the value was saved to the local database or not
// in many cases all direct save requests will fail, but the request should be forwarded
// to any gitops observers
DashboardSaved(orgID int64, user *user.UserDisplayDTO, message string, dashboard *Dashboard, err error) error
// Called when a dashboard is deleted
DashboardDeleted(orgID int64, user *user.UserDisplayDTO, uid string) error
// Experimental! Indicate is GitOps is active. This really means
// someone is subscribed to the `grafana/dashboards/gitops` channel
HasGitOpsObserver(orgID int64) bool
}
DashboardActivityChannel is a service to advertise dashboard activity
type DashboardProvisioning ¶
type DashboardRef ¶
type DashboardTagCloudItem ¶
type DataSourceAccessStats ¶
type DataSourceStats ¶
type DeleteAuthInfoCommand ¶
type DeleteAuthInfoCommand struct {
UserAuth *UserAuth
}
type DeleteDashboardCommand ¶
type DeleteOrgCommand ¶
type DeleteOrgCommand struct {
Id int64
}
type DeleteOrphanedProvisionedDashboardsCommand ¶
type DeleteOrphanedProvisionedDashboardsCommand struct {
ReaderNames []string
}
type DeleteShortUrlCommand ¶
type DeleteTeamCommand ¶
type DeleteUserCommand ¶
type DeleteUserCommand struct {
UserId int64
}
type DisableUserCommand ¶
type ExecutionErrorOption ¶
type ExecutionErrorOption string
const ( ExecutionErrorSetOk ExecutionErrorOption = "ok" ExecutionErrorSetAlerting ExecutionErrorOption = "alerting" ExecutionErrorKeepState ExecutionErrorOption = "keep_state" )
func (ExecutionErrorOption) IsValid ¶
func (s ExecutionErrorOption) IsValid() bool
func (ExecutionErrorOption) ToAlertState ¶
func (s ExecutionErrorOption) ToAlertState() AlertStateType
type ExpireTempUsersCommand ¶
type ExternalUserInfo ¶
type ExternalUserInfo struct {
OAuthToken *oauth2.Token
AuthModule string
AuthId string
UserId int64
Email string
Login string
Name string
Groups []string
OrgRoles map[int64]org.RoleType
IsGrafanaAdmin *bool // This is a pointer to know if we should sync this or not (nil = ignore sync)
IsDisabled bool
}
type FakeJWTService ¶
func NewFakeJWTService ¶
func NewFakeJWTService() *FakeJWTService
type FindPersistedDashboardsQuery ¶
type FindPersistedDashboardsQuery struct {
Title string
OrgId int64
SignedInUser *user.SignedInUser
IsStarred bool
DashboardIds []int64
DashboardUIDs []string
Type string
FolderIds []int64
Tags []string
Limit int64
Page int64
Permission PermissionType
Sort SortOption
Filters []interface{}
Result HitList
}
type Folder ¶
type Folder struct {
Id int64
Uid string
Title string
Url string
Version int
Created time.Time
Updated time.Time
UpdatedBy int64
CreatedBy int64
HasACL bool
}
func DashboardToFolder ¶
DashboardToFolder converts Dashboard to Folder
type GetAdminStatsQuery ¶
type GetAdminStatsQuery struct {
Result *AdminStats
}
type GetAlertByIdQuery ¶
type GetAlertNotificationsQuery ¶
type GetAlertNotificationsQuery struct {
Name string
Id int64
OrgId int64
Result *AlertNotification
}
type GetAlertNotificationsWithUidQuery ¶
type GetAlertNotificationsWithUidQuery struct {
Uid string
OrgId int64
Result *AlertNotification
}
type GetAlertNotificationsWithUidToSendQuery ¶
type GetAlertNotificationsWithUidToSendQuery struct {
Uids []string
OrgId int64
Result []*AlertNotification
}
type GetAlertNotifierUsageStatsQuery ¶
type GetAlertNotifierUsageStatsQuery struct {
Result []*NotifierUsageStats
}
type GetAlertStatesForDashboardQuery ¶
type GetAlertStatesForDashboardQuery struct {
OrgId int64
DashboardId int64
Result []*AlertStateInfoDTO
}
type GetAlertsQuery ¶
type GetAlertsQuery struct {
OrgId int64
State []string
DashboardIDs []int64
PanelId int64
Limit int64
Query string
User *user.SignedInUser
Result []*AlertListItemDTO
}
Queries
type GetAllAlertNotificationsQuery ¶
type GetAllAlertNotificationsQuery struct {
OrgId int64
Result []*AlertNotification
}
type GetAllAlertsQuery ¶
type GetAllAlertsQuery struct {
Result []*Alert
}
type GetAuthInfoQuery ¶
type GetDBHealthQuery ¶
type GetDBHealthQuery struct{}
type GetDashboardACLInfoListQuery ¶
type GetDashboardACLInfoListQuery struct {
DashboardID int64
OrgID int64
Result []*DashboardACLInfoDTO
}
QUERIES
type GetDashboardQuery ¶
type GetDashboardRefByIdQuery ¶
type GetDashboardRefByIdQuery struct {
Id int64
Result *DashboardRef
}
type GetDashboardTagsQuery ¶
type GetDashboardTagsQuery struct {
OrgId int64
Result []*DashboardTagCloudItem
}
type GetDashboardsQuery ¶
type GetDataSourceAccessStatsQuery ¶
type GetDataSourceAccessStatsQuery struct {
Result []*DataSourceAccessStats
}
type GetDataSourceStatsQuery ¶
type GetDataSourceStatsQuery struct {
Result []*DataSourceStats
}
type GetExternalUserInfoByLoginQuery ¶
type GetExternalUserInfoByLoginQuery struct {
LoginOrEmail string
Result *ExternalUserInfo
}
type GetGlobalQuotaByTargetQuery ¶
type GetGlobalQuotaByTargetQuery struct {
Target string
Default int64
UnifiedAlertingEnabled bool
Result *GlobalQuotaDTO
}
type GetLiveMessageQuery ¶
type GetOrCreateNotificationStateQuery ¶
type GetOrCreateNotificationStateQuery struct {
OrgId int64
AlertId int64
NotifierId int64
Result *AlertNotificationState
}
type GetOrgByIdQuery ¶
type GetOrgByNameQuery ¶
type GetOrgQuotaByTargetQuery ¶
type GetOrgQuotaByTargetQuery struct {
Target string
OrgId int64
Default int64
UnifiedAlertingEnabled bool
Result *OrgQuotaDTO
}
type GetOrgQuotasQuery ¶
type GetOrgQuotasQuery struct {
OrgId int64
UnifiedAlertingEnabled bool
Result []*OrgQuotaDTO
}
type GetOrgUsersQuery ¶
type GetOrgUsersQuery struct {
UserID int64
OrgId int64
Query string
Limit int
// Flag used to allow oss edition to query users without access control
DontEnforceAccessControl bool
User *user.SignedInUser
Result []*OrgUserDTO
}
type GetPluginSettingByIdQuery ¶
type GetPluginSettingByIdQuery struct {
PluginId string
OrgId int64
Result *PluginSetting
}
type GetSignedInUserQuery ¶
type GetSystemStatsQuery ¶
type GetSystemStatsQuery struct {
Result *SystemStats
}
type GetSystemUserCountStatsQuery ¶
type GetSystemUserCountStatsQuery struct {
Result *SystemUserCountStats
}
type GetTeamByIdQuery ¶
type GetTeamMembersQuery ¶
type GetTeamMembersQuery struct {
OrgId int64
TeamId int64
UserId int64
External bool
SignedInUser *user.SignedInUser
Result []*TeamMemberDTO
}
type GetTeamsByUserQuery ¶
type GetTeamsByUserQuery struct {
OrgId int64
UserId int64 `json:"userId"`
Result []*TeamDTO `json:"teams"`
SignedInUser *user.SignedInUser
}
type GetTempUserByCodeQuery ¶
type GetTempUserByCodeQuery struct {
Code string
Result *TempUserDTO
}
type GetTempUsersQuery ¶
type GetTempUsersQuery struct {
OrgId int64
Email string
Status TempUserStatus
Result []*TempUserDTO
}
type GetUserByAuthInfoQuery ¶
type GetUserByAuthInfoQuery struct {
AuthModule string
AuthId string
UserLookupParams
}
type GetUserByEmailQuery ¶
type GetUserByIdQuery ¶
type GetUserByLoginQuery ¶
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
UnifiedAlertingEnabled bool
Result *UserQuotaDTO
}
type GetUserQuotasQuery ¶
type GetUserQuotasQuery struct {
UserId int64
UnifiedAlertingEnabled bool
Result []*UserQuotaDTO
}
type GetUserStarsQuery ¶
type GlobalQuotaDTO ¶
type HasAdminPermissionInDashboardsOrFoldersQuery ¶
type HasAdminPermissionInDashboardsOrFoldersQuery struct {
SignedInUser *user.SignedInUser
Result bool
}
type HasEditPermissionInFoldersQuery ¶
type HasEditPermissionInFoldersQuery struct {
SignedInUser *user.SignedInUser
Result bool
}
type Hit ¶
type Hit struct {
ID int64 `json:"id"`
UID string `json:"uid"`
Title string `json:"title"`
URI string `json:"uri"`
URL string `json:"url"`
Slug string `json:"slug"`
Type HitType `json:"type"`
Tags []string `json:"tags"`
IsStarred bool `json:"isStarred"`
FolderID int64 `json:"folderId,omitempty"`
FolderUID string `json:"folderUid,omitempty"`
FolderTitle string `json:"folderTitle,omitempty"`
FolderURL string `json:"folderUrl,omitempty"`
SortMeta int64 `json:"sortMeta"`
SortMetaName string `json:"sortMetaName,omitempty"`
}
type IsAdminOfTeamsQuery ¶
type IsAdminOfTeamsQuery struct {
SignedInUser *user.SignedInUser
Result bool
}
type IsStarredByUserQuery ¶
type JWTService ¶
type LibraryElementKind ¶
type LibraryElementKind int
LibraryElementKind is used for the kind of library element
const ( // PanelElement is used for library elements that are of the Panel kind PanelElement LibraryElementKind = iota + 1 // VariableElement is used for library elements that are of the Variable kind VariableElement )
type LicenseEnvironment ¶
type Licensing ¶
type Licensing interface {
// Expiry returns the unix epoch timestamp when the license expires, or 0 if no valid license is provided
Expiry() int64
// Return edition
Edition() string
// Used to build content delivery URL
ContentDeliveryPrefix() string
LicenseURL(showAdminLicensingPage bool) string
StateInfo() string
EnabledFeatures() map[string]bool
FeatureEnabled(feature string) bool
}
type LiveMessage ¶
type LoginAttempt ¶
type LoginUserQuery ¶
type NoDataOption ¶
type NoDataOption string
const ( NoDataSetOK NoDataOption = "ok" NoDataSetNoData NoDataOption = "no_data" NoDataKeepState NoDataOption = "keep_state" NoDataSetAlerting NoDataOption = "alerting" )
func (NoDataOption) IsValid ¶
func (s NoDataOption) IsValid() bool
func (NoDataOption) ToAlertState ¶
func (s NoDataOption) ToAlertState() AlertStateType
type NotifierUsageStats ¶
type OrgDetailsDTO ¶
type OrgQuotaDTO ¶
type OrgUserDTO ¶
type OrgUserDTO struct {
OrgId int64 `json:"orgId"`
UserId int64 `json:"userId"`
Email string `json:"email"`
Name string `json:"name"`
AvatarUrl string `json:"avatarUrl"`
Login string `json:"login"`
Role string `json:"role"`
LastSeenAt time.Time `json:"lastSeenAt"`
Updated time.Time `json:"-"`
Created time.Time `json:"-"`
LastSeenAtAge string `json:"lastSeenAtAge"`
AccessControl map[string]bool `json:"accessControl,omitempty"`
IsDisabled bool `json:"isDisabled"`
}
type PauseAlertCommand ¶
type PauseAllAlertCommand ¶
type PermissionType ¶
type PermissionType int
const ( PERMISSION_VIEW PermissionType = 1 << iota PERMISSION_EDIT PERMISSION_ADMIN )
func (PermissionType) String ¶
func (p PermissionType) String() string
type PluginRequestValidator ¶
type PluginSetting ¶
type PluginSettingInfo ¶
type PluginSettingInfoDTO ¶
type PluginStateChangedEvent ¶
type PublishEvent ¶
type PublishEvent struct {
Channel string
Path string
Data json.RawMessage
}
PublishEvent contains publication data.
type PublishReply ¶
type PublishReply struct {
// By default, it's a handler responsibility to publish data
// into a stream upon OnPublish but returning a data here
// will make Grafana Live publish data itself (i.e. stream handler
// just works as permission proxy in this case).
Data json.RawMessage
// HistorySize sets a stream history size.
HistorySize int
// HistoryTTL is a time that messages will live in stream history.
HistoryTTL time.Duration
}
PublishReply is a reaction to PublishEvent.
type QuotaScope ¶
type RemoveOrgUserCommand ¶
type RemoveTeamMemberCommand ¶
type ReqContext ¶
type ReqContext struct {
*web.Context
*user.SignedInUser
UserToken *UserToken
IsSignedIn bool
IsRenderCall bool
AllowAnonymous bool
SkipCache bool
Logger log.Logger
// RequestNonce is a cryptographic request identifier for use with Content Security Policy.
RequestNonce string
IsPublicDashboardView bool
PerfmonTimer prometheus.Summary
LookupTokenErr error
}
func (*ReqContext) HasHelpFlag ¶
func (ctx *ReqContext) HasHelpFlag(flag user.HelpFlags1) bool
func (*ReqContext) HasUserRole ¶
func (ctx *ReqContext) HasUserRole(role org.RoleType) bool
func (*ReqContext) IsApiRequest ¶
func (ctx *ReqContext) IsApiRequest() bool
func (*ReqContext) JsonApiErr ¶
func (ctx *ReqContext) JsonApiErr(status int, message string, err error)
func (*ReqContext) QueryBoolWithDefault ¶
func (ctx *ReqContext) QueryBoolWithDefault(field string, d bool) bool
QueryBoolWithDefault extracts a value from the request query params and applies a bool default if not present.
func (*ReqContext) TimeRequest ¶
func (ctx *ReqContext) TimeRequest(timer prometheus.Summary)
type RequestURIKey ¶
type RequestURIKey struct{}
RequestURIKey is used as key to save request URI in contexts (used for the Enterprise auditing feature)
type RevokeAuthTokenCmd ¶
type RevokeAuthTokenCmd struct {
AuthTokenId int64 `json:"authTokenId"`
}
type SaveDashboardCommand ¶
type SaveDashboardCommand struct {
Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
UserId int64 `json:"userId"`
Overwrite bool `json:"overwrite"`
Message string `json:"message"`
OrgId int64 `json:"-"`
RestoredFrom int `json:"-"`
PluginId string `json:"-"`
FolderId int64 `json:"folderId"`
FolderUid string `json:"folderUid"`
IsFolder bool `json:"isFolder"`
UpdatedAt time.Time
Result *Dashboard `json:"-"`
}
func (*SaveDashboardCommand) GetDashboardModel ¶
func (cmd *SaveDashboardCommand) GetDashboardModel() *Dashboard
GetDashboardModel turns the command into the saveable model
type SaveLiveMessageQuery ¶
type SaveLiveMessageQuery struct {
OrgId int64
Channel string
Data json.RawMessage
}
type SearchOrgUsersQuery ¶
type SearchOrgUsersQuery struct {
OrgID int64
Query string
Page int
Limit int
User *user.SignedInUser
Result SearchOrgUsersQueryResult
}
type SearchOrgUsersQueryResult ¶
type SearchOrgUsersQueryResult struct {
TotalCount int64 `json:"totalCount"`
OrgUsers []*OrgUserDTO `json:"OrgUsers"`
Page int `json:"page"`
PerPage int `json:"perPage"`
}
type SearchOrgsQuery ¶
type SearchTeamQueryResult ¶
type SearchTeamsQuery ¶
type SearchTeamsQuery struct {
Query string
Name string
Limit int
Page int
OrgId int64
UserIdFilter int64
SignedInUser *user.SignedInUser
HiddenUsers map[string]struct{}
Result SearchTeamQueryResult
}
type SearchUserQueryResult ¶
type SearchUserQueryResult struct {
TotalCount int64 `json:"totalCount"`
Users []*UserSearchHitDTO `json:"users"`
Page int `json:"page"`
PerPage int `json:"perPage"`
}
type SearchUsersQuery ¶
type SendEmailAttachFile ¶
SendEmailAttachFile is a definition of the attached files without path
type SendEmailCommand ¶
type SendEmailCommand struct {
To []string
SingleEmail bool
Template string
Subject string
Data map[string]interface{}
Info string
ReplyTo []string
EmbeddedFiles []string
AttachedFiles []*SendEmailAttachFile
}
SendEmailCommand is the command for sending emails
type SendEmailCommandSync ¶
type SendEmailCommandSync struct {
SendEmailCommand
}
SendEmailCommandSync is the command for sending emails synchronously
type SendWebhookSync ¶
type SetAlertStateCommand ¶
type SetAlertStateCommand struct {
AlertId int64
OrgId int64
State AlertStateType
Error string
EvalData *simplejson.Json
Result Alert
}
type SetAuthInfoCommand ¶
type SetUserHelpFlagCommand ¶
type SetUserHelpFlagCommand struct {
HelpFlags1 user.HelpFlags1
UserId int64
}
type SetUsingOrgCommand ¶
type SortOption ¶
type SortOptionFilter ¶
type SortOptionFilter interface {
searchstore.FilterOrderBy
}
type StarDashboardCommand ¶
type SubscribeEvent ¶
type SubscribeEvent struct {
Channel string
Path string
Data json.RawMessage
}
SubscribeEvent contains subscription data.
type SubscribeReply ¶
type SubscribeReply struct {
Presence bool
JoinLeave bool
Recover bool
Data json.RawMessage
}
SubscribeReply is a reaction to SubscribeEvent.
type SystemStats ¶
type SystemStats struct {
Dashboards int64
Datasources int64
Users int64
ActiveUsers int64
DailyActiveUsers int64
MonthlyActiveUsers int64
Orgs int64
Playlists int64
Alerts int64
Stars int64
Snapshots int64
Teams int64
DashboardPermissions int64
FolderPermissions int64
Folders int64
ProvisionedDashboards int64
AuthTokens int64
APIKeys int64 `xorm:"api_keys"`
DashboardVersions int64
Annotations int64
AlertRules int64
LibraryPanels int64
LibraryVariables int64
DashboardsViewersCanEdit int64
DashboardsViewersCanAdmin int64
FoldersViewersCanEdit int64
FoldersViewersCanAdmin int64
Admins int64
Editors int64
Viewers int64
ActiveAdmins int64
ActiveEditors int64
ActiveViewers int64
ActiveSessions int64
DailyActiveAdmins int64
DailyActiveEditors int64
DailyActiveViewers int64
DailyActiveSessions int64
DataKeys int64
ActiveDataKeys int64
PublicDashboards int64
}
type SystemUserCountStats ¶
type SystemUserCountStats struct {
Count int64
}
type Team ¶
type Team struct {
Id int64 `json:"id"`
OrgId int64 `json:"orgId"`
Name string `json:"name"`
Email string `json:"email"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}
Team model
type TeamMember ¶
type TeamMember struct {
Id int64
OrgId int64
TeamId int64
UserId int64
External bool // Signals that the membership has been created by an external systems, such as LDAP
Permission PermissionType
Created time.Time
Updated time.Time
}
TeamMember model
type TeamMemberDTO ¶
type TeamMemberDTO struct {
OrgId int64 `json:"orgId"`
TeamId int64 `json:"teamId"`
UserId int64 `json:"userId"`
External bool `json:"-"`
AuthModule string `json:"auth_module"`
Email string `json:"email"`
Name string `json:"name"`
Login string `json:"login"`
AvatarUrl string `json:"avatarUrl"`
Labels []string `json:"labels"`
Permission PermissionType `json:"permission"`
}
type TeamOrgGroupDTO ¶
type TempUser ¶
type TempUser struct {
Id int64
OrgId int64
Version int
Email string
Name string
Role org.RoleType
InvitedByUserId int64
Status TempUserStatus
EmailSent bool
EmailSentOn time.Time
Code string
RemoteAddr string
Created int64
Updated int64
}
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 org.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" TmpUserExpired TempUserStatus = "Expired" )
type TokenExpiredError ¶
func (*TokenExpiredError) Error ¶
func (e *TokenExpiredError) Error() string
type TokenRevokedError ¶
func (*TokenRevokedError) Error ¶
func (e *TokenRevokedError) Error() string
type TrimDashboardCommand ¶
type TrimDashboardCommand struct {
Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
Meta *simplejson.Json `json:"meta"`
Result *Dashboard `json:"-"`
}
type UnstarDashboardCommand ¶
type UpdateAlertNotificationCommand ¶
type UpdateAlertNotificationCommand struct {
Id int64 `json:"id" binding:"Required"`
Uid string `json:"uid"`
Name string `json:"name" binding:"Required"`
Type string `json:"type" binding:"Required"`
SendReminder bool `json:"sendReminder"`
DisableResolveMessage bool `json:"disableResolveMessage"`
Frequency string `json:"frequency"`
IsDefault bool `json:"isDefault"`
Settings *simplejson.Json `json:"settings" binding:"Required"`
SecureSettings map[string]string `json:"secureSettings"`
OrgId int64 `json:"-"`
EncryptedSecureSettings map[string][]byte `json:"-"`
Result *AlertNotification `json:"-"`
}
type UpdateAlertNotificationWithUidCommand ¶
type UpdateAlertNotificationWithUidCommand struct {
Uid string `json:"-"`
NewUid string `json:"uid"`
Name string `json:"name" binding:"Required"`
Type string `json:"type" binding:"Required"`
SendReminder bool `json:"sendReminder"`
DisableResolveMessage bool `json:"disableResolveMessage"`
Frequency string `json:"frequency"`
IsDefault bool `json:"isDefault"`
Settings *simplejson.Json `json:"settings" binding:"Required"`
SecureSettings map[string]string `json:"secureSettings"`
OrgId int64 `json:"-"`
Result *AlertNotification `json:"-"`
}
type UpdateAuthInfoCommand ¶
type UpdateFolderCommand ¶
type UpdateFolderCommand struct {
Uid string `json:"uid"`
Title string `json:"title"`
Version int `json:"version"`
Overwrite bool `json:"overwrite"`
Result *Folder `json:"-"`
}
func (*UpdateFolderCommand) UpdateDashboardModel ¶
func (cmd *UpdateFolderCommand) UpdateDashboardModel(dashFolder *Dashboard, orgId int64, userId int64)
UpdateDashboardModel updates an existing model from command into model for update
type UpdateOrgAddressCommand ¶
type UpdateOrgQuotaCmd ¶
type UpdateOrgUserCommand ¶
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:"-"`
EncryptedSecureJsonData map[string][]byte `json:"-"`
}
Also acts as api DTO
type UpdatePluginSettingVersionCmd ¶
type UpdatePluginSettingVersionCmd struct {
PluginVersion string
PluginId string `json:"-"`
OrgId int64 `json:"-"`
}
specific command, will only update version
type UpdateTeamCommand ¶
type UpdateTeamMemberCommand ¶
type UpdateTeamMemberCommand struct {
UserId int64 `json:"-"`
OrgId int64 `json:"-"`
TeamId int64 `json:"-"`
Permission PermissionType `json:"permission"`
}
type UpdateTempUserStatusCommand ¶
type UpdateTempUserStatusCommand struct {
Code string
Status TempUserStatus
}
type UpdateTempUserWithEmailSentCommand ¶
type UpdateTempUserWithEmailSentCommand struct {
Code string
}
type UpdateUserCommand ¶
type UpdateUserLastSeenAtCommand ¶
type UpdateUserLastSeenAtCommand struct {
UserId int64
}
type UpdateUserQuotaCmd ¶
type UpsertUserCommand ¶
type UpsertUserCommand struct {
ReqContext *ReqContext
ExternalUser *ExternalUserInfo
UserLookupParams
SignupAllowed bool
Result *user.User
}
type UserLookupParams ¶
type UserOrgDTO ¶
type UserProfileDTO ¶
type UserProfileDTO struct {
Id int64 `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Login string `json:"login"`
Theme string `json:"theme"`
OrgId int64 `json:"orgId,omitempty"`
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
IsDisabled bool `json:"isDisabled"`
IsExternal bool `json:"isExternal"`
AuthLabels []string `json:"authLabels"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
AvatarUrl string `json:"avatarUrl"`
AccessControl map[string]bool `json:"accessControl,omitempty"`
}
type UserQuotaDTO ¶
type UserSearchHitDTO ¶
type UserSearchHitDTO struct {
Id int64 `json:"id"`
Name string `json:"name"`
Login string `json:"login"`
Email string `json:"email"`
AvatarUrl string `json:"avatarUrl"`
IsAdmin bool `json:"isAdmin"`
IsDisabled bool `json:"isDisabled"`
LastSeenAt time.Time `json:"lastSeenAt"`
LastSeenAtAge string `json:"lastSeenAtAge"`
AuthLabels []string `json:"authLabels"`
AuthModule AuthModuleConversion `json:"-"`
}
type UserToken ¶
type UserToken struct {
Id int64
UserId int64
AuthToken string
PrevAuthToken string
UserAgent string
ClientIp string
AuthTokenSeen bool
SeenAt int64
RotatedAt int64
CreatedAt int64
UpdatedAt int64
RevokedAt int64
UnhashedToken string
}
UserToken represents a user token
type UserTokenBackgroundService ¶
type UserTokenBackgroundService interface {
registry.BackgroundService
}
type UserTokenService ¶
type UserTokenService interface {
CreateToken(ctx context.Context, user *user.User, clientIP net.IP, userAgent string) (*UserToken, error)
LookupToken(ctx context.Context, unhashedToken string) (*UserToken, error)
TryRotateToken(ctx context.Context, token *UserToken, clientIP net.IP, userAgent string) (bool, error)
RevokeToken(ctx context.Context, token *UserToken, soft bool) error
RevokeAllUserTokens(ctx context.Context, userId int64) error
GetUserToken(ctx context.Context, userId, userTokenId int64) (*UserToken, error)
GetUserTokens(ctx context.Context, userId int64) ([]*UserToken, error)
GetUserRevokedTokens(ctx context.Context, userId int64) ([]*UserToken, error)
}
UserTokenService are used for generating and validating user tokens
type ValidateDashboardBeforeSaveResult ¶
type ValidateDashboardBeforeSaveResult struct {
IsParentFolderChanged bool
}
Source Files
¶
- address.go
- alert.go
- alert_notifications.go
- context.go
- dashboard_acl.go
- dashboards.go
- folders.go
- health.go
- helpflags.go
- jwt.go
- libraryelements.go
- licensing.go
- live.go
- login_attempt.go
- models.go
- notifications.go
- org.go
- org_user.go
- plugin_settings.go
- quotas.go
- search.go
- shorturl.go
- star.go
- stats.go
- team.go
- team_member.go
- temp_user.go
- theme.go
- user.go
- user_auth.go
- user_token.go
- validations.go