client

package
v0.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceTypeConversion

func ResourceTypeConversion(resource string) string

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 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 (s *RestClient) AddRoleToUser(username string, rolename string, values map[string]string) (bool, error)

func (*RestClient) Apply

func (s *RestClient) Apply(resourceName string, name string, source string, sourceType string, values map[string]string, update bool) (bool, error)

func (*RestClient) Create

func (s *RestClient) Create(resourceName string, name string, source string, sourceType string, values map[string]string) (bool, error)

func (*RestClient) Delete

func (s *RestClient) Delete(resourceName string, name string, values map[string]string) (bool, error)

func (*RestClient) Get

func (s *RestClient) Get(resourceName string, name string, outputFormat string, values map[string]string) (string, error)

func (*RestClient) GetSpec added in v0.0.35

func (s *RestClient) GetSpec(resourceName string, name string, outputFormat string, values map[string]string) (string, error)

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) List

func (s *RestClient) List(resourceName string, outputFormat string, values map[string]string, simple bool) (string, error)

func (*RestClient) Login

func (s *RestClient) Login(username string, password string) (string, error)

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 (s *RestClient) PushMetricValueInternal(name string, source string, sourceType string, values map[string]string) (bool, error)

func (*RestClient) ReadNotifications added in v0.0.35

func (s *RestClient) ReadNotifications(notifications chan<- models.Notification) error

func (*RestClient) RefreshTokens added in v0.0.35

func (s *RestClient) RefreshTokens() (string, error)

func (*RestClient) RemovePermissionFromUser added in v0.0.35

func (s *RestClient) RemovePermissionFromUser(username string, values map[string]string) (bool, error)

func (*RestClient) RemoveRoleFromUser added in v0.0.35

func (s *RestClient) RemoveRoleFromUser(username string, rolename string, values map[string]string) (bool, error)

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) Update

func (s *RestClient) Update(resourceName string, name string, source string, sourceType string, values map[string]string) (bool, error)

func (*RestClient) UpdatePassword added in v0.0.49

func (s *RestClient) UpdatePassword(userName string, password string, source string, values map[string]string) error

func (*RestClient) UpdateUserPermission added in v0.0.35

func (s *RestClient) UpdateUserPermission(username string, permission string, values map[string]string) (bool, error)

type TokenStore added in v0.0.35

type TokenStore interface {
	Store(token string, timeout int64) error
	Get(token string) (int64, bool)
	Tokens() map[string]int64
	RemoveExpired() error
	Clean() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL