Skip to content

Commit 4cd08a2

Browse files
committed
add godoc comment to exported structs
1 parent fe06df2 commit 4cd08a2

File tree

9 files changed

+15
-1
lines changed

9 files changed

+15
-1
lines changed

dashboard.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type DashboardMeta struct {
1414
Folder int64 `json:"folderId"`
1515
}
1616

17+
// DashboardSaveResponse represents the Grafana API response to creating or saving a dashboard.
1718
type DashboardSaveResponse struct {
1819
Slug string `json:"slug"`
1920
Id int64 `json:"id"`
@@ -22,6 +23,7 @@ type DashboardSaveResponse struct {
2223
Version int64 `json:"version"`
2324
}
2425

26+
// DashboardSearchResponse represents the Grafana API dashboard search response.
2527
type DashboardSearchResponse struct {
2628
Id uint `json:"id"`
2729
Uid string `json:"uid"`
@@ -38,6 +40,7 @@ type DashboardSearchResponse struct {
3840
FolderUrl string `json:"folderUrl"`
3941
}
4042

43+
// Dashboard represents a Grafana dashboard.
4144
type Dashboard struct {
4245
Meta DashboardMeta `json:"meta"`
4346
Model map[string]interface{} `json:"dashboard"`

datasource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
)
88

9+
// DataSource represents a Grafana data source.
910
type DataSource struct {
1011
Id int64 `json:"id,omitempty"`
1112
Name string `json:"name"`

folder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
)
88

9+
// Folder represents a Grafana folder.
910
type Folder struct {
1011
Id int64 `json:"id"`
1112
Uid string `json:"uid"`

folder_permissions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ type FolderPermission struct {
2727
DashboardId int64 `json:"dashboardId,omitempty"`
2828
}
2929

30+
// PermissionItems represents Grafana folder permission items.
3031
type PermissionItems struct {
3132
Items []*PermissionItem `json:"items"`
3233
}
3334

35+
// PermissionItem represents a Grafana folder permission item.
3436
type PermissionItem struct {
3537
// As you can see the docs, each item has a pair of [Role|TeamId|UserId] and Permission.
3638
// unnecessary fields are omitted.

org_users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
)
88

9+
// OrgUser represents a Grafana org user.
910
type OrgUser struct {
1011
OrgId int64 `json:"orgId"`
1112
UserId int64 `json:"userId"`

orgs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
)
88

9+
// Org represents a Grafana org.
910
type Org struct {
1011
Id int64 `json:"id"`
1112
Name string `json:"name"`

playlist.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import (
66
"fmt"
77
)
88

9+
// PlaylistItem represents a Grafana playlist item.
910
type PlaylistItem struct {
1011
Type string `json:"type"`
1112
Value string `json:"value"`
1213
Order int `json:"order"`
1314
Title string `json:"title"`
1415
}
1516

17+
// PlaylistItem represents a Grafana playlist.
1618
type Playlist struct {
1719
Id int `json:"id"`
1820
Name string `json:"name"`

team.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/url"
88
)
99

10+
// SearchTeam represents a search for a Grafana team.
1011
type SearchTeam struct {
1112
TotalCount int64 `json:"totalCount,omitempty"`
1213
Teams []*Team `json:"teams,omitempty"`
@@ -26,7 +27,7 @@ type Team struct {
2627
Permission int64 `json:"permission,omitempty"`
2728
}
2829

29-
// TeamMember
30+
// TeamMember represents a Grafana team member.
3031
type TeamMember struct {
3132
OrgId int64 `json:"orgId,omitempty"`
3233
TeamId int64 `json:"teamId,omitempty"`
@@ -37,6 +38,7 @@ type TeamMember struct {
3738
Permission int64 `json:"permission,omitempty"`
3839
}
3940

41+
// Preferences represents Grafana preferences.
4042
type Preferences struct {
4143
Theme string `json:"theme"`
4244
HomeDashboardId int64 `json:"homeDashboardId"`

user.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"net/url"
55
)
66

7+
// User represents a Grafana user.
78
type User struct {
89
Id int64 `json:"id,omitempty"`
910
Email string `json:"email,omitempty"`

0 commit comments

Comments
 (0)