Documentation ¶
Index ¶
- Constants
- func LogEndpoint(name string, logger cloudinfo.Logger) endpoint.Middleware
- func MakeGraphQLHandler(endpoints Endpoints, providerEndpoints ProviderEndpoints, ...) http.Handler
- func MakeInstanceTypeQueryEndpoint(s InstanceTypeService) endpoint.Endpoint
- func MakeListProvidersEndpoint(s ProviderService) endpoint.Endpoint
- func MakeListRegionsEndpoint(s RegionService) endpoint.Endpoint
- func MakeListServicesEndpoint(s ServiceService) endpoint.Endpoint
- func MakeListZonesEndpoint(s RegionService) endpoint.Endpoint
- type Endpoints
- type InstanceTypeService
- type ProviderEndpoints
- type ProviderService
- type RegionEndpoints
- type RegionService
- type ServiceEndpoints
- type ServiceService
Constants ¶
const ( OperationRegionListRegions = "cloudinfo.Region.ListRegions" OperationRegionListZones = "cloudinfo.Region.ListZones" )
const LogEndpointDefaultName = "gokit/endpoint"
LogEndpointDefaultName is the default endpoint name to use for logging.
const (
OperationProviderListProviders = "cloudinfo.Provider.ListProviders"
)
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 ¶
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 ¶
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 ¶
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 ¶
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.