Documentation ¶
Index ¶
- func ResourceTypeConversion(resource string) string
- type FileBackedTokenStore
- type IRestClient
- type InMemoryTokenStore
- type RestClient
- func (s *RestClient) AddRoleToUser(username string, rolename string, values map[string]string) (bool, error)
- func (s *RestClient) Apply(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (s *RestClient) Create(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (s *RestClient) Delete(resourceName string, name string, values map[string]string) (bool, error)
- func (s *RestClient) Get(resourceName string, name string, outputFormat string, ...) (string, error)
- func (s *RestClient) GetSpec(resourceName string, name string, outputFormat string, ...) (string, error)
- func (s *RestClient) GetSubsetMap(values map[string]string) (*models.DestinationsSubsetsMap, error)
- func (s *RestClient) List(resourceName string, outputFormat string, values map[string]string, ...) (string, error)
- func (s *RestClient) Login(username string, password string) (refreshToken string, accessToken string, err error)
- func (s *RestClient) Ping() (bool, error)
- func (s *RestClient) PushMetricValue(name string, metricValue *models.MetricValue, values map[string]string) (bool, error)
- func (s *RestClient) PushMetricValueInternal(name string, source string, sourceType string, values map[string]string) (bool, error)
- func (s *RestClient) ReadNotifications(notifications chan<- models.Notification) error
- func (s *RestClient) RefreshTokens() (refreshToken string, accessToken string, err error)
- func (s *RestClient) RemovePermissionFromUser(username string, values map[string]string) (bool, error)
- func (s *RestClient) RemoveRoleFromUser(username string, rolename string, values map[string]string) (bool, error)
- func (s *RestClient) SendExperimentMetric(experimentName string, metricName string, ...) error
- func (s *RestClient) Update(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (s *RestClient) UpdatePassword(userName string, password string, values map[string]string) error
- func (s *RestClient) UpdateUserPermission(username string, permission string, values map[string]string) (bool, error)
- type RestClientMock
- func (m *RestClientMock) AddRoleToUser(username string, rolename string, values map[string]string) (bool, error)
- func (m *RestClientMock) Apply(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (m *RestClientMock) Create(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (m *RestClientMock) Delete(resourceName string, name string, values map[string]string) (bool, error)
- func (m *RestClientMock) Get(resourceName string, name string, outputFormat string, ...) (string, error)
- func (m *RestClientMock) GetSpec(resourceName string, name string, outputFormat string, ...) (string, error)
- func (m *RestClientMock) GetSubsetMap(values map[string]string) (*models.DestinationsSubsetsMap, error)
- func (m *RestClientMock) List(resourceName string, outputFormat string, values map[string]string, ...) (string, error)
- func (m *RestClientMock) Login(username string, password string) (refreshToken string, accessToken string, err error)
- func (m *RestClientMock) Ping() (bool, error)
- func (m *RestClientMock) PushMetricValue(name string, metricValue *models.MetricValue, values map[string]string) (bool, error)
- func (m *RestClientMock) PushMetricValueInternal(name string, source string, sourceType string, values map[string]string) (bool, error)
- func (m *RestClientMock) ReadNotifications(notifications chan<- models.Notification) error
- func (m *RestClientMock) RefreshTokens() (refreshToken string, accessToken string, err error)
- func (m *RestClientMock) RemovePermissionFromUser(username string, values map[string]string) (bool, error)
- func (m *RestClientMock) RemoveRoleFromUser(username string, rolename string, values map[string]string) (bool, error)
- func (m *RestClientMock) SendExperimentMetric(experimentName string, metricName string, ...) error
- func (m *RestClientMock) Update(resourceName string, name string, source string, sourceType string, ...) (bool, error)
- func (m *RestClientMock) UpdatePassword(userName string, password string, values map[string]string) error
- func (m *RestClientMock) UpdateUserPermission(username string, permission string, values map[string]string) (bool, error)
- type TokenStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResourceTypeConversion ¶
This is added for user friendliness. If a user uses a plural name or misses an underscore, api will still able to work
Types ¶
type FileBackedTokenStore ¶ added in v0.0.35
type FileBackedTokenStore struct {
Path string
}
func (*FileBackedTokenStore) Clean ¶ added in v0.0.36
func (ts *FileBackedTokenStore) Clean() error
func (*FileBackedTokenStore) Get ¶ added in v0.0.35
func (ts *FileBackedTokenStore) Get(token string) (int64, bool)
func (*FileBackedTokenStore) RemoveExpired ¶ added in v0.0.35
func (ts *FileBackedTokenStore) RemoveExpired() error
func (*FileBackedTokenStore) Store ¶ added in v0.0.35
func (ts *FileBackedTokenStore) Store(token string, timeout int64) error
func (*FileBackedTokenStore) Tokens ¶ added in v0.0.35
func (ts *FileBackedTokenStore) Tokens() map[string]int64
type IRestClient ¶ added in v0.0.58
type IRestClient interface { Login(username string, password string) (refreshToken string, accessToken string, err error) RefreshTokens() (refreshToken string, accessToken string, err error) Create(resourceName string, name string, source string, sourceType string, values map[string]string) (bool, error) Update(resourceName string, name string, source string, sourceType string, values map[string]string) (bool, error) PushMetricValueInternal(name string, source string, sourceType string, values map[string]string) (bool, error) PushMetricValue(name string, metricValue *models.MetricValue, values map[string]string) (bool, error) Apply(resourceName string, name string, source string, sourceType string, values map[string]string, update bool) (bool, error) Delete(resourceName string, name string, values map[string]string) (bool, error) UpdatePassword(userName string, password string, values map[string]string) error GetSpec(resourceName string, name string, outputFormat string, values map[string]string) (string, error) Get(resourceName string, name string, outputFormat string, values map[string]string) (string, error) List(resourceName string, outputFormat string, values map[string]string, simple bool) (string, error) UpdateUserPermission(username string, permission string, values map[string]string) (bool, error) RemovePermissionFromUser(username string, values map[string]string) (bool, error) AddRoleToUser(username string, rolename string, values map[string]string) (bool, error) RemoveRoleFromUser(username string, rolename string, values map[string]string) (bool, error) Ping() (bool, error) ReadNotifications(notifications chan<- models.Notification) error SendExperimentMetric(experimentName string, metricName string, experimentMetric *models.ExperimentMetric, values map[string]string) error GetSubsetMap(values map[string]string) (*models.DestinationsSubsetsMap, error) }
type InMemoryTokenStore ¶ added in v0.0.35
type InMemoryTokenStore struct {
// contains filtered or unexported fields
}
func (*InMemoryTokenStore) Clean ¶ added in v0.0.36
func (ts *InMemoryTokenStore) Clean() error
func (*InMemoryTokenStore) Get ¶ added in v0.0.35
func (ts *InMemoryTokenStore) Get(token string) (int64, bool)
func (*InMemoryTokenStore) RemoveExpired ¶ added in v0.0.35
func (ts *InMemoryTokenStore) RemoveExpired() error
func (*InMemoryTokenStore) Store ¶ added in v0.0.35
func (ts *InMemoryTokenStore) Store(token string, timeout int64) error
func (*InMemoryTokenStore) Tokens ¶ added in v0.0.35
func (ts *InMemoryTokenStore) Tokens() map[string]int64
type RestClient ¶
type RestClient struct { URL string Version string Username string Password string Certs string RefreshToken string ExpirationTime int64 TokenStore *TokenStore }
func NewRestClient ¶
func NewRestClient(url string, token string, version string, isVerbose bool, cert string, tokenStore *TokenStore) *RestClient
func (*RestClient) AddRoleToUser ¶ added in v0.0.35
func (*RestClient) GetSubsetMap ¶ added in v0.0.44
func (s *RestClient) GetSubsetMap(values map[string]string) (*models.DestinationsSubsetsMap, error)
GetSubsetMap returns a map for easy conversion of labels to subsets
func (*RestClient) Ping ¶ added in v0.0.35
func (s *RestClient) Ping() (bool, error)
Ping is different from other calls It just runs a get to the root folder and doesn't check anything
func (*RestClient) PushMetricValue ¶ added in v0.0.47
func (s *RestClient) PushMetricValue(name string, metricValue *models.MetricValue, values map[string]string) (bool, error)
func (*RestClient) PushMetricValueInternal ¶ added in v0.0.47
func (*RestClient) ReadNotifications ¶ added in v0.0.35
func (s *RestClient) ReadNotifications(notifications chan<- models.Notification) error
ReadNotifications reads notifications from websocket and sends them to the given channel
func (*RestClient) RefreshTokens ¶ added in v0.0.35
func (s *RestClient) RefreshTokens() (refreshToken string, accessToken string, err error)
func (*RestClient) RemovePermissionFromUser ¶ added in v0.0.35
func (*RestClient) RemoveRoleFromUser ¶ added in v0.0.35
func (*RestClient) SendExperimentMetric ¶ added in v0.0.38
func (s *RestClient) SendExperimentMetric(experimentName string, metricName string, experimentMetric *models.ExperimentMetric, values map[string]string) error
func (*RestClient) UpdatePassword ¶ added in v0.0.49
func (*RestClient) UpdateUserPermission ¶ added in v0.0.35
type RestClientMock ¶ added in v0.0.58
func (*RestClientMock) AddRoleToUser ¶ added in v0.0.58
func (*RestClientMock) GetSubsetMap ¶ added in v0.0.58
func (m *RestClientMock) GetSubsetMap(values map[string]string) (*models.DestinationsSubsetsMap, error)
func (*RestClientMock) Ping ¶ added in v0.0.58
func (m *RestClientMock) Ping() (bool, error)
func (*RestClientMock) PushMetricValue ¶ added in v0.0.58
func (m *RestClientMock) PushMetricValue(name string, metricValue *models.MetricValue, values map[string]string) (bool, error)
func (*RestClientMock) PushMetricValueInternal ¶ added in v0.0.58
func (*RestClientMock) ReadNotifications ¶ added in v0.0.58
func (m *RestClientMock) ReadNotifications(notifications chan<- models.Notification) error
func (*RestClientMock) RefreshTokens ¶ added in v0.0.58
func (m *RestClientMock) RefreshTokens() (refreshToken string, accessToken string, err error)
func (*RestClientMock) RemovePermissionFromUser ¶ added in v0.0.58
func (*RestClientMock) RemoveRoleFromUser ¶ added in v0.0.58
func (*RestClientMock) SendExperimentMetric ¶ added in v0.0.58
func (m *RestClientMock) SendExperimentMetric(experimentName string, metricName string, experimentMetric *models.ExperimentMetric, values map[string]string) error
func (*RestClientMock) UpdatePassword ¶ added in v0.0.58
func (*RestClientMock) UpdateUserPermission ¶ added in v0.0.58
Click to show internal directories.
Click to hide internal directories.