flow

package
v0.74.82 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package flow is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Flow_GetInfo_FullMethodName        = "/blueapi.flow.v1.Flow/GetInfo"
	Flow_CreateSettings_FullMethodName = "/blueapi.flow.v1.Flow/CreateSettings"
)

Variables

View Source
var File_flow_v1_flow_proto protoreflect.FileDescriptor
View Source
var Flow_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blueapi.flow.v1.Flow",
	HandlerType: (*FlowServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _Flow_GetInfo_Handler,
		},
		{
			MethodName: "CreateSettings",
			Handler:    _Flow_CreateSettings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "flow/v1/flow.proto",
}

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

Functions

func RegisterFlowHandler

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

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

func RegisterFlowHandlerClient

func RegisterFlowHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FlowClient) error

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

func RegisterFlowHandlerFromEndpoint

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

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

func RegisterFlowHandlerServer

func RegisterFlowHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FlowServer) error

RegisterFlowHandlerServer registers the http handlers for service Flow to "mux". UnaryRPC :call FlowServer 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 RegisterFlowHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterFlowServer

func RegisterFlowServer(s grpc.ServiceRegistrar, srv FlowServer)

Types

type ClientOptions added in v0.74.52

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type CreateSettingsRequest added in v0.74.67

type CreateSettingsRequest struct {

	// Required. The id of the payer.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Required. Account scope determines if the account is payer or linked account. Valid values are `payer` or `linked`.
	AccountScope string `protobuf:"bytes,2,opt,name=accountScope,proto3" json:"accountScope,omitempty"`
	// Required. Customization setting for SP. Valid values are `compute_sp` or `ec2_instance_sp`.
	Customization string `protobuf:"bytes,3,opt,name=customization,proto3" json:"customization,omitempty"`
	// Required. Term of the SP. Valid values are `one_year` or `three_years`.
	PlanTerm string `protobuf:"bytes,4,opt,name=planTerm,proto3" json:"planTerm,omitempty"`
	// Required. Payment option for the SP. Valid values are `all_upfront`, `partial_upfront`, or `no_upfront`.
	PaymentOption string `protobuf:"bytes,5,opt,name=paymentOption,proto3" json:"paymentOption,omitempty"`
	// Required. Lookback period for recommendation. Valid values are `seven_days`, `thirty_days`, or `sixty_days`.
	LookBackPeriod string `protobuf:"bytes,6,opt,name=lookBackPeriod,proto3" json:"lookBackPeriod,omitempty"`
	// Optional. If EC2 Instance SP is selected in Customization, request will include list of instance family
	InstanceFamily string `protobuf:"bytes,7,opt,name=instanceFamily,proto3" json:"instanceFamily,omitempty"`
	// Optional. Annual budget input for SP.
	AnnualBudget float64 `protobuf:"fixed64,8,opt,name=annualBudget,proto3" json:"annualBudget,omitempty"`
	// Optional. Purchase approval from the payer for the SP. Default value is `false`.
	Approval bool `protobuf:"varint,9,opt,name=approval,proto3" json:"approval,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Flow.CreateSettings rpc.

func (*CreateSettingsRequest) Descriptor deprecated added in v0.74.67

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

Deprecated: Use CreateSettingsRequest.ProtoReflect.Descriptor instead.

func (*CreateSettingsRequest) GetAccountScope added in v0.74.72

func (x *CreateSettingsRequest) GetAccountScope() string

func (*CreateSettingsRequest) GetAnnualBudget added in v0.74.67

func (x *CreateSettingsRequest) GetAnnualBudget() float64

func (*CreateSettingsRequest) GetApproval added in v0.74.67

func (x *CreateSettingsRequest) GetApproval() bool

func (*CreateSettingsRequest) GetCustomization added in v0.74.67

func (x *CreateSettingsRequest) GetCustomization() string

func (*CreateSettingsRequest) GetId added in v0.74.67

func (x *CreateSettingsRequest) GetId() string

func (*CreateSettingsRequest) GetInstanceFamily added in v0.74.67

func (x *CreateSettingsRequest) GetInstanceFamily() string

func (*CreateSettingsRequest) GetLookBackPeriod added in v0.74.67

func (x *CreateSettingsRequest) GetLookBackPeriod() string

func (*CreateSettingsRequest) GetPaymentOption added in v0.74.67

func (x *CreateSettingsRequest) GetPaymentOption() string

func (*CreateSettingsRequest) GetPlanTerm added in v0.74.67

func (x *CreateSettingsRequest) GetPlanTerm() string

func (*CreateSettingsRequest) ProtoMessage added in v0.74.67

func (*CreateSettingsRequest) ProtoMessage()

func (*CreateSettingsRequest) ProtoReflect added in v0.74.67

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

func (*CreateSettingsRequest) Reset added in v0.74.67

func (x *CreateSettingsRequest) Reset()

func (*CreateSettingsRequest) String added in v0.74.67

func (x *CreateSettingsRequest) String() string

type CreateSettingsResponse added in v0.74.67

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

Response message for the Flow.CreateSettings rpc.

func (*CreateSettingsResponse) Descriptor deprecated added in v0.74.67

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

Deprecated: Use CreateSettingsResponse.ProtoReflect.Descriptor instead.

func (*CreateSettingsResponse) GetResponse added in v0.74.67

func (x *CreateSettingsResponse) GetResponse() string

func (*CreateSettingsResponse) ProtoMessage added in v0.74.67

func (*CreateSettingsResponse) ProtoMessage()

func (*CreateSettingsResponse) ProtoReflect added in v0.74.67

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

func (*CreateSettingsResponse) Reset added in v0.74.67

func (x *CreateSettingsResponse) Reset()

func (*CreateSettingsResponse) String added in v0.74.67

func (x *CreateSettingsResponse) String() string

type FlowClient

type FlowClient interface {
	// For Testing Purposes Only.
	GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
	// Creates a new settings configuration for the user.
	CreateSettings(ctx context.Context, in *CreateSettingsRequest, opts ...grpc.CallOption) (*CreateSettingsResponse, error)
}

FlowClient is the client API for Flow 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.

Flow service definition.

func NewFlowClient

func NewFlowClient(cc grpc.ClientConnInterface) FlowClient

type FlowServer

type FlowServer interface {
	// For Testing Purposes Only.
	GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
	// Creates a new settings configuration for the user.
	CreateSettings(context.Context, *CreateSettingsRequest) (*CreateSettingsResponse, error)
	// contains filtered or unexported methods
}

FlowServer is the server API for Flow service. All implementations must embed UnimplementedFlowServer for forward compatibility

Flow service definition.

type GetInfoRequest

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

Request message for the Flow.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 Flow.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.74.52

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

func NewClient added in v0.74.52

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

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

func (*GrpcClient) Close added in v0.74.52

func (c *GrpcClient) Close()

type UnimplementedFlowServer

type UnimplementedFlowServer struct {
}

UnimplementedFlowServer must be embedded to have forward compatible implementations.

func (UnimplementedFlowServer) CreateSettings added in v0.74.67

func (UnimplementedFlowServer) GetInfo

type UnsafeFlowServer

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

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

Jump to

Keyboard shortcuts

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