golang

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_kafkapixy_proto protoreflect.FileDescriptor
View Source
var KafkaPixy_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "KafkaPixy",
	HandlerType: (*KafkaPixyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Produce",
			Handler:    _KafkaPixy_Produce_Handler,
		},
		{
			MethodName: "ConsumeNAck",
			Handler:    _KafkaPixy_ConsumeNAck_Handler,
		},
		{
			MethodName: "Ack",
			Handler:    _KafkaPixy_Ack_Handler,
		},
		{
			MethodName: "GetOffsets",
			Handler:    _KafkaPixy_GetOffsets_Handler,
		},
		{
			MethodName: "SetOffsets",
			Handler:    _KafkaPixy_SetOffsets_Handler,
		},
		{
			MethodName: "ListTopics",
			Handler:    _KafkaPixy_ListTopics_Handler,
		},
		{
			MethodName: "ListConsumers",
			Handler:    _KafkaPixy_ListConsumers_Handler,
		},
		{
			MethodName: "GetTopicMetadata",
			Handler:    _KafkaPixy_GetTopicMetadata_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "kafkapixy.proto",
}

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

Functions

func RegisterKafkaPixyServer

func RegisterKafkaPixyServer(s grpc.ServiceRegistrar, srv KafkaPixyServer)

Types

type AckRq added in v0.13.0

type AckRq struct {

	// Name of a Kafka cluster to operate on.
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Name of a consumer group.
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	// Partition that the acknowledged message was consumed from.
	Partition int32 `protobuf:"varint,4,opt,name=partition,proto3" json:"partition,omitempty"`
	// Offset in the partition that the acknowledged message was consumed from.
	Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*AckRq) Descriptor deprecated added in v0.13.0

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

Deprecated: Use AckRq.ProtoReflect.Descriptor instead.

func (*AckRq) GetCluster added in v0.13.0

func (x *AckRq) GetCluster() string

func (*AckRq) GetGroup added in v0.13.0

func (x *AckRq) GetGroup() string

func (*AckRq) GetOffset added in v0.13.0

func (x *AckRq) GetOffset() int64

func (*AckRq) GetPartition added in v0.13.0

func (x *AckRq) GetPartition() int32

func (*AckRq) GetTopic added in v0.13.0

func (x *AckRq) GetTopic() string

func (*AckRq) ProtoMessage added in v0.13.0

func (*AckRq) ProtoMessage()

func (*AckRq) ProtoReflect added in v0.18.0

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

func (*AckRq) Reset added in v0.13.0

func (x *AckRq) Reset()

func (*AckRq) String added in v0.13.0

func (x *AckRq) String() string

type AckRs added in v0.13.0

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

func (*AckRs) Descriptor deprecated added in v0.13.0

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

Deprecated: Use AckRs.ProtoReflect.Descriptor instead.

func (*AckRs) ProtoMessage added in v0.13.0

func (*AckRs) ProtoMessage()

func (*AckRs) ProtoReflect added in v0.18.0

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

func (*AckRs) Reset added in v0.13.0

func (x *AckRs) Reset()

func (*AckRs) String added in v0.13.0

func (x *AckRs) String() string

type ConsNAckRq added in v0.13.0

