Documentation
¶
Index ¶
- func Reconcile(ctx context.Context, config Config, keycloakClient *KeycloakClient, ...) error
- type Config
- type Dashboard
- type GrafanaClient
- func (this *GrafanaClient) AddOrgUser(orgID int64, user, role string) error
- func (this *GrafanaClient) CloseIdleConnections()
- func (this *GrafanaClient) CreateUser(user grafana.User) (int64, error)
- func (this *GrafanaClient) Dashboards(org *grafana.Org) ([]grafana.FolderDashboardSearchResponse, error)
- func (this *GrafanaClient) DataSource(org *grafana.Org, id int64) (*grafana.DataSource, error)
- func (this *GrafanaClient) DataSources(org *grafana.Org) ([]*grafana.DataSource, error)
- func (this *GrafanaClient) DeleteDataSource(org *grafana.Org, id int64) error
- func (this *GrafanaClient) DeleteOrg(id int64) error
- func (this *GrafanaClient) DeleteUser(id int64) error
- func (this *GrafanaClient) Folders(org *grafana.Org) ([]grafana.Folder, error)
- func (this *GrafanaClient) GetAutoAssignOrgId() (int64, error)
- func (this *GrafanaClient) GetUserOrgs(user grafana.User) ([]UserOrg, error)
- func (this *GrafanaClient) GetUsername() string
- func (this *GrafanaClient) NewDashboard(org *grafana.Org, dashboard grafana.Dashboard) (*grafana.DashboardSaveResponse, error)
- func (this *GrafanaClient) NewDataSource(org *grafana.Org, s *grafana.DataSource) (int64, error)
- func (this *GrafanaClient) NewFolder(org *grafana.Org, folderName string) (grafana.Folder, error)
- func (this *GrafanaClient) NewOrg(name string) (int64, error)
- func (this *GrafanaClient) Org(id int64) (grafana.Org, error)
- func (this *GrafanaClient) OrgUsers(orgID int64) ([]grafana.OrgUser, error)
- func (this *GrafanaClient) Orgs() ([]grafana.Org, error)
- func (this *GrafanaClient) RemoveOrgUser(orgID, userID int64) error
- func (this *GrafanaClient) UpdateDataSource(org *grafana.Org, s *grafana.DataSource) error
- func (this *GrafanaClient) UpdateOrg(id int64, name string) error
- func (this *GrafanaClient) UpdateOrgUser(orgID, userID int64, role string) error
- func (this *GrafanaClient) UserUpdate(u grafana.User) error
- func (this *GrafanaClient) Users() (users []grafana.UserSearch, err error)
- type GrafanaPermissionSpec
- type KeycloakClient
- func (this *KeycloakClient) CloseIdleConnections()
- func (this *KeycloakClient) GetGroupMemberships(token string, users []*KeycloakUser) (map[*KeycloakUser][]*KeycloakGroup, error)
- func (this *KeycloakClient) GetGroups(token string) ([]*KeycloakGroup, error)
- func (this *KeycloakClient) GetOrganizations(token string) ([]*KeycloakGroup, error)
- func (this *KeycloakClient) GetToken() (string, error)
- func (this *KeycloakClient) GetUsers(token string) ([]*KeycloakUser, error)
- type KeycloakGroup
- type KeycloakUser
- type UserOrg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reconcile ¶ added in v0.4.0
func Reconcile(ctx context.Context, config Config, keycloakClient *KeycloakClient, grafanaClient *GrafanaClient, dashboards []Dashboard) error
Types ¶
type GrafanaClient ¶ added in v0.4.0
type GrafanaClient struct {
// contains filtered or unexported fields
}
func NewGrafanaClient ¶ added in v0.4.0
func NewGrafanaClient(baseURL string, cfg grafana.Config) (*GrafanaClient, error)
func (*GrafanaClient) AddOrgUser ¶ added in v0.4.0
func (this *GrafanaClient) AddOrgUser(orgID int64, user, role string) error
func (*GrafanaClient) CloseIdleConnections ¶ added in v0.4.0
func (this *GrafanaClient) CloseIdleConnections()
func (*GrafanaClient) CreateUser ¶ added in v0.4.0
func (this *GrafanaClient) CreateUser(user grafana.User) (int64, error)
func (*GrafanaClient) Dashboards ¶ added in v0.4.0
func (this *GrafanaClient) Dashboards(org *grafana.Org) ([]grafana.FolderDashboardSearchResponse, error)
Ditto
func (*GrafanaClient) DataSource ¶ added in v0.4.0
func (this *GrafanaClient) DataSource(org *grafana.Org, id int64) (*grafana.DataSource, error)
Ditto
func (*GrafanaClient) DataSources ¶ added in v0.4.0
func (this *GrafanaClient) DataSources(org *grafana.Org) ([]*grafana.DataSource, error)
We don't just wrap this method, we also work around the bad orgID handling of the original library and Grafana API
func (*GrafanaClient) DeleteDataSource ¶ added in v0.4.0
func (this *GrafanaClient) DeleteDataSource(org *grafana.Org, id int64) error
Ditto
func (*GrafanaClient) DeleteOrg ¶ added in v0.4.0
func (this *GrafanaClient) DeleteOrg(id int64) error
func (*GrafanaClient) DeleteUser ¶ added in v0.4.0
func (this *GrafanaClient) DeleteUser(id int64) error
func (*GrafanaClient) GetAutoAssignOrgId ¶ added in v0.4.0
func (this *GrafanaClient) GetAutoAssignOrgId() (int64, error)
func (*GrafanaClient) GetUserOrgs ¶ added in v0.4.0
func (this *GrafanaClient) GetUserOrgs(user grafana.User) ([]UserOrg, error)
This method is missing in the grafana-api-golang-client, that's the reason why we're wrapping that client at all
func (*GrafanaClient) GetUsername ¶ added in v0.4.0
func (this *GrafanaClient) GetUsername() string
func (*GrafanaClient) NewDashboard ¶ added in v0.4.0
func (this *GrafanaClient) NewDashboard(org *grafana.Org, dashboard grafana.Dashboard) (*grafana.DashboardSaveResponse, error)
Ditto
func (*GrafanaClient) NewDataSource ¶ added in v0.4.0
func (this *GrafanaClient) NewDataSource(org *grafana.Org, s *grafana.DataSource) (int64, error)
Ditto
func (*GrafanaClient) NewOrg ¶ added in v0.4.0
func (this *GrafanaClient) NewOrg(name string) (int64, error)
func (*GrafanaClient) Org ¶ added in v0.4.0
func (this *GrafanaClient) Org(id int64) (grafana.Org, error)
func (*GrafanaClient) OrgUsers ¶ added in v0.4.0
func (this *GrafanaClient) OrgUsers(orgID int64) ([]grafana.OrgUser, error)
func (*GrafanaClient) Orgs ¶ added in v0.4.0
func (this *GrafanaClient) Orgs() ([]grafana.Org, error)
func (*GrafanaClient) RemoveOrgUser ¶ added in v0.4.0
func (this *GrafanaClient) RemoveOrgUser(orgID, userID int64) error
func (*GrafanaClient) UpdateDataSource ¶ added in v0.4.0
func (this *GrafanaClient) UpdateDataSource(org *grafana.Org, s *grafana.DataSource) error
Ditto
func (*GrafanaClient) UpdateOrg ¶ added in v0.4.0
func (this *GrafanaClient) UpdateOrg(id int64, name string) error
func (*GrafanaClient) UpdateOrgUser ¶ added in v0.4.0
func (this *GrafanaClient) UpdateOrgUser(orgID, userID int64, role string) error
func (*GrafanaClient) UserUpdate ¶ added in v0.4.0
func (this *GrafanaClient) UserUpdate(u grafana.User) error
func (*GrafanaClient) Users ¶ added in v0.4.0
func (this *GrafanaClient) Users() (users []grafana.UserSearch, err error)
type GrafanaPermissionSpec ¶ added in v0.4.0
type KeycloakClient ¶ added in v0.4.0
type KeycloakClient struct {
// contains filtered or unexported fields
}
func NewKeycloakClient ¶ added in v0.4.0
func (*KeycloakClient) CloseIdleConnections ¶ added in v0.4.0
func (this *KeycloakClient) CloseIdleConnections()
func (*KeycloakClient) GetGroupMemberships ¶ added in v0.4.0
func (this *KeycloakClient) GetGroupMemberships(token string, users []*KeycloakUser) (map[*KeycloakUser][]*KeycloakGroup, error)
func (*KeycloakClient) GetGroups ¶ added in v0.4.0
func (this *KeycloakClient) GetGroups(token string) ([]*KeycloakGroup, error)
func (*KeycloakClient) GetOrganizations ¶ added in v0.4.0
func (this *KeycloakClient) GetOrganizations(token string) ([]*KeycloakGroup, error)
This returns all Keycloak groups with two-level path "/organizations/[ORGNAME]", but not "/organizations/[ORGNAME]/[TEAMNAME]" The returned groups may have subgroups (teams), but the subgroups themselves are not part of the list.
func (*KeycloakClient) GetToken ¶ added in v0.4.0
func (this *KeycloakClient) GetToken() (string, error)
func (*KeycloakClient) GetUsers ¶ added in v0.4.0
func (this *KeycloakClient) GetUsers(token string) ([]*KeycloakUser, error)
type KeycloakGroup ¶ added in v0.4.0
type KeycloakGroup struct { Id string `json:"id"` Name string `json:"name"` Path string `json:"path"` SubGroups []*KeycloakGroup `json:"subGroups"` Attributes *map[string][]string `json:"attributes"` // contains filtered or unexported fields }
func (*KeycloakGroup) GetDisplayNameAttribute ¶ added in v0.4.0
func (this *KeycloakGroup) GetDisplayNameAttribute() string
func (*KeycloakGroup) GetOrganizationName ¶ added in v0.4.0
func (this *KeycloakGroup) GetOrganizationName() string
func (*KeycloakGroup) GetPathElements ¶ added in v0.4.0
func (this *KeycloakGroup) GetPathElements() []string
func (*KeycloakGroup) IsSameOrganization ¶ added in v0.4.0
func (this *KeycloakGroup) IsSameOrganization(other *KeycloakGroup) bool
type KeycloakUser ¶ added in v0.4.0
type KeycloakUser struct { Id string `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Email string `json:"email"` Username string `json:"username"` }
func (*KeycloakUser) GetDisplayName ¶ added in v0.4.0
func (this *KeycloakUser) GetDisplayName() string
Click to show internal directories.
Click to hide internal directories.