cloud

package
v0.0.0-...-b9cffea Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloud is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// NewClient is a function to create a new API7 Cloud API Client
	NewClient = newClient
)

Functions

func InitDefaultClient

func InitDefaultClient(cloudAddr, accessToken string, trace bool) (err error)

InitDefaultClient initializes the default client with the given configuration

Types

type API

type API interface {
	// Me returns the current user information
	Me() (*cloud.User, error)
	// ListClusters returns the list of clusters in organization
	ListClusters(orgID cloud.ID, limit int, skip int) ([]*cloud.Cluster, error)
	// GetTLSBundle gets the tls bundle used to communicate with API7 Cloud. returns the cluster with the given ID
	GetTLSBundle(clusterID cloud.ID) (*cloud.TLSBundle, error)
	// GetCloudLuaModule returns the Cloud Lua code (in the tar.gz format)
	GetCloudLuaModule() ([]byte, error)
	// GetStartupConfig gets the startup configuration from API7 Cloud for deploy APISIX by specify config type.
	GetStartupConfig(clusterID cloud.ID, configType StartupConfigType) (string, error)
	// GetDefaultOrganization returns the default organization for the current user.
	GetDefaultOrganization() (*cloud.Organization, error)
	// GetDefaultCluster returns the default cluster for the current organization.
	GetDefaultCluster() (*cloud.Cluster, error)
	// GetClusterDetail returns the detail cluster for the specify cluster.
	GetClusterDetail(clusterID cloud.ID) (*cloud.Cluster, error)
	// GetSSL returns the detail of the Certificate (SSL) object.
	GetSSL(clusterID, sslID cloud.ID) (*cloud.CertificateDetails, error)
	// DeleteSSL deletes the specified SSL object.
	DeleteSSL(clusterID, sslID cloud.ID) error
	// ListSSL lists up to *limits* SSL objects in the specified cluster, and it'll
	// skip the first *skip* objects.
	ListSSL(clusterID cloud.ID, limit int, skip int) ([]*cloud.CertificateDetails, error)
	// CreateSSL creates an SSL object according to the given spec.
	CreateSSL(clusterID cloud.ID, ssl *cloud.Certificate) (*cloud.CertificateDetails, error)
	// UpdateSSL updates the SSL object with the given spec.
	UpdateSSL(clusterID cloud.ID, ssl *cloud.Certificate) (*cloud.CertificateDetails, error)
	// DebugShowConfig returns the translated Apache APISIX object with the given API7 Cloud resource type and id.
	DebugShowConfig(clusterID cloud.ID, resource string, id cloud.ID) (string, error)
	// ListServices returns the list of services in application
	ListServices(clusterID cloud.ID, limit int, skip int) ([]*cloud.Application, error)
	// UpdateService return the configuration after the service update
	UpdateService(clusterID cloud.ID, svc *cloud.Application) (*cloud.Application, error)
	// GetService return the service in line with id in application
	GetService(clusterID cloud.ID, appID cloud.ID) (*cloud.Application, error)
	// GetConsumer returns the consumer with the given consumer and cluster.
	GetConsumer(clusterID, consumerID cloud.ID) (*cloud.Consumer, error)
	// GetRoute returns the route with the given app and api.
	GetRoute(clusterID, appID cloud.ID, apiID cloud.ID) (*cloud.API, error)
	// ListConsumers returns the list of consumers in the given cluster.
	ListConsumers(clusterID cloud.ID, limit int, skip int) ([]*cloud.Consumer, error)
	// DeleteService return the service delete success or fail
	DeleteService(clusterID cloud.ID, appID cloud.ID) error
	// CreateService return the configuration after the service create
	CreateService(clusterID cloud.ID, svc *cloud.Application) (*cloud.Application, error)
	// DeleteConsumer deletes the specified consumer.
	DeleteConsumer(clusterID, consumerID cloud.ID) error
	// CreateConsumer creates the consumer with the given spec.
	CreateConsumer(clusterID cloud.ID, consumer *cloud.Consumer) (*cloud.Consumer, error)
	// UpdateConsumer updates the consumer with the given spec.
	UpdateConsumer(clusterID cloud.ID, consumer *cloud.Consumer) (*cloud.Consumer, error)
	// ListAPIs returns the list of APIs in application
	ListRoutes(clusterID cloud.ID, appID cloud.ID, limit int, skip int) ([]*cloud.API, error)
	// DeleteRoute return the route delete success or fail
	DeleteRoute(clusterID, appID cloud.ID, apiID cloud.ID) error
	// CreateRoute return the configuration after the route create
	CreateRoute(clusterID cloud.ID, api *cloud.API) (*cloud.API, error)
	// UpdateRoute return the configuration after the route update
	UpdateRoute(clusterID cloud.ID, api *cloud.API) (*cloud.API, error)
}