type ConsNAckRq struct {

	// Name of a Kafka cluster to operate on.
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Name of a consumer group.
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	// If true then no message is acknowledged by the request.
	NoAck bool `protobuf:"varint,4,opt,name=no_ack,json=noAck,proto3" json:"no_ack,omitempty"`
	// If true and no_ack is false then the message returned by the requests is
	// automatically acknowledged by Kafka-Pixy before the request completes.
	AutoAck bool `protobuf:"varint,5,opt,name=auto_ack,json=autoAck,proto3" json:"auto_ack,omitempty"`
	// If both no_ack and auto_ack are false (by default), then ack_partition
	// and ack_offset along with cluster-group-topic determine the message that
	// should be acknowledged by the request.
	AckPartition int32 `protobuf:"varint,6,opt,name=ack_partition,json=ackPartition,proto3" json:"ack_partition,omitempty"`
	AckOffset    int64 `protobuf:"varint,7,opt,name=ack_offset,json=ackOffset,proto3" json:"ack_offset,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsNAckRq) Descriptor deprecated added in v0.13.0

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

Deprecated: Use ConsNAckRq.ProtoReflect.Descriptor instead.

func (*ConsNAckRq) GetAckOffset added in v0.13.0

func (x *ConsNAckRq) GetAckOffset() int64

func (*ConsNAckRq) GetAckPartition added in v0.13.0

func (x *ConsNAckRq) GetAckPartition() int32

func (*ConsNAckRq) GetAutoAck added in v0.13.0

func (x *ConsNAckRq) GetAutoAck() bool

func (*ConsNAckRq) GetCluster added in v0.13.0

func (x *ConsNAckRq) GetCluster() string

func (*ConsNAckRq) GetGroup added in v0.13.0

func (x *ConsNAckRq) GetGroup() string

func (*ConsNAckRq) GetNoAck added in v0.13.0

func (x *ConsNAckRq) GetNoAck() bool

func (*ConsNAckRq) GetTopic added in v0.13.0

func (x *ConsNAckRq) GetTopic() string

func (*ConsNAckRq) ProtoMessage added in v0.13.0

func (*ConsNAckRq) ProtoMessage()

func (*ConsNAckRq) ProtoReflect added in v0.18.0

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

func (*ConsNAckRq) Reset added in v0.13.0

func (x *ConsNAckRq) Reset()

func (*ConsNAckRq) String added in v0.13.0

func (x *ConsNAckRq) String() string

type ConsRs added in v0.13.0

type ConsRs struct {

	// Partition the message was read from.
	Partition int32 `protobuf:"varint,1,opt,name=partition,proto3" json:"partition,omitempty"`
	// Offset of the read message in the partition.
	Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// Key that was used to produce the message, unless key_undefined is true,
	// then it is undefined.
	KeyValue []byte `protobuf:"bytes,3,opt,name=key_value,json=keyValue,proto3" json:"key_value,omitempty"`
	// If true then the message was produced to a random partition.
	KeyUndefined bool `protobuf:"varint,4,opt,name=key_undefined,json=keyUndefined,proto3" json:"key_undefined,omitempty"`
	// Message body
	Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
	// Headers associated with the message
	Headers []*RecordHeader `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsRs) Descriptor deprecated added in v0.13.0

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

Deprecated: Use ConsRs.ProtoReflect.Descriptor instead.

func (*ConsRs) GetHeaders added in v0.16.0

func (x *ConsRs) GetHeaders() []*RecordHeader

func (*ConsRs) GetKeyUndefined added in v0.13.0

func (x *ConsRs) GetKeyUndefined() bool

func (*ConsRs) GetKeyValue added in v0.13.0

func (x *ConsRs) GetKeyValue() []byte

func (*ConsRs) GetMessage added in v0.13.0

func (x *ConsRs) GetMessage() []byte

func (*ConsRs) GetOffset added in v0.13.0

func (x *ConsRs) GetOffset() int64

func (*ConsRs) GetPartition added in v0.13.0

func (x *ConsRs) GetPartition() int32

func (*ConsRs) ProtoMessage added in v0.13.0

func (*ConsRs) ProtoMessage()

func (*ConsRs) ProtoReflect added in v0.18.0

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

func (*ConsRs) Reset added in v0.13.0

func (x *ConsRs) Reset()

func (*ConsRs) String added in v0.13.0

func (x *ConsRs) String() string

type ConsumerGroups added in v0.15.0

