Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 158ee7b

Browse files
committed
Rename in type in addition to method names
1 parent 9f89d2e commit 158ee7b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

alerting_notification_policy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
// Represents a notification routing tree in Grafana Alerting.
10-
type NotificationPolicy struct {
10+
type NotificationPolicyTree struct {
1111
Receiver string `json:"receiver,omitempty"`
1212
GroupBy []string `json:"group_by,omitempty"`
1313
Routes []SpecificPolicy `json:"routes,omitempty"`
@@ -104,14 +104,14 @@ func (m Matchers) MarshalJSON() ([]byte, error) {
104104
}
105105

106106
// NotificationPolicy fetches the notification policy tree.
107-
func (c *Client) NotificationPolicyTree() (NotificationPolicy, error) {
108-
np := NotificationPolicy{}
107+
func (c *Client) NotificationPolicyTree() (NotificationPolicyTree, error) {
108+
np := NotificationPolicyTree{}
109109
err := c.request("GET", "/api/v1/provisioning/policies", nil, nil, &np)
110110
return np, err
111111
}
112112

113113
// SetNotificationPolicy sets the notification policy tree.
114-
func (c *Client) SetNotificationPolicyTree(np *NotificationPolicy) error {
114+
func (c *Client) SetNotificationPolicyTree(np *NotificationPolicyTree) error {
115115
req, err := json.Marshal(np)
116116
if err != nil {
117117
return err

alerting_notification_policy_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func TestNotificationPolicies(t *testing.T) {
4949
})
5050
}
5151

52-
func createNotificationPolicy() NotificationPolicy {
53-
return NotificationPolicy{
52+
func createNotificationPolicy() NotificationPolicyTree {
53+
return NotificationPolicyTree{
5454
Receiver: "grafana-default-email",
5555
GroupBy: []string{"asdfasdf", "alertname"},
5656
Routes: []SpecificPolicy{

0 commit comments

Comments
 (0)