API warp API7 Cloud REST API

var (
	DefaultClient API
)

func Client

func Client() API

Client return default client to access API7 Cloud API

type MockAPI

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

MockAPI is a mock of API interface.

func NewMockAPI

func NewMockAPI(ctrl *gomock.Controller) *MockAPI

NewMockAPI creates a new mock instance.

func (*MockAPI) CreateConsumer

func (m *MockAPI) CreateConsumer(clusterID cloud_go_sdk.ID, consumer *cloud_go_sdk.Consumer) (*cloud_go_sdk.Consumer, error)

CreateConsumer mocks base method.

func (*MockAPI) CreateRoute

func (m *MockAPI) CreateRoute(clusterID cloud_go_sdk.ID, api *cloud_go_sdk.API) (*cloud_go_sdk.API, error)

CreateRoute mocks base method.

func (*MockAPI) CreateSSL

CreateSSL mocks base method.

func (*MockAPI) CreateService

func (m *MockAPI) CreateService(clusterID cloud_go_sdk.ID, svc *cloud_go_sdk.Application) (*cloud_go_sdk.Application, error)

CreateService mocks base method.

func (*MockAPI) DebugShowConfig

func (m *MockAPI) DebugShowConfig(clusterID cloud_go_sdk.ID, resource string, id cloud_go_sdk.ID) (string, error)

DebugShowConfig mocks base method.

func (*MockAPI) DeleteConsumer

func (m *MockAPI) DeleteConsumer(clusterID, consumerID cloud_go_sdk.ID) error

DeleteConsumer mocks base method.

func (*MockAPI) DeleteRoute

func (m *MockAPI) DeleteRoute(clusterID, appID, apiID cloud_go_sdk.ID) error

DeleteRoute mocks base method.

func (*MockAPI) DeleteSSL

func (m *MockAPI) DeleteSSL(clusterID, sslID cloud_go_sdk.ID) error

DeleteSSL mocks base method.

func (*MockAPI) DeleteService

func (m *MockAPI) DeleteService(clusterID, appID cloud_go_sdk.ID) error

DeleteService mocks base method.

func (*MockAPI) EXPECT

func (m *MockAPI) EXPECT() *MockAPIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAPI) GetCloudLuaModule

func (m *MockAPI) GetCloudLuaModule() ([]byte, error)

GetCloudLuaModule mocks base method.

func (*MockAPI) GetClusterDetail

func (m *MockAPI) GetClusterDetail(clusterID cloud_go_sdk.ID) (*cloud_go_sdk.Cluster, error)

GetClusterDetail mocks base method.

func (*MockAPI) GetConsumer

func (m *MockAPI) GetConsumer(clusterID, consumerID cloud_go_sdk.ID) (*cloud_go_sdk.Consumer, error)

GetConsumer mocks base method.

func (*MockAPI) GetDefaultCluster

func (m *MockAPI) GetDefaultCluster() (*cloud_go_sdk.Cluster, error)

GetDefaultCluster mocks base method.

func (*MockAPI) GetDefaultOrganization

func (m *MockAPI) GetDefaultOrganization() (*cloud_go_sdk.Organization, error)

GetDefaultOrganization mocks base method.

func (*MockAPI) GetRoute

func (m *MockAPI) GetRoute(clusterID, appID, apiID cloud_go_sdk.ID) (*cloud_go_sdk.API, error)

GetRoute mocks base method.

func (*MockAPI) GetSSL

func (m *MockAPI) GetSSL(clusterID, sslID cloud_go_sdk.ID) (*cloud_go_sdk.CertificateDetails, error)

GetSSL mocks base method.

func (*MockAPI) GetService

func (m *MockAPI) GetService(clusterID, appID cloud_go_sdk.ID) (*cloud_go_sdk.Application, error)

GetService mocks base method.

func (*MockAPI) GetStartupConfig

func (m *MockAPI) GetStartupConfig(clusterID cloud_go_sdk.ID, configType StartupConfigType) (string, error)

GetStartupConfig mocks base method.

func (*MockAPI) GetTLSBundle

func (m *MockAPI) GetTLSBundle(clusterID cloud_go_sdk.ID) (*cloud_go_sdk.TLSBundle, error)

