pricing

package
v0.71.11 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package pricing is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Pricing_GetInfo_FullMethodName    = "/blueapi.pricing.v1.Pricing/GetInfo"
	Pricing_GetEC2Info_FullMethodName = "/blueapi.pricing.v1.Pricing/GetEC2Info"
)

Variables

View Source
var File_pricing_v1_pricing_proto protoreflect.FileDescriptor
View Source
var Pricing_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blueapi.pricing.v1.Pricing",
	HandlerType: (*PricingServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _Pricing_GetInfo_Handler,
		},
		{
			MethodName: "GetEC2Info",
			Handler:    _Pricing_GetEC2Info_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pricing/v1/pricing.proto",
}

Pricing_ServiceDesc is the grpc.ServiceDesc for Pricing service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPricingHandler

func RegisterPricingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterPricingHandler registers the http handlers for service Pricing to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterPricingHandlerClient

func RegisterPricingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricingClient) error

RegisterPricingHandlerClient registers the http handlers for service Pricing to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PricingClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PricingClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PricingClient" to call the correct interceptors.

func RegisterPricingHandlerFromEndpoint

func RegisterPricingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterPricingHandlerFromEndpoint is same as RegisterPricingHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterPricingHandlerServer

func RegisterPricingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricingServer) error

RegisterPricingHandlerServer registers the http handlers for service Pricing to "mux". UnaryRPC :call PricingServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPricingHandlerFromEndpoint instead.

func RegisterPricingServer

func RegisterPricingServer(s grpc.ServiceRegistrar, srv PricingServer)

Types

type ClientOptions added in v0.71.1

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type Compute added in v0.71.7

type Compute struct {
	Sku     string `protobuf:"bytes,1,opt,name=sku,proto3" json:"sku,omitempty"`
	Tenancy string `protobuf:"bytes,2,opt,name=tenancy,proto3" json:"tenancy,omitempty"`
	Os      string `protobuf:"bytes,3,opt,name=os,proto3" json:"os,omitempty"`
	// contains filtered or unexported fields
}

func (*Compute) Descriptor deprecated added in v0.71.7

func (*Compute) Descriptor() ([]byte, []int)

Deprecated: Use Compute.ProtoReflect.Descriptor instead.

func (*Compute) GetOs added in v0.71.7

func (x *Compute) GetOs() string

func (*Compute) GetSku added in v0.71.7

func (x *Compute) GetSku() string

func (*Compute) GetTenancy added in v0.71.7

func (x *Compute) GetTenancy() string

func (*Compute) ProtoMessage added in v0.71.7

func (*Compute) ProtoMessage()

func (*Compute) ProtoReflect added in v0.71.7

func (x *Compute) ProtoReflect() protoreflect.Message

func (*Compute) Reset added in v0.71.7

func (x *Compute) Reset()

func (*Compute) String added in v0.71.7

func (x *Compute) String() string

type ComputeDetails added in v0.71.7

type ComputeDetails struct {
	InstanceType string `protobuf:"bytes,1,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"`
	Vcpu         int32  `protobuf:"varint,2,opt,name=vcpu,proto3" json:"vcpu,omitempty"`
	MemoryGb     int32  `protobuf:"varint,3,opt,name=memory_gb,json=memoryGb,proto3" json:"memory_gb,omitempty"`
	Os           string `protobuf:"bytes,4,opt,name=os,proto3" json:"os,omitempty"`
	Tenancy      string `protobuf:"bytes,5,opt,name=tenancy,proto3" json:"tenancy,omitempty"`
	Region       string `protobuf:"bytes,6,opt,name=region,proto3" json:"region,omitempty"`
	// contains filtered or unexported fields
}

func (*ComputeDetails) Descriptor deprecated added in v0.71.7

func (*ComputeDetails) Descriptor() ([]byte, []int)

Deprecated: Use ComputeDetails.ProtoReflect.Descriptor instead.

func (*ComputeDetails) GetInstanceType added in v0.71.7

func (x *ComputeDetails) GetInstanceType() string

func (*ComputeDetails) GetMemoryGb added in v0.71.7

func (x *ComputeDetails) GetMemoryGb() int32

func (*ComputeDetails) GetOs added in v0.71.7

func (x *ComputeDetails) GetOs() string

func (*ComputeDetails) GetRegion added in v0.71.7

func (x *ComputeDetails) GetRegion() string

func (*ComputeDetails) GetTenancy added in v0.71.7

