client

package
v0.0.0-...-675f5bb Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 23 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHeaderWithAccessToken

func AuthHeaderWithAccessToken(accessToken string) string

func AuthHeaderWithRefreshToken

func AuthHeaderWithRefreshToken(refreshToken string) string

Types

type CustomRequest

type CustomRequest struct {
	Url         string
	Method      string
	Headers     map[string]string
	QueryParams map[string]interface{}
	Body        []byte
}

type EventsProvider

type EventsProvider struct {
	// contains filtered or unexported fields
}

func NewEventsProviderClient

func NewEventsProviderClient(fqdn string, clientOpts *HttpClientOpts) *EventsProvider

func (*EventsProvider) GetEventsByOrchestratorId

func (c *EventsProvider) GetEventsByOrchestratorId(orchestratorId, accessToken string) ([]*model.Event, error)

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(clientOpts *HttpClientOpts) *HttpClient

func (*HttpClient) CustomRequestToHttpRequest

func (c *HttpClient) CustomRequestToHttpRequest(req CustomRequest) (*http.Request, error)

func (*HttpClient) Do

func (c *HttpClient) Do(req CustomRequest) (*http.Response, error)

func (*HttpClient) DoWithRetries

func (c *HttpClient) DoWithRetries(req CustomRequest, maxAttempts int, successCondition func(response *http.Response) bool) error

func (*HttpClient) ParseBody

func (c *HttpClient) ParseBody(body io.ReadCloser) ([]byte, error)

type HttpClientOpts

type HttpClientOpts struct {
	TimeoutMillis  int64
	IntervalMillis int64
	MaxAttempts    int
}

type KubernetesClient

type KubernetesClient struct {
	// contains filtered or unexported fields
}

func NewInClusterKubernetesClient

func NewInClusterKubernetesClient() (*KubernetesClient, error)

func NewOutOfClusterKubernetesClient

func NewOutOfClusterKubernetesClient() (*KubernetesClient, error)

func (*KubernetesClient) CreateConfigMap

func (c *KubernetesClient) CreateConfigMap(ctx context.Context, configMap *core_v1.ConfigMap) (*core_v1.ConfigMap, error)

func (*KubernetesClient) CreateDeployment

func (c *KubernetesClient) CreateDeployment(ctx context.Context, deployment *apps_v1.Deployment) (*apps_v1.Deployment, error)

func (*KubernetesClient) CreateNamespace

func (c *KubernetesClient) CreateNamespace(ctx context.Context, namespace *core_v1.Namespace) error

func (*KubernetesClient) CreateRole

func (c *KubernetesClient) CreateRole(ctx context.Context, role *rbac_v1.Role) (*rbac_v1.Role, error)

func (*KubernetesClient) CreateRoleBinding

func (c *KubernetesClient) CreateRoleBinding(ctx context.Context, roleBinding *rbac_v1.RoleBinding) (*rbac_v1.RoleBinding, error)

func (*KubernetesClient) CreateSecret

func (c *KubernetesClient) CreateSecret(ctx context.Context, secret *core_v1.Secret) (*core_v1.Secret, error)

func (*KubernetesClient) CreateService

func (c *KubernetesClient) CreateService(ctx context.Context, service *core_v1.Service) (*core_v1.Service, error)

func (*KubernetesClient) CreateServiceAccount

func (c *KubernetesClient) CreateServiceAccount(ctx context.Context, serviceAccount *core_v1.ServiceAccount) (*core_v1.ServiceAccount, error)

func (*KubernetesClient) DeleteConfigMap

func (c *KubernetesClient) DeleteConfigMap(ctx context.Context, namespace k8s.KubernetesNamespace, configMapName string) error

func (*KubernetesClient) DeleteJob

func (c *KubernetesClient) DeleteJob(ctx context.Context, namespace k8s.KubernetesNamespace, jobName string) error

func (*KubernetesClient) DeleteNamespace

func (c *KubernetesClient) DeleteNamespace(ctx context.Context, namespace k8s.KubernetesNamespace) error

func (*KubernetesClient) GetConfigMap

func (c *KubernetesClient) GetConfigMap(ctx context.Context, namespace k8s.KubernetesNamespace, configmapName string) (*core_v1.ConfigMap, error)

func (*KubernetesClient) GetDeployment