GetTLSBundle mocks base method.

func (*MockAPI) ListClusters

func (m *MockAPI) ListClusters(orgID cloud_go_sdk.ID, limit, skip int) ([]*cloud_go_sdk.Cluster, error)

ListClusters mocks base method.

func (*MockAPI) ListConsumers

func (m *MockAPI) ListConsumers(clusterID cloud_go_sdk.ID, limit, skip int) ([]*cloud_go_sdk.Consumer, error)

ListConsumers mocks base method.

func (*MockAPI) ListRoutes

func (m *MockAPI) ListRoutes(clusterID, appID cloud_go_sdk.ID, limit, skip int) ([]*cloud_go_sdk.API, error)

ListRoutes mocks base method.

func (*MockAPI) ListSSL

func (m *MockAPI) ListSSL(clusterID cloud_go_sdk.ID, limit, skip int) ([]*cloud_go_sdk.CertificateDetails, error)

ListSSL mocks base method.

func (*MockAPI) ListServices

func (m *MockAPI) ListServices(clusterID cloud_go_sdk.ID, limit, skip int) ([]*cloud_go_sdk.Application, error)

ListServices mocks base method.

func (*MockAPI) Me

func (m *MockAPI) Me() (*cloud_go_sdk.User, error)

Me mocks base method.

func (*MockAPI) UpdateConsumer

func (m *MockAPI) UpdateConsumer(clusterID cloud_go_sdk.ID, consumer *cloud_go_sdk.Consumer) (*cloud_go_sdk.Consumer, error)

UpdateConsumer mocks base method.

func (*MockAPI) UpdateRoute

func (m *MockAPI) UpdateRoute(clusterID cloud_go_sdk.ID, api *cloud_go_sdk.API) (*cloud_go_sdk.API, error)

UpdateRoute mocks base method.

func (*MockAPI) UpdateSSL

UpdateSSL mocks base method.

func (*MockAPI) UpdateService

func (m *MockAPI) UpdateService(clusterID cloud_go_sdk.ID, svc *cloud_go_sdk.Application) (*cloud_go_sdk.Application, error)

UpdateService mocks base method.

type MockAPIMockRecorder

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

MockAPIMockRecorder is the mock recorder for MockAPI.

func (*MockAPIMockRecorder) CreateConsumer

func (mr *MockAPIMockRecorder) CreateConsumer(clusterID, consumer interface{}) *gomock.Call

CreateConsumer indicates an expected call of CreateConsumer.

func (*MockAPIMockRecorder) CreateRoute

func (mr *MockAPIMockRecorder) CreateRoute(clusterID, api interface{}) *gomock.Call

CreateRoute indicates an expected call of CreateRoute.

func (*MockAPIMockRecorder) CreateSSL

func (mr *MockAPIMockRecorder) CreateSSL(clusterID, ssl interface{}) *gomock.Call

CreateSSL indicates an expected call of CreateSSL.

func (*MockAPIMockRecorder) CreateService

func (mr *MockAPIMockRecorder) CreateService(clusterID, svc interface{}) *gomock.Call

CreateService indicates an expected call of CreateService.

func (*MockAPIMockRecorder) DebugShowConfig

func (mr *MockAPIMockRecorder) DebugShowConfig(clusterID, resource, id interface{}) *gomock.Call

DebugShowConfig indicates an expected call of DebugShowConfig.

func (*MockAPIMockRecorder) DeleteConsumer

func (mr *MockAPIMockRecorder) DeleteConsumer(clusterID, consumerID interface{}) *gomock.Call

DeleteConsumer indicates an expected call of DeleteConsumer.

func (*MockAPIMockRecorder) DeleteRoute

func (mr *MockAPIMockRecorder) DeleteRoute(clusterID, appID, apiID interface{}) *gomock.Call

DeleteRoute indicates an expected call of DeleteRoute.

func (*MockAPIMockRecorder) DeleteSSL

func (mr *MockAPIMockRecorder) DeleteSSL(clusterID, sslID interface{}) *gomock.Call

DeleteSSL indicates an expected call of DeleteSSL.

func (*MockAPIMockRecorder) DeleteService

func (mr *MockAPIMockRecorder) DeleteService(clusterID, appID interface{}) *gomock.Call

DeleteService indicates an expected call of DeleteService.

func (*MockAPIMockRecorder) GetCloudLuaModule

func (mr *MockAPIMockRecorder) GetCloudLuaModule() *gomock.Call