func (x *ComputeDetails) GetTenancy() string

func (*ComputeDetails) GetVcpu added in v0.71.7

func (x *ComputeDetails) GetVcpu() int32

func (*ComputeDetails) ProtoMessage added in v0.71.7

func (*ComputeDetails) ProtoMessage()

func (*ComputeDetails) ProtoReflect added in v0.71.7

func (x *ComputeDetails) ProtoReflect() protoreflect.Message

func (*ComputeDetails) Reset added in v0.71.7

func (x *ComputeDetails) Reset()

func (*ComputeDetails) String added in v0.71.7

func (x *ComputeDetails) String() string

type GetEC2InfoRequest added in v0.71.7

type GetEC2InfoRequest struct {
	Cloud   string   `protobuf:"bytes,1,opt,name=cloud,proto3" json:"cloud,omitempty"`
	Service string   `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	Region  string   `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"`
	Compute *Compute `protobuf:"bytes,4,opt,name=compute,proto3" json:"compute,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Pricing.GetEC2Info rpc.

func (*GetEC2InfoRequest) Descriptor deprecated added in v0.71.7

func (*GetEC2InfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEC2InfoRequest.ProtoReflect.Descriptor instead.

func (*GetEC2InfoRequest) GetCloud added in v0.71.7

func (x *GetEC2InfoRequest) GetCloud() string

func (*GetEC2InfoRequest) GetCompute added in v0.71.7

func (x *GetEC2InfoRequest) GetCompute() *Compute

func (*GetEC2InfoRequest) GetRegion added in v0.71.7

func (x *GetEC2InfoRequest) GetRegion() string

func (*GetEC2InfoRequest) GetService added in v0.71.7

func (x *GetEC2InfoRequest) GetService() string

func (*GetEC2InfoRequest) ProtoMessage added in v0.71.7

func (*GetEC2InfoRequest) ProtoMessage()

func (*GetEC2InfoRequest) ProtoReflect added in v0.71.7

func (x *GetEC2InfoRequest) ProtoReflect() protoreflect.Message

func (*GetEC2InfoRequest) Reset added in v0.71.7

func (x *GetEC2InfoRequest) Reset()

func (*GetEC2InfoRequest) String added in v0.71.7

func (x *GetEC2InfoRequest) String() string

type GetEC2InfoResponse added in v0.71.7

type GetEC2InfoResponse struct {
	UnitCostMatrix []*UnitCost     `protobuf:"bytes,1,rep,name=unit_cost_matrix,json=unitCostMatrix,proto3" json:"unit_cost_matrix,omitempty"`
	ServiceDetails *ServiceDetails `protobuf:"bytes,2,opt,name=service_details,json=serviceDetails,proto3" json:"service_details,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Pricing.GetEC2Info rpc.

func (*GetEC2InfoResponse) Descriptor deprecated added in v0.71.7

func (*GetEC2InfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEC2InfoResponse.ProtoReflect.Descriptor instead.

func (*GetEC2InfoResponse) GetServiceDetails added in v0.71.7

func (x *GetEC2InfoResponse) GetServiceDetails() *ServiceDetails

func (*GetEC2InfoResponse) GetUnitCostMatrix added in v0.71.7

func (x *GetEC2InfoResponse) GetUnitCostMatrix() []*UnitCost

func (*GetEC2InfoResponse) ProtoMessage added in v0.71.7

func (*GetEC2InfoResponse) ProtoMessage()

func (*GetEC2InfoResponse) ProtoReflect added in v0.71.7

func (x *GetEC2InfoResponse) ProtoReflect() protoreflect.Message

func (*GetEC2InfoResponse) Reset added in v0.71.7

func (x *GetEC2InfoResponse) Reset()

func (*GetEC2InfoResponse) String added in v0.71.7

func (x *GetEC2InfoResponse) String() string

type GetInfoRequest

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

Request message for the Pricing.GetInfo rpc.

func (*GetInfoRequest) Descriptor deprecated

func (*GetInfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead.

func (*GetInfoRequest) ProtoMessage

func (*GetInfoRequest) ProtoMessage()

func (*GetInfoRequest) ProtoReflect

func (x *GetInfoRequest) ProtoReflect() protoreflect.Message

func (*GetInfoRequest) Reset

func (x *GetInfoRequest) Reset()

func (*GetInfoRequest) String

func (x *GetInfoRequest) String() string

type GetInfoResponse

type GetInfoResponse struct {
	Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Pricing.GetInfo rpc.

func (*GetInfoResponse) Descriptor deprecated

func (*GetInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead.

func (*GetInfoResponse) GetResponse

func (x *GetInfoResponse) GetResponse() string

func (*GetInfoResponse) ProtoMessage

func (*GetInfoResponse) ProtoMessage()

func (*GetInfoResponse) ProtoReflect

func (x *GetInfoResponse) ProtoReflect() protoreflect.Message

func (*GetInfoResponse) Reset

func (x *GetInfoResponse) Reset()

func (*GetInfoResponse) String

func (x *GetInfoResponse) String() string

type GrpcClient added in v0.71.1

type GrpcClient struct {
	PricingClient
	// contains filtered or unexported fields
}

func NewClient added in v0.71.1

func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)

NewClient returns a client connection to the 'pricing' service.

func (*GrpcClient) Close added in v0.71.1

func (c *GrpcClient) Close()

type PricingClient

type PricingClient interface {
	// Test endpoint only.
	GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
	// EC2 service pricing endpoint
	GetEC2Info(ctx context.Context, in *GetEC2InfoRequest, opts ...grpc.CallOption) (*GetEC2InfoResponse, error)
}

PricingClient is the client API for Pricing service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Pricing service definition.

func NewPricingClient

func NewPricingClient(cc grpc.ClientConnInterface) PricingClient

type PricingServer

type PricingServer interface {
	// Test endpoint only.
	GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
	// EC2 service pricing endpoint
	GetEC2Info(context.Context, *GetEC2InfoRequest) (*GetEC2InfoResponse, error)
	// contains filtered or unexported methods
}

PricingServer is the server API for Pricing service. All implementations must embed UnimplementedPricingServer for forward compatibility

Pricing service definition.

type ServiceDetails added in v0.71.7

type ServiceDetails struct {
	Compute *ComputeDetails `protobuf:"bytes,1,opt,name=compute,proto3" json:"compute,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceDetails) Descriptor deprecated added in v0.71.7

func (*ServiceDetails) Descriptor() ([]byte, []int)

Deprecated: Use ServiceDetails.ProtoReflect.Descriptor instead.

func (*ServiceDetails) GetCompute added in v0.71.7

func (x *ServiceDetails) GetCompute() *ComputeDetails

func (*ServiceDetails) ProtoMessage added in v0.71.7

func (*ServiceDetails) ProtoMessage()

func (*ServiceDetails) ProtoReflect added in v0.71.7

func (x *ServiceDetails) ProtoReflect() protoreflect.Message

func (*ServiceDetails) Reset added in v0.71.7

func (x *ServiceDetails) Reset()

func (*ServiceDetails) String added in v0.71.7

func (x *ServiceDetails) String() string

type UnimplementedPricingServer

type UnimplementedPricingServer struct {
}

UnimplementedPricingServer must be embedded to have forward compatible implementations.

func (UnimplementedPricingServer) GetEC2Info added in v0.71.7

func (UnimplementedPricingServer) GetInfo

type UnitCost added in v0.71.7

type UnitCost struct {
	Unit     string  `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"`
	UnitCost float64 `protobuf:"fixed64,2,opt,name=unit_cost,json=unitCost,proto3" json:"unit_cost,omitempty"`
	Currency string  `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"`
	// contains filtered or unexported fields
}

func (*UnitCost) Descriptor deprecated added in v0.71.7

func (*UnitCost) Descriptor() ([]byte, []int)

Deprecated: Use UnitCost.ProtoReflect.Descriptor instead.

func (*UnitCost) GetCurrency added in v0.71.7

func (x *UnitCost) GetCurrency() string

func (*UnitCost) GetUnit added in v0.71.7

func (x *UnitCost) GetUnit() string

func (*UnitCost) GetUnitCost added in v0.71.7

func (x *UnitCost) GetUnitCost() float64

func (*UnitCost) ProtoMessage added in v0.71.7

func (*UnitCost) ProtoMessage()

func (*UnitCost) ProtoReflect added in v0.71.7

func (x *UnitCost) ProtoReflect() protoreflect.Message

func (*UnitCost) Reset added in v0.71.7

func (x *UnitCost) Reset()

func (*UnitCost) String added in v0.71.7

func (x *UnitCost) String() string

type UnsafePricingServer

type UnsafePricingServer interface {
	// contains filtered or unexported methods
}

UnsafePricingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PricingServer will result in compilation errors.

Jump to

Keyboard shortcuts

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