controlplane

package
v0.0.0-...-e46bc45 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

Index

Constants

View Source
const (
	// CreationTimeStamp constant for annotation creationTimeStamp
	CreationTimeStamp = "creationTimeStamp"
)

Variables

This section is empty.

Functions

func InvokeControlPlane

func InvokeControlPlane(req *http.Request, skipSSL bool) (*http.Response, error)

InvokeControlPlane sends request to the control plane and returns the response

func InvokeService

func InvokeService(endpoint string, responseType interface{}, queryParamMap map[string]string, c chan response,
	retryAttempt int)

InvokeService invokes the internal data resource

Types

type Agent

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

Agent is a struct that implements Agent interface

func NewControlPlaneAgent

func NewControlPlaneAgent(hostname string, port int, controlPlaneID string, artifactDeployer ArtifactDeployer) *Agent

NewControlPlaneAgent creates a new ControlPlaneAgent

func (*Agent) StartEventStreaming

func (controlPlaneGrpcClient *Agent) StartEventStreaming()

StartEventStreaming starts event streaming

type Application

type Application struct {
	UUID            string            `json:"uuid,omitempty"`
	Name            string            `json:"name,omitempty"`
	Owner           string            `json:"owner,omitempty"`
	Organization    string            `json:"organization,omitempty"`
	Attributes      map[string]string `json:"attributes,omitempty"`
	TimeStamp       int64             `json:"timeStamp,omitempty"`
	SecuritySchemes []SecurityScheme  `json:"securitySchemes,omitempty"`
}

Application for struct application

type ApplicationList

type ApplicationList struct {
	List []Application `json:"list"`
}

ApplicationList for struct list of application

type ApplicationMapping

type ApplicationMapping struct {
	UUID            string `json:"uuid,omitempty"`
	ApplicationRef  string `json:"applicationRef,omitempty"`
	SubscriptionRef string `json:"subscriptionRef,omitempty"`
	Organization    string `json:"organization,omitempty"`
}

ApplicationMapping for struct applicationMapping

type ApplicationMappingList

type ApplicationMappingList struct {
	List []ApplicationMapping `json:"list"`
}

ApplicationMappingList for struct list of applicationMapping

type ArtifactDeployer

type ArtifactDeployer interface {
	DeployApplication(application server.Application) error
	UpdateApplication(application server.Application) error
	DeploySubscription(subscription server.Subscription) error
	UpdateSubscription(subscription server.Subscription) error
	DeployApplicationMappings(applicationMapping server.ApplicationMapping) error
	UpdateApplicationMappings(applicationMapping server.ApplicationMapping) error
	DeployKeyMappings(keyMapping server.ApplicationKeyMapping) error
	UpdateKeyMappings(keyMapping server.ApplicationKeyMapping) error
	GetApplication(applicationID string) (server.Application, error)
	GetSubscription(subscriptionID string) (server.Subscription, error)
	GetApplicationMappings(applicationID string) (server.ApplicationMapping, error)
	GetKeyMappings(applicationID string) (server.ApplicationKeyMapping, error)
	GetAllApplications() (server.ApplicationList, error)
	GetAllSubscriptions() (server.SubscriptionList, error)
	GetAllApplicationMappings() (server.ApplicationMappingList, error)
	GetAllKeyMappings() (server.ApplicationKeyMappingList, error)
	DeleteApplication(applicationID string) error
	DeleteSubscription(subscriptionID string) error
	DeleteApplicationMappings(applicationID string) error
	DeleteKeyMappings(keyMapping server.ApplicationKeyMapping) error
	DeployAllApplications(applications server.ApplicationList) error
	DeployAllSubscriptions(subscriptions server.SubscriptionList) error
	DeployAllApplicationMappings(applicationMappings server.ApplicationMappingList) error
	DeployAllKeyMappings(keyMappings server.ApplicationKeyMappingList) error
}

ArtifactDeployer is an interface that defines the methods that should be implemented by an artifact deployer

type K8sArtifactDeployer

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

K8sArtifactDeployer is a struct that implements ArtifactDeployer interface

func NewK8sArtifactDeployer

func NewK8sArtifactDeployer(mgr manager.Manager) K8sArtifactDeployer

NewK8sArtifactDeployer creates a new K8sArtifactDeployer

func (K8sArtifactDeployer) DeleteAllApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteAllApplicationMappings() error

DeleteAllApplicationMappings deletes all application mappings

func (K8sArtifactDeployer) DeleteAllKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteAllKeyMappings() error

DeleteAllKeyMappings deletes all key mappings

func (K8sArtifactDeployer) DeleteAllSubscriptions

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteAllSubscriptions() error

DeleteAllSubscriptions deletes all subscriptions

func (K8sArtifactDeployer) DeleteApplication

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteApplication(applicationID string) error

DeleteApplication deletes an application

func (K8sArtifactDeployer) DeleteApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteApplicationMappings(applicationMapping string) error

DeleteApplicationMappings deletes an application mapping

func (K8sArtifactDeployer) DeleteKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteKeyMappings(keyMapping server.ApplicationKeyMapping) error

DeleteKeyMappings deletes a key mapping

func (K8sArtifactDeployer) DeleteSubscription