GetCloudLuaModule indicates an expected call of GetCloudLuaModule.

func (*MockAPIMockRecorder) GetClusterDetail

func (mr *MockAPIMockRecorder) GetClusterDetail(clusterID interface{}) *gomock.Call

GetClusterDetail indicates an expected call of GetClusterDetail.

func (*MockAPIMockRecorder) GetConsumer

func (mr *MockAPIMockRecorder) GetConsumer(clusterID, consumerID interface{}) *gomock.Call

GetConsumer indicates an expected call of GetConsumer.

func (*MockAPIMockRecorder) GetDefaultCluster

func (mr *MockAPIMockRecorder) GetDefaultCluster() *gomock.Call

GetDefaultCluster indicates an expected call of GetDefaultCluster.

func (*MockAPIMockRecorder) GetDefaultOrganization

func (mr *MockAPIMockRecorder) GetDefaultOrganization() *gomock.Call

GetDefaultOrganization indicates an expected call of GetDefaultOrganization.

func (*MockAPIMockRecorder) GetRoute

func (mr *MockAPIMockRecorder) GetRoute(clusterID, appID, apiID interface{}) *gomock.Call

GetRoute indicates an expected call of GetRoute.

func (*MockAPIMockRecorder) GetSSL

func (mr *MockAPIMockRecorder) GetSSL(clusterID, sslID interface{}) *gomock.Call

GetSSL indicates an expected call of GetSSL.

func (*MockAPIMockRecorder) GetService

func (mr *MockAPIMockRecorder) GetService(clusterID, appID interface{}) *gomock.Call

GetService indicates an expected call of GetService.

func (*MockAPIMockRecorder) GetStartupConfig

func (mr *MockAPIMockRecorder) GetStartupConfig(clusterID, configType interface{}) *gomock.Call

GetStartupConfig indicates an expected call of GetStartupConfig.

func (*MockAPIMockRecorder) GetTLSBundle

func (mr *MockAPIMockRecorder) GetTLSBundle(clusterID interface{}) *gomock.Call

GetTLSBundle indicates an expected call of GetTLSBundle.

func (*MockAPIMockRecorder) ListClusters

func (mr *MockAPIMockRecorder) ListClusters(orgID, limit, skip interface{}) *gomock.Call

ListClusters indicates an expected call of ListClusters.

func (*MockAPIMockRecorder) ListConsumers

func (mr *MockAPIMockRecorder) ListConsumers(clusterID, limit, skip interface{}) *gomock.Call

ListConsumers indicates an expected call of ListConsumers.

func (*MockAPIMockRecorder) ListRoutes

func (mr *MockAPIMockRecorder) ListRoutes(clusterID, appID, limit, skip interface{}) *gomock.Call

ListRoutes indicates an expected call of ListRoutes.

func (*MockAPIMockRecorder) ListSSL

func (mr *MockAPIMockRecorder) ListSSL(clusterID, limit, skip interface{}) *gomock.Call

ListSSL indicates an expected call of ListSSL.

func (*MockAPIMockRecorder) ListServices

func (mr *MockAPIMockRecorder) ListServices(clusterID, limit, skip interface{}) *gomock.Call

ListServices indicates an expected call of ListServices.

func (*MockAPIMockRecorder) Me

func (mr *MockAPIMockRecorder) Me() *gomock.Call

Me indicates an expected call of Me.

func (*MockAPIMockRecorder) UpdateConsumer

func (mr *MockAPIMockRecorder) UpdateConsumer(clusterID, consumer interface{}) *gomock.Call

UpdateConsumer indicates an expected call of UpdateConsumer.

func (*MockAPIMockRecorder) UpdateRoute

func (mr *MockAPIMockRecorder) UpdateRoute(clusterID, api interface{}) *gomock.Call

UpdateRoute indicates an expected call of UpdateRoute.

func (*MockAPIMockRecorder) UpdateSSL

func (mr *MockAPIMockRecorder) UpdateSSL(clusterID, ssl interface{}) *gomock.Call

UpdateSSL indicates an expected call of UpdateSSL.

func (*MockAPIMockRecorder) UpdateService

func (mr *MockAPIMockRecorder) UpdateService(clusterID, svc interface{}) *gomock.Call

UpdateService indicates an expected call of UpdateService.

type StartupConfigType

type StartupConfigType string

StartupConfigType is type of gateway startup config

const (
	APISIX StartupConfigType = "apisix"
	HELM   StartupConfigType = "helm"
)

Jump to

Keyboard shortcuts

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