kayakv1connect

package
v0.0.0-...-5aa5535 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// KayakServiceApplyProcedure is the fully-qualified name of the KayakService's Apply RPC.
	KayakServiceApplyProcedure = "/kayak.v1.KayakService/Apply"
	// KayakServicePutRecordsProcedure is the fully-qualified name of the KayakService's PutRecords RPC.
	KayakServicePutRecordsProcedure = "/kayak.v1.KayakService/PutRecords"
	// KayakServiceCommitRecordProcedure is the fully-qualified name of the KayakService's CommitRecord
	// RPC.
	KayakServiceCommitRecordProcedure = "/kayak.v1.KayakService/CommitRecord"
	// KayakServiceCreateTopicProcedure is the fully-qualified name of the KayakService's CreateTopic
	// RPC.
	KayakServiceCreateTopicProcedure = "/kayak.v1.KayakService/CreateTopic"
	// KayakServiceDeleteTopicProcedure is the fully-qualified name of the KayakService's DeleteTopic
	// RPC.
	KayakServiceDeleteTopicProcedure = "/kayak.v1.KayakService/DeleteTopic"
	// KayakServiceRegisterConsumerProcedure is the fully-qualified name of the KayakService's
	// RegisterConsumer RPC.
	KayakServiceRegisterConsumerProcedure = "/kayak.v1.KayakService/RegisterConsumer"
	// KayakServiceGetRecordsProcedure is the fully-qualified name of the KayakService's GetRecords RPC.
	KayakServiceGetRecordsProcedure = "/kayak.v1.KayakService/GetRecords"
	// KayakServiceFetchRecordProcedure is the fully-qualified name of the KayakService's FetchRecord
	// RPC.
	KayakServiceFetchRecordProcedure = "/kayak.v1.KayakService/FetchRecord"
	// KayakServiceStreamRecordsProcedure is the fully-qualified name of the KayakService's
	// StreamRecords RPC.
	KayakServiceStreamRecordsProcedure = "/kayak.v1.KayakService/StreamRecords"
	// KayakServiceListTopicsProcedure is the fully-qualified name of the KayakService's ListTopics RPC.
	KayakServiceListTopicsProcedure = "/kayak.v1.KayakService/ListTopics"
	// KayakServiceStatsProcedure is the fully-qualified name of the KayakService's Stats RPC.
	KayakServiceStatsProcedure = "/kayak.v1.KayakService/Stats"
	// KayakServiceGetNodeDetailsProcedure is the fully-qualified name of the KayakService's
	// GetNodeDetails RPC.
	KayakServiceGetNodeDetailsProcedure = "/kayak.v1.KayakService/GetNodeDetails"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// KayakServiceName is the fully-qualified name of the KayakService service.
	KayakServiceName = "kayak.v1.KayakService"
)

Variables

This section is empty.

Functions

func NewKayakServiceHandler

func NewKayakServiceHandler(svc KayakServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewKayakServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type KayakServiceClient

type KayakServiceClient interface {
	// Apply applies a command on the primary node.
	Apply(context.Context, *connect.Request[v1.Command]) (*connect.Response[v1.ApplyResponse], error)
	// PutRecords adds records to the stream
	PutRecords(context.Context, *connect.Request[v1.PutRecordsRequest]) (*connect.Response[emptypb.Empty], error)
	// Commits Consumer position for a topic/group
	CommitRecord(context.Context, *connect.Request[v1.CommitRecordRequest]) (*connect.Response[emptypb.Empty], error)
	// Creates new topic on server
	CreateTopic(context.Context, *connect.Request[v1.CreateTopicRequest]) (*connect.Response[emptypb.Empty], error)
	// Deletes Topic across server - permantly or via archive
	DeleteTopic(context.Context, *connect.Request[v1.DeleteTopicRequest]) (*connect.Response[emptypb.Empty], error)
	// rpc CreateConsumerGroup(CreateConsumerGroupRequest) returns (google.protobuf.Empty) {}
	RegisterConsumer(context.Context, *connect.Request[v1.RegisterConsumerRequest]) (*connect.Response[emptypb.Empty], error)
	// Read Procedures
	GetRecords(context.Context, *connect.Request[v1.GetRecordsRequest]) (*connect.Response[v1.GetRecordsResponse], error)
	FetchRecord(context.Context, *connect.Request[v1.FetchRecordRequest]) (*connect.Response[v1.FetchRecordsResponse], error)
	StreamRecords(context.Context, *connect.Request[v1.StreamRecordsRequest]) (*connect.ServerStreamForClient[v1.Record], error)
	ListTopics(context.Context, *connect.Request[v1.ListTopicsRequest]) (*connect.Response[v1.ListTopicsResponse], error)
	Stats(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.StatsResponse], error)
	GetNodeDetails(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetNodeDetailsResponse], error)
}

KayakServiceClient is a client for the kayak.v1.KayakService service.

func NewKayakServiceClient

func NewKayakServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) KayakServiceClient

NewKayakServiceClient constructs a client for the kayak.v1.KayakService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type KayakServiceHandler

type KayakServiceHandler interface {
	// Apply applies a command on the primary node.
	Apply(context.Context, *connect.Request[v1.Command]) (*connect.Response[v1.ApplyResponse], error)
	// PutRecords adds records to the stream
	PutRecords(context.Context, *connect.Request[v1.PutRecordsRequest]) (*connect.Response[emptypb.Empty], error)
	// Commits Consumer position for a topic/group
	CommitRecord(context.Context, *connect.Request[v1.CommitRecordRequest]) (*connect.Response[emptypb.Empty], error)
	// Creates new topic on server
	CreateTopic(context.Context, *connect.Request[v1.CreateTopicRequest]) (*connect.Response[emptypb.Empty], error)
	// Deletes Topic across server - permantly or via archive
	DeleteTopic(context.Context, *connect.Request[v1.DeleteTopicRequest]) (*connect.Response[emptypb.Empty], error)
	// rpc CreateConsumerGroup(CreateConsumerGroupRequest) returns (google.protobuf.Empty) {}
	RegisterConsumer(context.Context, *connect.Request[v1.RegisterConsumerRequest]) (*connect.Response[emptypb.Empty], error)
	// Read Procedures
	GetRecords(context.Context, *connect.Request[v1.GetRecordsRequest]) (*connect.Response[v1.GetRecordsResponse], error)
	FetchRecord(context.Context, *connect.Request[v1.FetchRecordRequest]) (*connect.Response[v1.FetchRecordsResponse], error)
	StreamRecords(context.Context, *connect.Request[v1.StreamRecordsRequest], *connect.ServerStream[v1.Record]) error
	ListTopics(context.Context, *connect.Request[v1.ListTopicsRequest]) (*connect.Response[v1.ListTopicsResponse], error)
	Stats(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.StatsResponse], error)
	GetNodeDetails(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetNodeDetailsResponse], error)
}

KayakServiceHandler is an implementation of the kayak.v1.KayakService service.

type UnimplementedKayakServiceHandler

type UnimplementedKayakServiceHandler struct{}

UnimplementedKayakServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedKayakServiceHandler) Apply

func (UnimplementedKayakServiceHandler) PutRecords

func (UnimplementedKayakServiceHandler) Stats

Jump to

Keyboard shortcuts

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