func (k8sArtifactDeployer K8sArtifactDeployer) DeleteSubscription(subscriptionID string) error

DeleteSubscription deletes a subscription

func (K8sArtifactDeployer) DeployAllApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeployAllApplicationMappings(applicationMappings server.ApplicationMappingList) error

DeployAllApplicationMappings deploys all application mappings

func (K8sArtifactDeployer) DeployAllApplications

func (k8sArtifactDeployer K8sArtifactDeployer) DeployAllApplications(applications server.ApplicationList) error

DeployAllApplications deploys all key mappings

func (K8sArtifactDeployer) DeployAllKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeployAllKeyMappings(keyMappings server.ApplicationKeyMappingList) error

DeployAllKeyMappings deploys all key mappings

func (K8sArtifactDeployer) DeployAllSubscriptions

func (k8sArtifactDeployer K8sArtifactDeployer) DeployAllSubscriptions(subscriptions server.SubscriptionList) error

DeployAllSubscriptions deploys all subscriptions

func (K8sArtifactDeployer) DeployApplication

func (k8sArtifactDeployer K8sArtifactDeployer) DeployApplication(application server.Application) error

DeployApplication deploys an application

func (K8sArtifactDeployer) DeployApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeployApplicationMappings(applicationMapping server.ApplicationMapping) error

DeployApplicationMappings deploys an application mapping

func (K8sArtifactDeployer) DeployKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) DeployKeyMappings(keyMapping server.ApplicationKeyMapping) error

DeployKeyMappings deploys a key mapping

func (K8sArtifactDeployer) DeploySubscription

func (k8sArtifactDeployer K8sArtifactDeployer) DeploySubscription(subscription server.Subscription) error

DeploySubscription deploys a subscription

func (K8sArtifactDeployer) GetAllApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) GetAllApplicationMappings() (server.ApplicationMappingList, error)

GetAllApplicationMappings returns all application mappings

func (K8sArtifactDeployer) GetAllApplications

func (k8sArtifactDeployer K8sArtifactDeployer) GetAllApplications() (server.ApplicationList, error)

GetAllApplications returns all applications

func (K8sArtifactDeployer) GetAllKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) GetAllKeyMappings() (server.ApplicationKeyMappingList, error)

GetAllKeyMappings returns all key mappings

func (K8sArtifactDeployer) GetAllSubscriptions

func (k8sArtifactDeployer K8sArtifactDeployer) GetAllSubscriptions() (server.SubscriptionList, error)

GetAllSubscriptions returns all subscriptions

func (K8sArtifactDeployer) GetApplication

func (k8sArtifactDeployer K8sArtifactDeployer) GetApplication(applicationID string) (server.Application, error)

GetApplication returns an application

func (K8sArtifactDeployer) GetApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) GetApplicationMappings(applicationID string) (server.ApplicationMapping, error)

GetApplicationMappings returns an application mapping

func (K8sArtifactDeployer) GetKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) GetKeyMappings(applicationID string) (server.ApplicationKeyMapping, error)

GetKeyMappings returns a key mapping

func (K8sArtifactDeployer) GetSubscription

func (k8sArtifactDeployer K8sArtifactDeployer) GetSubscription(subscriptionID string) (server.Subscription, error)

GetSubscription returns a subscription

func (K8sArtifactDeployer) UpdateApplication

func (k8sArtifactDeployer K8sArtifactDeployer) UpdateApplication(application server.Application) error

UpdateApplication updates an application

func (K8sArtifactDeployer) UpdateApplicationMappings

func (k8sArtifactDeployer K8sArtifactDeployer) UpdateApplicationMappings(applicationMapping server.ApplicationMapping) error

UpdateApplicationMappings updates an application mapping

func (K8sArtifactDeployer) UpdateKeyMappings

func (k8sArtifactDeployer K8sArtifactDeployer) UpdateKeyMappings(keyMapping server.ApplicationKeyMapping) error

UpdateKeyMappings updates a key mapping

func (K8sArtifactDeployer) UpdateSubscription

func (k8sArtifactDeployer K8sArtifactDeployer) UpdateSubscription(subscription server.Subscription) error

UpdateSubscription updates a subscription

type SecurityScheme

type SecurityScheme struct {
	SecurityScheme        string `json:"securityScheme,omitempty"`
	ApplicationIdentifier string `json:"applicationIdentifier,omitempty"`
	KeyType               string `json:"keyType,omitempty"`
	EnvID                 string `json:"envID,omitempty"`
}

SecurityScheme for struct securityScheme

type SubscribedAPI

type SubscribedAPI struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

SubscribedAPI for struct subscribedAPI

type Subscription

type Subscription struct {
	SubStatus     string         `json:"subStatus,omitempty"`
	UUID          string         `json:"uuid,omitempty"`
	Organization  string         `json:"organization,omitempty"`
	SubscribedAPI *SubscribedAPI `json:"subscribedApi,omitempty"`
	TimeStamp     int64          `json:"timeStamp,omitempty"`
}

Subscription for struct subscription

type SubscriptionList

type SubscriptionList struct {
	List []Subscription `json:"list"`
}

SubscriptionList for struct list of applications

Jump to

Keyboard shortcuts

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