type ConsumerGroups struct {
	Consumers map[string]*ConsumerPartitions `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ConsumerGroups) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ConsumerGroups.ProtoReflect.Descriptor instead.

func (*ConsumerGroups) GetConsumers added in v0.15.0

func (x *ConsumerGroups) GetConsumers() map[string]*ConsumerPartitions

func (*ConsumerGroups) ProtoMessage added in v0.15.0

func (*ConsumerGroups) ProtoMessage()

func (*ConsumerGroups) ProtoReflect added in v0.18.0

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

func (*ConsumerGroups) Reset added in v0.15.0

func (x *ConsumerGroups) Reset()

func (*ConsumerGroups) String added in v0.15.0

func (x *ConsumerGroups) String() string

type ConsumerPartitions added in v0.15.0

type ConsumerPartitions struct {
	Partitions []int32 `protobuf:"varint,1,rep,packed,name=partitions,proto3" json:"partitions,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumerPartitions) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ConsumerPartitions.ProtoReflect.Descriptor instead.

func (*ConsumerPartitions) GetPartitions added in v0.15.0

func (x *ConsumerPartitions) GetPartitions() []int32

func (*ConsumerPartitions) ProtoMessage added in v0.15.0

func (*ConsumerPartitions) ProtoMessage()

func (*ConsumerPartitions) ProtoReflect added in v0.18.0

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

func (*ConsumerPartitions) Reset added in v0.15.0

func (x *ConsumerPartitions) Reset()

func (*ConsumerPartitions) String added in v0.15.0

func (x *ConsumerPartitions) String() string

type GetOffsetsRq added in v0.14.0

type GetOffsetsRq struct {

	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Name of a consumer group.
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*GetOffsetsRq) Descriptor deprecated added in v0.14.0

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

Deprecated: Use GetOffsetsRq.ProtoReflect.Descriptor instead.

func (*GetOffsetsRq) GetCluster added in v0.14.0

func (x *GetOffsetsRq) GetCluster() string

func (*GetOffsetsRq) GetGroup added in v0.14.0

func (x *GetOffsetsRq) GetGroup() string

func (*GetOffsetsRq) GetTopic added in v0.14.0

func (x *GetOffsetsRq) GetTopic() string

func (*GetOffsetsRq) ProtoMessage added in v0.14.0

func (*GetOffsetsRq) ProtoMessage()

func (*GetOffsetsRq) ProtoReflect added in v0.18.0

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

func (*GetOffsetsRq) Reset added in v0.14.0

func (x *GetOffsetsRq) Reset()

func (*GetOffsetsRq) String added in v0.14.0

func (x *GetOffsetsRq) String() string

type GetOffsetsRs added in v0.14.0

type GetOffsetsRs struct {
	Offsets []*PartitionOffset `protobuf:"bytes,1,rep,name=offsets,proto3" json:"offsets,omitempty"`
	// contains filtered or unexported fields
}

func (*GetOffsetsRs) Descriptor deprecated added in v0.14.0

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

Deprecated: Use GetOffsetsRs.ProtoReflect.Descriptor instead.

func (*GetOffsetsRs) GetOffsets added in v0.14.0

func (x *GetOffsetsRs) GetOffsets() []*PartitionOffset

func (*GetOffsetsRs) ProtoMessage added in v0.14.0

func (*GetOffsetsRs) ProtoMessage()

func (*GetOffsetsRs) ProtoReflect added in v0.18.0

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

func (*GetOffsetsRs) Reset added in v0.14.0

func (x *GetOffsetsRs) Reset()

func (*GetOffsetsRs) String added in v0.14.0

func (x *GetOffsetsRs) String() string

type GetTopicMetadataRq added in v0.15.0

type GetTopicMetadataRq struct {

	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Should include partition metadata
	WithPartitions bool `protobuf:"varint,3,opt,name=with_partitions,json=withPartitions,proto3" json:"with_partitions,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicMetadataRq) Descriptor deprecated added in v0.15.0

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

Deprecated: Use GetTopicMetadataRq.ProtoReflect.Descriptor instead.

func (*GetTopicMetadataRq) GetCluster added in v0.15.0

func (x *GetTopicMetadataRq) GetCluster() string

func (*GetTopicMetadataRq) GetTopic added in v0.15.0

func (x *GetTopicMetadataRq) GetTopic() string

func (*GetTopicMetadataRq) GetWithPartitions added in v0.15.0

func (x *GetTopicMetadataRq) GetWithPartitions() bool

func (*GetTopicMetadataRq) ProtoMessage added in v0.15.0

func (*GetTopicMetadataRq) ProtoMessage()

func (*GetTopicMetadataRq) ProtoReflect added in v0.18.0

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

func (*GetTopicMetadataRq) Reset added in v0.15.0

func (x *GetTopicMetadataRq) Reset()

func (*GetTopicMetadataRq) String added in v0.15.0

func (x *GetTopicMetadataRq) String() string

type GetTopicMetadataRs added in v0.15.0

type GetTopicMetadataRs struct {

	// Version of this metadata
	Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// Config values
	Config map[string]string `` /* 153-byte string literal not displayed */
	// Optional list of metadata for the partitions of this topic
	Partitions []*PartitionMetadata `protobuf:"bytes,3,rep,name=partitions,proto3" json:"partitions,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTopicMetadataRs) Descriptor deprecated added in v0.15.0

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

Deprecated: Use GetTopicMetadataRs.ProtoReflect.Descriptor instead.

func (*GetTopicMetadataRs) GetConfig added in v0.15.0

func (x *GetTopicMetadataRs) GetConfig() map[string]string

func (*GetTopicMetadataRs) GetPartitions added in v0.15.0

func (x *GetTopicMetadataRs) GetPartitions() []*PartitionMetadata

func (*GetTopicMetadataRs) GetVersion added in v0.15.0

func (x *GetTopicMetadataRs) GetVersion() int32

func (*GetTopicMetadataRs) ProtoMessage added in v0.15.0

func (*GetTopicMetadataRs) ProtoMessage()

func (*GetTopicMetadataRs) ProtoReflect added in v0.18.0

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

func (*GetTopicMetadataRs) Reset added in v0.15.0

func (x *GetTopicMetadataRs) Reset()

func (*GetTopicMetadataRs) String added in v0.15.0

func (x *GetTopicMetadataRs) String() string

type KafkaPixyClient

type KafkaPixyClient interface {
	// Produce writes a message to a Kafka topic.
	//
	// If ProdReq.async_mode is false (default value) then the request will
	// block until the message is written to all ISR. In this case the respose
	// will contain the partition and offset of the message. This has to be
	// used to achive at-least-once deliverability guarantee.
	// If ProdReq.async_mode is true, then Kafka-Pixy returns immediately after
	// it gets the request and performs write on the backgroud. This mode
	// ensures highest throughput but messages can be lost, e.g. if the host
	// crashes before Kafka-Pixy has a chance to complete write.
	//
	// Hash of ProdReq.key_value is used to determine a partition that the
	// message should be written to. If you want a message to go to an random
	// partition then set ProdReq.key_undefined to true. Note that if both
	// ProdReq.key_undefined and ProdReq.key_value are left default, which is
	// empty string and false respectively, then messages will be consitently
	// written to a partiticular partition selected by the hash of an empty
	// string.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	Produce(ctx context.Context, in *ProdRq, opts ...grpc.CallOption) (*ProdRs, error)
	// Consume reads a message from a topic and optionally acknowledges a
	// message previously consumed from the same topic.
	//
	// Requests are performed in long polling fation, that is if all available
	// messages have been consumed then the request will block for
	// config.yaml:proxies.<cluster>.consumer.long_polling_timeout waiting for
	// new messages. If no new messages is produced while waiting the request
	// will return gRPC error with 408 status code.
	//
	// To consume the first message set ConsNAckReq.no_ack to true, since there
	// is no message to acknowledge at this point. In the second and all
	// subsequent calls of the method set ConsNAckReq.ack_partition and
	// ConsNAckReq.ack_offset to the respective values of ConsRes returned by
	// the previous method call. To acknowledge the last consumed message before
	// teminating the application call Ack method.
	//
	// If a message is not acknowledged within
	// config.yaml:proxies.<cluster>.consumer.ack_timeout the it will be returned
	// by Kafka-Pixy in ConsRes again possibly to another application.
	//
	// If at-least-once delivery guarantee and retries are not desirable, then
	// you can set ConsNAckReq.auto_ack to true and Kafka-Pixy will acknowledge
	// messages automatically before returning them in ConsRes.
	//
	// gRPC error codes:
	//  * Not Found (5): It just means that all message has been consumed and
	//    the long polling timeout has elaspsed. Just keep calling this method
	//    in a loop;
	//  * Resource Exhausted (8): too many consume requests. Either reduce the
	//    number of consuming threads or increase
	//    config.yaml:proxies.<cluster>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	ConsumeNAck(ctx context.Context, in *ConsNAckRq, opts ...grpc.CallOption) (*ConsRs, error)
	// Ack acknowledges a message earlier consumed from a topic.
	//
	// This method is provided solely to acknowledge the last consumed message
	// before the application terminates. In all other cases ConsumeNAck should
	// be used.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Ack(ctx context.Context, in *AckRq, opts ...grpc.CallOption) (*AckRs, error)
	// Fetches partition offsets for the specified topic and group
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	GetOffsets(ctx context.Context, in *GetOffsetsRq, opts ...grpc.CallOption) (*GetOffsetsRs, error)
	// Sets partition offsets for the specified topic and group.
	// NOTE: Although the request accepts the PartitionOffset object i
	// only 'Partition', 'Offset' and 'Metadata' are set by this method
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	SetOffsets(ctx context.Context, in *SetOffsetsRq, opts ...grpc.CallOption) (*SetOffsetsRs, error)
	// Lists all topics and metadata with optional metadata for the partitions of the topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	ListTopics(ctx context.Context, in *ListTopicRq, opts ...grpc.CallOption) (*ListTopicRs, error)
	// Lists all consumers of a topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	ListConsumers(ctx context.Context, in *ListConsumersRq, opts ...grpc.CallOption) (*ListConsumersRs, error)
	// Fetches topic metadata and optional metadata for the partitions of the topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	//  * NotFound (5): If the topic does not exist
	GetTopicMetadata(ctx context.Context, in *GetTopicMetadataRq, opts ...grpc.CallOption) (*GetTopicMetadataRs, error)
}

KafkaPixyClient is the client API for KafkaPixy 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.

func NewKafkaPixyClient

func NewKafkaPixyClient(cc grpc.ClientConnInterface) KafkaPixyClient

type KafkaPixyServer

type KafkaPixyServer interface {
	// Produce writes a message to a Kafka topic.
	//
	// If ProdReq.async_mode is false (default value) then the request will
	// block until the message is written to all ISR. In this case the respose
	// will contain the partition and offset of the message. This has to be
	// used to achive at-least-once deliverability guarantee.
	// If ProdReq.async_mode is true, then Kafka-Pixy returns immediately after
	// it gets the request and performs write on the backgroud. This mode
	// ensures highest throughput but messages can be lost, e.g. if the host
	// crashes before Kafka-Pixy has a chance to complete write.
	//
	// Hash of ProdReq.key_value is used to determine a partition that the
	// message should be written to. If you want a message to go to an random
	// partition then set ProdReq.key_undefined to true. Note that if both
	// ProdReq.key_undefined and ProdReq.key_value are left default, which is
	// empty string and false respectively, then messages will be consitently
	// written to a partiticular partition selected by the hash of an empty
	// string.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	Produce(context.Context, *ProdRq) (*ProdRs, error)
	// Consume reads a message from a topic and optionally acknowledges a
	// message previously consumed from the same topic.
	//
	// Requests are performed in long polling fation, that is if all available
	// messages have been consumed then the request will block for
	// config.yaml:proxies.<cluster>.consumer.long_polling_timeout waiting for
	// new messages. If no new messages is produced while waiting the request
	// will return gRPC error with 408 status code.
	//
	// To consume the first message set ConsNAckReq.no_ack to true, since there
	// is no message to acknowledge at this point. In the second and all
	// subsequent calls of the method set ConsNAckReq.ack_partition and
	// ConsNAckReq.ack_offset to the respective values of ConsRes returned by
	// the previous method call. To acknowledge the last consumed message before
	// teminating the application call Ack method.
	//
	// If a message is not acknowledged within
	// config.yaml:proxies.<cluster>.consumer.ack_timeout the it will be returned
	// by Kafka-Pixy in ConsRes again possibly to another application.
	//
	// If at-least-once delivery guarantee and retries are not desirable, then
	// you can set ConsNAckReq.auto_ack to true and Kafka-Pixy will acknowledge
	// messages automatically before returning them in ConsRes.
	//
	// gRPC error codes:
	//  * Not Found (5): It just means that all message has been consumed and
	//    the long polling timeout has elaspsed. Just keep calling this method
	//    in a loop;
	//  * Resource Exhausted (8): too many consume requests. Either reduce the
	//    number of consuming threads or increase
	//    config.yaml:proxies.<cluster>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	ConsumeNAck(context.Context, *ConsNAckRq) (*ConsRs, error)
	// Ack acknowledges a message earlier consumed from a topic.
	//
	// This method is provided solely to acknowledge the last consumed message
	// before the application terminates. In all other cases ConsumeNAck should
	// be used.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Ack(context.Context, *AckRq) (*AckRs, error)
	// Fetches partition offsets for the specified topic and group
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	GetOffsets(context.Context, *GetOffsetsRq) (*GetOffsetsRs, error)
	// Sets partition offsets for the specified topic and group.
	// NOTE: Although the request accepts the PartitionOffset object i
	// only 'Partition', 'Offset' and 'Metadata' are set by this method
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	SetOffsets(context.Context, *SetOffsetsRq) (*SetOffsetsRs, error)
	// Lists all topics and metadata with optional metadata for the partitions of the topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	ListTopics(context.Context, *ListTopicRq) (*ListTopicRs, error)
	// Lists all consumers of a topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	ListConsumers(context.Context, *ListConsumersRq) (*ListConsumersRs, error)
	// Fetches topic metadata and optional metadata for the partitions of the topic
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on request
	//  * NotFound (5): If the topic does not exist
	GetTopicMetadata(context.Context, *GetTopicMetadataRq) (*GetTopicMetadataRs, error)
	// contains filtered or unexported methods
}

KafkaPixyServer is the server API for KafkaPixy service. All implementations must embed UnimplementedKafkaPixyServer for forward compatibility

type ListConsumersRq added in v0.15.0

type ListConsumersRq struct {

	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// If non empty, return only the specified group in the result
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*ListConsumersRq) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ListConsumersRq.ProtoReflect.Descriptor instead.

func (*ListConsumersRq) GetCluster added in v0.15.0

func (x *ListConsumersRq) GetCluster() string

func (*ListConsumersRq) GetGroup added in v0.15.0

func (x *ListConsumersRq) GetGroup() string

func (*ListConsumersRq) GetTopic added in v0.15.0

func (x *ListConsumersRq) GetTopic() string

func (*ListConsumersRq) ProtoMessage added in v0.15.0

func (*ListConsumersRq) ProtoMessage()

func (*ListConsumersRq) ProtoReflect added in v0.18.0

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

func (*ListConsumersRq) Reset added in v0.15.0

func (x *ListConsumersRq) Reset()

func (*ListConsumersRq) String added in v0.15.0

func (x *ListConsumersRq) String() string

type ListConsumersRs added in v0.15.0

type ListConsumersRs struct {
	Groups map[string]*ConsumerGroups `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ListConsumersRs) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ListConsumersRs.ProtoReflect.Descriptor instead.

func (*ListConsumersRs) GetGroups added in v0.15.0

func (x *ListConsumersRs) GetGroups() map[string]*ConsumerGroups

func (*ListConsumersRs) ProtoMessage added in v0.15.0

func (*ListConsumersRs) ProtoMessage()

func (*ListConsumersRs) ProtoReflect added in v0.18.0

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

func (*ListConsumersRs) Reset added in v0.15.0

func (x *ListConsumersRs) Reset()

func (*ListConsumersRs) String added in v0.15.0

func (x *ListConsumersRs) String() string

type ListTopicRq added in v0.15.0

type ListTopicRq struct {

	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Should include partition metadata
	WithPartitions bool `protobuf:"varint,2,opt,name=with_partitions,json=withPartitions,proto3" json:"with_partitions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTopicRq) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ListTopicRq.ProtoReflect.Descriptor instead.

func (*ListTopicRq) GetCluster added in v0.15.0

func (x *ListTopicRq) GetCluster() string

func (*ListTopicRq) GetWithPartitions added in v0.15.0

func (x *ListTopicRq) GetWithPartitions() bool

func (*ListTopicRq) ProtoMessage added in v0.15.0

func (*ListTopicRq) ProtoMessage()

func (*ListTopicRq) ProtoReflect added in v0.18.0

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

func (*ListTopicRq) Reset added in v0.15.0

func (x *ListTopicRq) Reset()

func (*ListTopicRq) String added in v0.15.0

func (x *ListTopicRq) String() string

type ListTopicRs added in v0.15.0

type ListTopicRs struct {
	Topics map[string]*GetTopicMetadataRs `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ListTopicRs) Descriptor deprecated added in v0.15.0

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

Deprecated: Use ListTopicRs.ProtoReflect.Descriptor instead.

func (*ListTopicRs) GetTopics added in v0.15.0

func (x *ListTopicRs) GetTopics() map[string]*GetTopicMetadataRs

func (*ListTopicRs) ProtoMessage added in v0.15.0

func (*ListTopicRs) ProtoMessage()

func (*ListTopicRs) ProtoReflect added in v0.18.0

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

func (*ListTopicRs) Reset added in v0.15.0

func (x *ListTopicRs) Reset()

func (*ListTopicRs) String added in v0.15.0

func (x *ListTopicRs) String() string

type PartitionMetadata added in v0.15.0

type PartitionMetadata struct {

	// The Partition this structure describes
	Partition int32 `protobuf:"varint,1,opt,name=partition,proto3" json:"partition,omitempty"`
	// The node id for the kafka broker currently acting as leader for this partition.
	// If no leader exists because we are in the middle of a leader election this id will be -1.
	Leader int32 `protobuf:"varint,2,opt,name=leader,proto3" json:"leader,omitempty"`
	// The set of alive nodes that currently acts as slaves for the leader for this partition.
	Replicas []int32 `protobuf:"varint,3,rep,packed,name=replicas,proto3" json:"replicas,omitempty"`
	// The set subset of the replicas that are "caught up" to the leader
	Isr []int32 `protobuf:"varint,4,rep,packed,name=isr,proto3" json:"isr,omitempty"`
	// contains filtered or unexported fields
}

Partition metadata as retrieved from kafka

func (*PartitionMetadata) Descriptor deprecated added in v0.15.0

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

Deprecated: Use PartitionMetadata.ProtoReflect.Descriptor instead.

func (*PartitionMetadata) GetIsr added in v0.15.0

func (x *PartitionMetadata) GetIsr() []int32

func (*PartitionMetadata) GetLeader added in v0.15.0

func (x *PartitionMetadata) GetLeader() int32

func (*PartitionMetadata) GetPartition added in v0.15.0

func (x *PartitionMetadata) GetPartition() int32

func (*PartitionMetadata) GetReplicas added in v0.15.0

func (x *PartitionMetadata) GetReplicas() []int32

func (*PartitionMetadata) ProtoMessage added in v0.15.0

func (*PartitionMetadata) ProtoMessage()

func (*PartitionMetadata) ProtoReflect added in v0.18.0

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

func (*PartitionMetadata) Reset added in v0.15.0

func (x *PartitionMetadata) Reset()

func (*PartitionMetadata) String added in v0.15.0

func (x *PartitionMetadata) String() string

type PartitionOffset added in v0.14.0

type PartitionOffset struct {

	// The Partition this structure describes
	Partition int32 `protobuf:"varint,1,opt,name=partition,proto3" json:"partition,omitempty"`
	// The beginning offset
	Begin int64 `protobuf:"varint,2,opt,name=begin,proto3" json:"begin,omitempty"`
	// The ending offset
	End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	// The number of messages in the partition
	Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
	// Offset in the partition
	Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`
	// The number of un-consumed messages in the partition
	Lag int64 `protobuf:"varint,6,opt,name=lag,proto3" json:"lag,omitempty"`
	// Metatdata associated with the partition
	Metadata string `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// human readable representation of sparsely committed ranges
	SparseAcks string `protobuf:"bytes,8,opt,name=sparse_acks,json=sparseAcks,proto3" json:"sparse_acks,omitempty"`
	// contains filtered or unexported fields
}

func (*PartitionOffset) Descriptor deprecated added in v0.14.0

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

Deprecated: Use PartitionOffset.ProtoReflect.Descriptor instead.

func (*PartitionOffset) GetBegin added in v0.14.0

func (x *PartitionOffset) GetBegin() int64

func (*PartitionOffset) GetCount added in v0.14.0

func (x *PartitionOffset) GetCount() int64

func (*PartitionOffset) GetEnd added in v0.14.0

func (x *PartitionOffset) GetEnd() int64

func (*PartitionOffset) GetLag added in v0.14.0

func (x *PartitionOffset) GetLag() int64

func (*PartitionOffset) GetMetadata added in v0.14.0

func (x *PartitionOffset) GetMetadata() string

func (*PartitionOffset) GetOffset added in v0.14.0

func (x *PartitionOffset) GetOffset() int64

func (*PartitionOffset) GetPartition added in v0.14.0

func (x *PartitionOffset) GetPartition() int32

func (*PartitionOffset) GetSparseAcks added in v0.14.0

func (x *PartitionOffset) GetSparseAcks() string

func (*PartitionOffset) ProtoMessage added in v0.14.0

func (*PartitionOffset) ProtoMessage()

func (*PartitionOffset) ProtoReflect added in v0.18.0

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

func (*PartitionOffset) Reset added in v0.14.0

func (x *PartitionOffset) Reset()

func (*PartitionOffset) String added in v0.14.0

func (x *PartitionOffset) String() string

type ProdRq added in v0.13.0

type ProdRq struct {

	// Name of a Kafka cluster to operate on.
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Hash of the key is used to determine the partition to produce to. By
	// default it is an empty array which is a valid key, unless key_undefined
	// is set to true and then a random partition is selected.
	KeyValue []byte `protobuf:"bytes,3,opt,name=key_value,json=keyValue,proto3" json:"key_value,omitempty"`
	// If true then the message is written to a random partition, otherwise
	// hash of key_value is used to determine the partition.
	KeyUndefined bool `protobuf:"varint,4,opt,name=key_undefined,json=keyUndefined,proto3" json:"key_undefined,omitempty"`
	// Message body.
	Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
	// If true then the method returns immediately after Kafka-Pixy gets the
	// produce request, and the message is written to Kafka asynchronously.
	// In that case partition and offset returned in response should be ignored.
	// If false, then a response is returned in accordance with the
	// producer.required_acks parameter, that can be one of:
	//  * no_response:    the response is returned as soon as a produce request
	//                    is delivered to a partition leader Kafka broker.
	//  * wait_for_local: the response is returned as soon as data is written
	//                    to the disk by a partition leader Kafka broker.
	//  * wait_for_all:   the response is returned after all in-sync replicas
	//                    have data committed to disk.
	AsyncMode bool `protobuf:"varint,6,opt,name=async_mode,json=asyncMode,proto3" json:"async_mode,omitempty"`
	// Headers to include with the published message
	Headers []*RecordHeader `protobuf:"bytes,7,rep,name=headers,proto3" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

func (*ProdRq) Descriptor deprecated added in v0.13.0

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

Deprecated: Use ProdRq.ProtoReflect.Descriptor instead.

func (*ProdRq) GetAsyncMode added in v0.13.0

func (x *ProdRq) GetAsyncMode() bool

func (*ProdRq) GetCluster added in v0.13.0

func (x *ProdRq) GetCluster() string

func (*ProdRq) GetHeaders added in v0.16.0

func (x *ProdRq) GetHeaders() []*RecordHeader

func (*ProdRq) GetKeyUndefined added in v0.13.0

func (x *ProdRq) GetKeyUndefined() bool

func (*ProdRq) GetKeyValue added in v0.13.0

func (x *ProdRq) GetKeyValue() []byte

func (*ProdRq) GetMessage added in v0.13.0

func (x *ProdRq) GetMessage() []byte

func (*ProdRq) GetTopic added in v0.13.0

func (x *ProdRq) GetTopic() string

func (*ProdRq) ProtoMessage added in v0.13.0

func (*ProdRq) ProtoMessage()

func (*ProdRq) ProtoReflect added in v0.18.0

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

func (*ProdRq) Reset added in v0.13.0

func (x *ProdRq) Reset()

func (*ProdRq) String added in v0.13.0

func (x *ProdRq) String() string

type ProdRs added in v0.13.0

type ProdRs struct {

	// Partition the message was written to. The value only makes sense if
	// ProdReq.async_mode was false.
	Partition int32 `protobuf:"varint,1,opt,name=partition,proto3" json:"partition,omitempty"`
	// Offset the message was written to. The value only makes sense if
	// ProdReq.async_mode was false.
	Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*ProdRs) Descriptor deprecated added in v0.13.0

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

Deprecated: Use ProdRs.ProtoReflect.Descriptor instead.

func (*ProdRs) GetOffset added in v0.13.0

func (x *ProdRs) GetOffset() int64

func (*ProdRs) GetPartition added in v0.13.0

func (x *ProdRs) GetPartition() int32

func (*ProdRs) ProtoMessage added in v0.13.0

func (*ProdRs) ProtoMessage()

func (*ProdRs) ProtoReflect added in v0.18.0

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

func (*ProdRs) Reset added in v0.13.0

func (x *ProdRs) Reset()

func (*ProdRs) String added in v0.13.0

func (x *ProdRs) String() string

type RecordHeader added in v0.16.0

type RecordHeader struct {

	// Key in the header key-value pair
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Value in the header key-value pair
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordHeader) Descriptor deprecated added in v0.16.0

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

Deprecated: Use RecordHeader.ProtoReflect.Descriptor instead.

func (*RecordHeader) GetKey added in v0.16.0

func (x *RecordHeader) GetKey() string

func (*RecordHeader) GetValue added in v0.16.0

func (x *RecordHeader) GetValue() []byte

func (*RecordHeader) ProtoMessage added in v0.16.0

func (*RecordHeader) ProtoMessage()

func (*RecordHeader) ProtoReflect added in v0.18.0

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

func (*RecordHeader) Reset added in v0.16.0

func (x *RecordHeader) Reset()

func (*RecordHeader) String added in v0.16.0

func (x *RecordHeader) String() string

type SetOffsetsRq added in v0.15.0

type SetOffsetsRq struct {

	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// Name of a topic
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// Name of a consumer group.
	Group   string             `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	Offsets []*PartitionOffset `protobuf:"bytes,4,rep,name=offsets,proto3" json:"offsets,omitempty"`
	// contains filtered or unexported fields
}

func (*SetOffsetsRq) Descriptor deprecated added in v0.15.0

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

Deprecated: Use SetOffsetsRq.ProtoReflect.Descriptor instead.

func (*SetOffsetsRq) GetCluster added in v0.15.0

func (x *SetOffsetsRq) GetCluster() string

func (*SetOffsetsRq) GetGroup added in v0.15.0

func (x *SetOffsetsRq) GetGroup() string

func (*SetOffsetsRq) GetOffsets added in v0.15.0

func (x *SetOffsetsRq) GetOffsets() []*PartitionOffset

func (*SetOffsetsRq) GetTopic added in v0.15.0

func (x *SetOffsetsRq) GetTopic() string

func (*SetOffsetsRq) ProtoMessage added in v0.15.0

func (*SetOffsetsRq) ProtoMessage()

func (*SetOffsetsRq) ProtoReflect added in v0.18.0

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

func (*SetOffsetsRq) Reset added in v0.15.0

func (x *SetOffsetsRq) Reset()

func (*SetOffsetsRq) String added in v0.15.0

func (x *SetOffsetsRq) String() string

type SetOffsetsRs added in v0.15.0

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

func (*SetOffsetsRs) Descriptor deprecated added in v0.15.0

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

Deprecated: Use SetOffsetsRs.ProtoReflect.Descriptor instead.

func (*SetOffsetsRs) ProtoMessage added in v0.15.0

func (*SetOffsetsRs) ProtoMessage()

func (*SetOffsetsRs) ProtoReflect added in v0.18.0

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

func (*SetOffsetsRs) Reset added in v0.15.0

func (x *SetOffsetsRs) Reset()

func (*SetOffsetsRs) String added in v0.15.0

func (x *SetOffsetsRs) String() string

type UnimplementedKafkaPixyServer added in v0.18.0

type UnimplementedKafkaPixyServer struct {
}

UnimplementedKafkaPixyServer must be embedded to have forward compatible implementations.

func (UnimplementedKafkaPixyServer) Ack added in v0.18.0

func (UnimplementedKafkaPixyServer) ConsumeNAck added in v0.18.0

func (UnimplementedKafkaPixyServer) GetOffsets added in v0.18.0

func (UnimplementedKafkaPixyServer) GetTopicMetadata added in v0.18.0

func (UnimplementedKafkaPixyServer) ListConsumers added in v0.18.0

func (UnimplementedKafkaPixyServer) ListTopics added in v0.18.0

func (UnimplementedKafkaPixyServer) Produce added in v0.18.0

func (UnimplementedKafkaPixyServer) SetOffsets added in v0.18.0

type UnsafeKafkaPixyServer added in v0.18.0

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

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

Jump to

Keyboard shortcuts

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