Versions in this module Expand all Collapse all v1 v1.1.0 Nov 12, 2018 Changes in this version type Client + func (c *Client) ActualUser() (*User, error) + func (c *Client) GetCurrentOrgPrefs() (*OrgPrefs, error) + func (c *Client) SearchDashboards(query string, tag string, starred bool) ([]*DashboardMeta, error) + func (c *Client) UpdateCurrentOrgPrefs(prefs *OrgPrefs) error type DashboardMeta + ID int64 + func (meta *DashboardMeta) SetSlug() type Org + func (o Org) SetHomeDashboard(c *Client, dashID int64) error + type OrgPrefs struct + HomeDashboardID int64 + Theme string + Timezone string v1.0.0 Aug 27, 2018 Changes in this version + type AdminCreateUserForm struct + Email string + Login string + Name string + Password string v0 v0.99.0 Aug 7, 2018 Changes in this version + const OrgUserRoleAdmin + const OrgUserRoleEditor + const OrgUserRoleViewer + var ErrConflict = errors.New(http.StatusText(409)) + var ErrInternalServerError = errors.New(http.StatusText(500)) + var ErrInvalidUserRole = fmt.Errorf("invalid user role") + var ErrNotAuthorized = errors.New(http.StatusText(401)) + var ErrNotFound = errors.New(http.StatusText(404)) + var ErrNotImplemented = errors.New(http.StatusText(501)) + var UserRoleIsValid = IsUserRoleValid + func AutoFixRole(role string) string + func IsUserRoleValid(role string) bool + type AlertNotification struct + ID int64 + IsDefault bool + Name string + Settings interface{} + Type string + type Client struct + LastStatusCode int + func New(auth, baseURL string) (*Client, error) + func (c *Client) AlertNotification(id int64) (*AlertNotification, error) + func (c *Client) AlertNotifications() ([]*AlertNotification, error) + func (c *Client) CreateUser(u User) error + func (c *Client) CreateUserForm(settings dtos.AdminCreateUserForm) error + func (c *Client) Dashboard(uri string) (*Dashboard, error) + func (c *Client) DashboardMetas() ([]*DashboardMeta, error) + func (c *Client) Dashboards() ([]*Dashboard, error) + func (c *Client) DataSource(id int64) (*DataSource, error) + func (c *Client) DataSources() ([]*DataSource, error) + func (c *Client) DataSourcesByOrgID(id int64) ([]*DataSource, error) + func (c *Client) DeleteAlertNotification(id int64) error + func (c *Client) DeleteDashboard(uri string) error + func (c *Client) DeleteDataSource(id int64) error + func (c *Client) DeleteOrg(id int64) error + func (c *Client) DeleteUser(id int64) error + func (c *Client) Do(req *http.Request) (*http.Response, error) + func (c *Client) FrontEndSettings() (map[string]interface{}, error) + func (c *Client) NewAlertNotification(a *AlertNotification) (int64, error) + func (c *Client) NewDataSource(s *DataSource) (int64, error) + func (c *Client) NewOrg(name string) (Org, error) + func (c *Client) NewUser(u User) error + func (c *Client) Org(id int64) (Org, error) + func (c *Client) OrgByName(name string) (Org, error) + func (c *Client) Orgs() ([]Org, error) + func (c *Client) SaveDashboard(model map[string]interface{}, overwrite bool) (*DashboardSaveResponse, error) + func (c *Client) SaveUser(u *User) error + func (c *Client) SetUserAdmin(id int64, admin bool) error + func (c *Client) Stats() (map[string]int64, error) + func (c *Client) SwitchCurrentUserOrg(orgID int64) error + func (c *Client) SwitchUserOrg(userID, orgID int64) error + func (c *Client) UpdateAlertNotification(a *AlertNotification) error + func (c *Client) UpdateDataSource(s *DataSource) error + func (c *Client) UpdateOrgUserRole(orgID, userID int64, role string) error + func (c *Client) User(id int64) (*User, error) + func (c *Client) UserByEmail(email string) (*User, error) + func (c *Client) UserByLogin(login string) (*User, error) + func (c *Client) Users() ([]*User, error) + type Dashboard struct + Meta DashboardMeta + Model map[string]interface{} + func NewDashboard() *Dashboard + func (d *Dashboard) AddTags(newtags ...string) + func (d *Dashboard) RemoveTags(deltags ...string) + func (d *Dashboard) SetTags(newtags ...string) + func (d *Dashboard) Tags() []string + func (d Dashboard) Title() (string, bool) + type DashboardMeta struct + IsStarred bool + Slug string + Tags []string + Title string + Type string + URI string + type DashboardSaveResponse struct + ID int64 + Slug string + Status string + UID int64 + URL string + Version int64 + type DataSource struct + Access string + BasicAuth bool + BasicAuthPassword string + BasicAuthUser string + Database string + ID int64 + IsDefault bool + JSONData JSONData + Name string + OrgID int64 + Password string + SecureJSONData SecureJSONData + Type string + TypeLogoURL string + URL string + User string + type JSONData struct + AssumeRoleArn string + AuthType string + DefaultRegion string + type Org struct + ID int64 + Name string + func (o Org) AddUser(c *Client, username, role string) error + func (o Org) DataSources(c OrgDataSourceGetter) ([]*DataSource, error) + func (o Org) RemoveUser(c *Client, userID int64) error + func (o Org) String() string + func (o Org) Users(c *Client) ([]*OrgUser, error) + type OrgDataSourceGetter interface + DataSourcesByOrgID func(int64) ([]*DataSource, error) + type OrgUser struct + ID int64 + OrgID int64 + Role string + func (ouser OrgUser) UpdateRole(c *Client, role string) error + type OrgUsers []*OrgUser + func (ousers OrgUsers) FindByLogin(login string) (*OrgUser, bool) + func (ousers OrgUsers) Users() []*User + type Response struct + func NewResponse(res *http.Response, rerr error) *Response + func (res *Response) BindJSON(v interface{}) error + func (res *Response) Error() error + func (res *Response) Message() string + func (res *Response) OK() bool + type SecureJSONData struct + AccessKey string + SecretKey string + type Tags map[string]bool + func NewTags(tagslice []string) Tags + func (t Tags) Add(tags ...string) + func (t Tags) Remove(tags ...string) + func (t Tags) Set(tags ...string) + func (t Tags) Strings() []string + type User struct + Email string + ID int64 + IsAdmin bool + Login string + Name string + OrgID string + Password string + func (u User) AddToAllOrgs(c *Client, role string) error + func (u User) MakeGlobalAdmin(c *Client) error + func (u User) MakeGlobalEditor(c *Client) error + func (u User) MakeGlobalViewer(c *Client) error + func (u User) RemoveFromAllOrgs(c *Client) error + func (u User) SwitchOrg(c *Client, orgID int64) error + type Users []*User + func (users Users) FindByEmail(email string) (*User, bool) + func (users Users) FindByLogin(login string) (*User, bool) + func (users Users) FindIndexByEmail(email string) (int, bool) + func (users Users) FindIndexByLogin(login string) (int, bool)