func (c *KubernetesClient) GetDeployment(ctx context.Context, namespace k8s.KubernetesNamespace, deploymentName string) (*apps_v1.Deployment, error)

func (*KubernetesClient) GetJob

func (c *KubernetesClient) GetJob(ctx context.Context, namespace k8s.KubernetesNamespace, jobName string) (*batch_v1.Job, error)

func (*KubernetesClient) GetNamespace

func (c *KubernetesClient) GetNamespace(ctx context.Context, namespace k8s.KubernetesNamespace) (*core_v1.Namespace, error)

func (*KubernetesClient) GetSecret

func (c *KubernetesClient) GetSecret(ctx context.Context, namespace k8s.KubernetesNamespace, secretName string) (*core_v1.Secret, error)

func (*KubernetesClient) GetService

func (c *KubernetesClient) GetService(ctx context.Context, namespace k8s.KubernetesNamespace, serviceName string) (*core_v1.Service, error)

func (*KubernetesClient) StartJob

func (c *KubernetesClient) StartJob(ctx context.Context, namespace k8s.KubernetesNamespace, jobSpec *batch_v1.Job) (*batch_v1.Job, error)

func (*KubernetesClient) UpdateConfigMap

func (c *KubernetesClient) UpdateConfigMap(ctx context.Context, namespace k8s.KubernetesNamespace, configMap *core_v1.ConfigMap) (*core_v1.ConfigMap, error)

type RedisClient

type RedisClient struct {
	// contains filtered or unexported fields
}

func NewRedisClient

func NewRedisClient(hostPort string, db int) (*RedisClient, error)

func (*RedisClient) Get

func (c *RedisClient) Get(key string) (string, error)

func (*RedisClient) Set

func (c *RedisClient) Set(key string, value interface{}) (string, error)

func (*RedisClient) XAck

func (c *RedisClient) XAck(streamName, consumerGroupName, messageId string) error

func (*RedisClient) XAdd

func (c *RedisClient) XAdd(streamName string, data interface{}) error

func (*RedisClient) XGroupCreate

func (c *RedisClient) XGroupCreate(streamName, consumerGroupName string) error

func (*RedisClient) XRead

func (c *RedisClient) XRead(streamName string) ([]redis.XMessage, error)

func (*RedisClient) XReadGroup

func (c *RedisClient) XReadGroup(streamName, consumerGrouopName, consumerName string) ([]redis.XMessage, error)

type RegistratorClient

type RegistratorClient struct {
	// contains filtered or unexported fields
}

func NewRegistratorClient

func NewRegistratorClient(fqdn string, clientOpts *HttpClientOpts) *RegistratorClient

func (*RegistratorClient) ActivateOrchestrator

func (c *RegistratorClient) ActivateOrchestrator(orchestratorId string, accessToken string) (*model.OrchestratorActivationResult, error)

func (*RegistratorClient) CreateOrchestrator

func (c *RegistratorClient) CreateOrchestrator(orchestrator *model.Orchestrator, accessToken string) (*model.Orchestrator, error)

func (*RegistratorClient) DeactivateOrchestrator

func (c *RegistratorClient) DeactivateOrchestrator(orchestratorId, accessToken string) error

func (*RegistratorClient) DeleteOrchestrator

func (c *RegistratorClient) DeleteOrchestrator(orchestratorId, accessToken string) error

func (*RegistratorClient) GetOrchestratorAccessToken

func (c *RegistratorClient) GetOrchestratorAccessToken(orchestratorId, refreshToken string) (string, error)

func (*RegistratorClient) GetOrchestratorById

func (c *RegistratorClient) GetOrchestratorById(orchestratorId, accessToken string) (*model.Orchestrator, error)

func (*RegistratorClient) GetOrchestrators

func (c *RegistratorClient) GetOrchestrators(queryParams map[string]interface{}, accessToken string) ([]*model.Orchestrator, error)

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

func NewUserClient

func NewUserClient(fqdn string, clientOpts *HttpClientOpts) *UserClient

func (*UserClient) ActivateUser

func (c *UserClient) ActivateUser(userId string, refreshToken string) error

func (*UserClient) GetUserAccessToken

func (c *UserClient) GetUserAccessToken(userId, refreshToken string) (string, error)

Jump to

Keyboard shortcuts

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