Documentation
¶
Index ¶
- Constants
- Variables
- func IsKnownDataSourcePlugin(dsType string) bool
- type AddApiKeyCommand
- type AddDataSourceCommand
- type AddOrgUserCommand
- type Address
- type ApiKey
- type ApiKeyDTO
- type ChangeUserPasswordCommand
- type CreateDashboardSnapshotCommand
- type CreateOrgCommand
- type CreateTempUserCommand
- type CreateUserCommand
- type Dashboard
- type DashboardSnapshot
- type DashboardTagCloudItem
- type DataSource
- type DataSourceCreatedEvent
- type DataSourceStats
- type DeleteApiKeyCommand
- type DeleteDashboardCommand
- type DeleteDashboardSnapshotCommand
- type DeleteDataSourceCommand
- type DeleteOrgCommand
- type DeleteUserCommand
- type DsAccess
- type GetApiKeyByIdQuery
- type GetApiKeyByNameQuery
- type GetApiKeysQuery
- type GetDashboardQuery
- type GetDashboardSnapshotQuery
- type GetDashboardTagsQuery
- type GetDataSourceByIdQuery
- type GetDataSourceByNameQuery
- type GetDataSourceStatsQuery
- type GetDataSourcesQuery
- type GetGlobalQuotaByTargetQuery
- type GetOrgByIdQuery
- type GetOrgByNameQuery
- type GetOrgQuotaByTargetQuery
- type GetOrgQuotasQuery
- type GetOrgUsersQuery
- type GetSignedInUserQuery
- type GetSystemStatsQuery
- type GetTempUserByCodeQuery
- type GetTempUsersQuery
- type GetUserByIdQuery
- type GetUserByLoginQuery
- type GetUserOrgListQuery
- type GetUserProfileQuery
- type GetUserQuotaByTargetQuery
- type GetUserQuotasQuery
- type GetUserStarsQuery
- type GlobalQuotaDTO
- type HomeDashboard
- type IsStarredByUserQuery
- type OAuthType
- type Org
- type OrgDTO
- type OrgDetailsDTO
- type OrgQuotaDTO
- type OrgUser
- type OrgUserDTO
- type Quota
- type QuotaScope
- type RemoveOrgUserCommand
- type RoleType
- type SaveDashboardCommand
- type SearchHit
- type SearchOrgsQuery
- type SearchUsersQuery
- type SendEmailCommand
- type SendResetPasswordEmailCommand
- type SetUsingOrgCommand
- type SignedInUser
- type Star
- type StarDashboardCommand
- type SystemStats
- type TempUser
- type TempUserDTO
- type TempUserStatus
- type UnstarDashboardCommand
- type UpdateApiKeyCommand
- type UpdateDataSourceCommand
- type UpdateOrgAddressCommand
- type UpdateOrgCommand
- type UpdateOrgQuotaCmd
- type UpdateOrgUserCommand
- type UpdateTempUserStatusCommand
- type UpdateUserCommand
- type UpdateUserPermissionsCommand
- type UpdateUserQuotaCmd
- type User
- type UserOrgDTO
- type UserProfileDTO
- type UserQuotaDTO
- type UserSearchHitDTO
- type ValidateResetPasswordCodeQuery
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
Typed errors
Typed errors
Typed errors
Functions ¶
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"`
IsDefault bool `json:"isDefault"`
JsonData map[string]interface{} `json:"jsonData"`
OrgId int64 `json:"-"`
Result *DataSource
}
Also acts as api DTO
type AddOrgUserCommand ¶
type Address ¶
type ApiKey ¶
type ApiKeyDTO ¶
type ChangeUserPasswordCommand ¶
type CreateDashboardSnapshotCommand ¶
type CreateDashboardSnapshotCommand struct {
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
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 CreateTempUserCommand ¶
type CreateUserCommand ¶
type Dashboard ¶
type Dashboard struct {
Id int64
Slug string
OrgId int64
Version int
Created time.Time
Updated time.Time
Title string
Data map[string]interface{}
}
Dashboard model
func (*Dashboard) GetTags ¶
GetTags turns the tags in data json into go string array
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 map[string]interface{}
}
DashboardSnapshot model
type DashboardTagCloudItem ¶
type DataSource ¶
type DeleteApiKeyCommand ¶
type DeleteDashboardSnapshotCommand ¶
type DeleteDashboardSnapshotCommand struct {
DeleteKey string `json:"-"`
}
type GetApiKeyByNameQuery ¶
type GetDashboardQuery ¶
type GetDashboardSnapshotQuery ¶
type GetDashboardSnapshotQuery struct {
Key string
Result *DashboardSnapshot
}
type GetDashboardTagsQuery ¶
type GetDashboardTagsQuery struct {
OrgId int64
Result []*DashboardTagCloudItem
}
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 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 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 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 GlobalQuotaDTO ¶
type HomeDashboard ¶
type IsStarredByUserQuery ¶
type Org ¶
type OrgDetailsDTO ¶
type OrgQuotaDTO ¶
type OrgUser ¶
type OrgUserDTO ¶
type Quota ¶
type QuotaScope ¶
func GetQuotaScopes ¶
func GetQuotaScopes(target string) ([]QuotaScope, error)
type SaveDashboardCommand ¶
type SaveDashboardCommand struct {
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
Overwrite bool `json:"overwrite"`
OrgId int64 `json:"-"`
Result *Dashboard
}
func (*SaveDashboardCommand) GetDashboardModel ¶
func (cmd *SaveDashboardCommand) GetDashboardModel() *Dashboard
GetDashboardModel turns the command into the savable model
type SearchHit ¶
type SearchOrgsQuery ¶
type SearchUsersQuery ¶
type SearchUsersQuery struct {
Query string
Page int
Limit int
Result []*UserSearchHitDTO
}
type SendEmailCommand ¶
type SignedInUser ¶
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 UpdateApiKeyCommand ¶
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"`
IsDefault bool `json:"isDefault"`
JsonData map[string]interface{} `json:"jsonData"`
OrgId int64 `json:"-"`
Id int64 `json:"-"`
}
Also acts as api DTO
type UpdateOrgQuotaCmd ¶
type UpdateOrgUserCommand ¶
type UpdateTempUserStatusCommand ¶
type UpdateTempUserStatusCommand struct {
Code string
Status TempUserStatus
}
type UpdateUserCommand ¶
type UpdateUserPermissionsCommand ¶
type UpdateUserQuotaCmd ¶
type User ¶
type UserOrgDTO ¶
type UserProfileDTO ¶
type UserQuotaDTO ¶
type UserSearchHitDTO ¶
Source Files
¶
- address.go
- apikey.go
- dashboard_snapshot.go
- dashboards.go
- datasource.go
- emails.go
- home_dashboard.go
- models.go
- org.go
- org_user.go
- quotas.go
- search.go
- star.go
- stats.go
- temp_user.go
- user.go
Click to show internal directories.
Click to hide internal directories.