Chore: Remove unused Go code (#28852)

* Chore: Remove more unused Go code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-11-17 11:51:31 +01:00
committed by GitHub
parent 8c765e8068
commit 4dd7b7a82d
47 changed files with 44 additions and 381 deletions
+1 -8
View File
@@ -10,9 +10,6 @@ import (
)
var (
NotFound = func() Response {
return Error(404, "Not found", nil)
}
ServerError = func(err error) Response {
return Error(500, "Server error", err)
}
@@ -59,16 +56,12 @@ func (r *NormalResponse) WriteTo(ctx *models.ReqContext) {
}
}
func (r *NormalResponse) Cache(ttl string) *NormalResponse {
return r.Header("Cache-Control", "public,max-age="+ttl)
}
func (r *NormalResponse) Header(key, value string) *NormalResponse {
r.header.Set(key, value)
return r
}
// Empty create an empty response
// Empty creates an empty response.
func Empty(status int) *NormalResponse {
return Respond(status, nil)
}
+2
View File
@@ -24,7 +24,9 @@ func (e URLValidationError) Error() string {
return fmt.Sprintf("validation of data source URL %q failed: %s", e.URL, e.Err.Error())
}
// nolint:unused
// Unwrap returns the wrapped error.
// Used by errors package.
func (e URLValidationError) Unwrap() error {
return e.Err
}
-5
View File
@@ -23,11 +23,6 @@ type IndexViewData struct {
Sentry *setting.Sentry
}
type PluginCss struct {
Light string `json:"light"`
Dark string `json:"dark"`
}
const (
// These weights may be used by an extension to reliably place
// itself in relation to a particular item in the menu. The weights
-4
View File
@@ -50,10 +50,6 @@ type MetricRequest struct {
Debug bool `json:"debug"`
}
type UserStars struct {
DashboardIds map[string]bool `json:"dashboardIds"`
}
func GetGravatarUrl(text string) string {
if setting.DisableGravatar {
return setting.AppSubUrl + "/public/img/user_profile.png"
-13
View File
@@ -1,13 +0,0 @@
package dtos
import "encoding/json"
type StreamMessage struct {
Stream string `json:"stream"`
Series []StreamMessageSeries `json:"series"`
}
type StreamMessageSeries struct {
Name string `json:"name"`
Datapoints [][]json.Number `json:"datapoints"`
}
-13
View File
@@ -21,12 +21,6 @@ type AdminCreateUserForm struct {
OrgId int64 `json:"orgId"`
}
type AdminUpdateUserForm struct {
Email string `json:"email"`
Login string `json:"login"`
Name string `json:"name"`
}
type AdminUpdateUserPasswordForm struct {
Password string `json:"password" binding:"Required"`
}
@@ -35,13 +29,6 @@ type AdminUpdateUserPermissionsForm struct {
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
}
type AdminUserListItem struct {
Email string `json:"email"`
Name string `json:"name"`
Login string `json:"login"`
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
}
type SendResetPasswordEmailForm struct {
UserOrEmail string `json:"userOrEmail" binding:"Required"`
}