-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Edvin Norling seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
2c07f9c
to
f72f3f9
Compare
This to make it easier to gather playlist without knowing the uid/id. Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
f72f3f9
to
271ce27
Compare
// Playlists fetches and returns a Grafana playlist. | ||
func (c *Client) Playlists(params url.Values) (*[]Playlist, error) { | ||
path := "/api/playlists/" | ||
playlists := &[]Playlist{} | ||
|
||
err := c.request("GET", path, params, nil, playlists) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest not making a pointer to a list, and definitely not returning one.
// Playlists fetches and returns a Grafana playlist. | |
func (c *Client) Playlists(params url.Values) (*[]Playlist, error) { | |
path := "/api/playlists/" | |
playlists := &[]Playlist{} | |
err := c.request("GET", path, params, nil, playlists) | |
// Playlists fetches and returns all Grafana playlists. | |
func (c *Client) Playlists(params url.Values) ([]Playlist, error) { | |
path := "/api/playlists/" | |
playlists := []Playlist{} | |
err := c.request("GET", path, params, nil, &playlists) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow reply.
I have no strong feelings in the matter.
I was trying to be consistent with the PlayList function
grafana-api-golang-client/playlist.go
Line 36 in 21beb08
func (c *Client) Playlist(idOrUID string) (*Playlist, error) { |
👋 I am closing this PR because this repository is now deprecated and will be archived. It will still be accessible in read-only mode. We are now generating the Grafana client from its OpenAPI spec. Check out https://github.com/grafana/grafana-openapi-client-go for the new client. Consider opening an issue or a PR there if functionality is missing. |
This to make it easier to gather playlist without knowing the uid/id.