cloudinfodriver

package
v0.0.0-...-2215086 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationRegionListRegions = "cloudinfo.Region.ListRegions"
	OperationRegionListZones   = "cloudinfo.Region.ListZones"
)
View Source
const LogEndpointDefaultName = "gokit/endpoint"

LogEndpointDefaultName is the default endpoint name to use for logging.

View Source
const (
	OperationProviderListProviders = "cloudinfo.Provider.ListProviders"
)
View Source
const (
	OperationServiceListServices = "cloudinfo.Service.ListServices"
)

Variables

This section is empty.

Functions

func LogEndpoint

func LogEndpoint(name string, logger cloudinfo.Logger) endpoint.Middleware

LogEndpoint returns an Endpoint middleware, logging a Go kit endpoint.

func MakeGraphQLHandler

func MakeGraphQLHandler(
	endpoints Endpoints,
	providerEndpoints ProviderEndpoints,
	serviceEndpoints ServiceEndpoints,
	regionEndpoints RegionEndpoints,
	errorHandler cloudinfo.ErrorHandler,
) http.Handler

MakeGraphQLHandler mounts all of the service endpoints into a GraphQL handler.

func MakeInstanceTypeQueryEndpoint

func MakeInstanceTypeQueryEndpoint(s InstanceTypeService) endpoint.Endpoint

MakeInstanceTypeQueryEndpoint returns an endpoint for the matching method of the underlying service.

func MakeListProvidersEndpoint

func MakeListProvidersEndpoint(s ProviderService) endpoint.Endpoint

MakeListProvidersEndpoint returns an endpoint for the matching method of the underlying service.

func MakeListRegionsEndpoint

func MakeListRegionsEndpoint(s RegionService) endpoint.Endpoint

MakeListRegionsEndpoint returns an endpoint for the matching method of the underlying service.

func MakeListServicesEndpoint

func MakeListServicesEndpoint(s ServiceService) endpoint.Endpoint

MakeListServicesEndpoint returns an endpoint for the matching method of the underlying service.

func MakeListZonesEndpoint

func MakeListZonesEndpoint(s RegionService) endpoint.Endpoint

MakeListZonesEndpoint returns an endpoint for the matching method of the underlying service.

Types

type Endpoints

type Endpoints struct {
	InstanceTypeQuery endpoint.Endpoint
}

Endpoints collects all of the endpoints that compose an instance type service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func MakeEndpoints

func MakeEndpoints(its InstanceTypeService) Endpoints

MakeEndpoints returns an Endpoints struct where each endpoint invokes the corresponding method on the provided service.

type InstanceTypeService

type InstanceTypeService interface {
	// Query processes an instance type query and responds with a list match of instance types matching that query.
	Query(ctx context.Context, provider string, service string, query cloudinfo.InstanceTypeQuery) ([]cloudinfo.InstanceType, error)
}

InstanceTypeService filters instance types according to the received query.

type ProviderEndpoints

type ProviderEndpoints struct {
	List endpoint.Endpoint
}

Endpoints collects all of the endpoints that compose a service service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func MakeProviderEndpoints

func MakeProviderEndpoints(s ProviderService, logger cloudinfo.Logger) ProviderEndpoints

MakeProviderEndpoints returns an Endpoints struct where each endpoint invokes the corresponding method on the provided service.

type ProviderService

type ProviderService interface {
	// ListProviders returns a list of providers.
	ListProviders(ctx context.Context) ([]cloudinfo.Provider, error)
}

ProviderService returns the list of supported providers and relevant information.

type RegionEndpoints

type RegionEndpoints struct {
	ListRegions endpoint.Endpoint
	ListZones   endpoint.Endpoint
}

RegionEndpoints collects all of the endpoints that compose a region service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func MakeRegionEndpoints

func MakeRegionEndpoints(s RegionService, logger cloudinfo.Logger) RegionEndpoints

MakeRegionEndpoints returns an Endpoints struct where each endpoint invokes the corresponding method on the provided service.

type RegionService

type RegionService interface {
	// ListRegions returns a list of regions supported by a service.
	ListRegions(ctx context.Context, provider string, service string) ([]cloudinfo.Region, error)

	// ListZones returns a list of zones within a region.
	ListZones(ctx context.Context, provider string, service string, region string) ([]cloudinfo.Zone, error)
}

RegionService provides access to regions supported by a service.

type ServiceEndpoints

type ServiceEndpoints struct {
	List endpoint.Endpoint
}

ServiceEndpoints collects all of the endpoints that compose a service service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func MakeServiceEndpoints

func MakeServiceEndpoints(s ServiceService, logger cloudinfo.Logger) ServiceEndpoints

MakeServiceEndpoints returns an Endpoints struct where each endpoint invokes the corresponding method on the provided service.

type ServiceService

type ServiceService interface {
	// ListServices returns a list of services supported by a provider.
	ListServices(ctx context.Context, provider string) ([]cloudinfo.Service, error)
}

ServiceService returns the list of supported services.

Jump to

Keyboard shortcuts

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