proto

package
v0.0.0-...-07ad8dd Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: BSD-2-Clause Imports: 11 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Earliest = time.Time{}
	Latest   = time.Date(9999, 12, 31, 23, 59, 59, 999999999, time.UTC)
)
View Source
var (
	ErrSizeMismatch = errors.New("proto: size mismatch in response")
	ErrCRCMismatch  = errors.New("proto: CRC mismatch in response")
)

Functions

func IsNotCoordinator

func IsNotCoordinator(err error) bool

func IsNotLeader

func IsNotLeader(err error) bool

Types

type Broker

type Broker struct {
	NodeID int32
	Host   string
	Port   int32
}

func (*Broker) Addr

func (b *Broker) Addr() string

func (*Broker) Marshal

func (t *Broker) Marshal(w *wipro.Writer)

func (*Broker) Unmarshal

func (t *Broker) Unmarshal(r *wipro.Reader)

type CRCMessage

type CRCMessage struct {
	CRC uint32
	Message
}

func (*CRCMessage) Marshal

func (t *CRCMessage) Marshal(w *wipro.Writer)

func (*CRCMessage) Unmarshal

func (t *CRCMessage) Unmarshal(r *wipro.Reader)

type DescribeGroupsRequest

type DescribeGroupsRequest []string

func (*DescribeGroupsRequest) APIKey

func (*DescribeGroupsRequest) APIKey() int16

func (*DescribeGroupsRequest) APIVersion

func (*DescribeGroupsRequest) APIVersion() int16

func (*DescribeGroupsRequest) Marshal

func (t *DescribeGroupsRequest) Marshal(w *wipro.Writer)

func (*DescribeGroupsRequest) Unmarshal

func (t *DescribeGroupsRequest) Unmarshal(r *wipro.Reader)

type DescribeGroupsResponse

type DescribeGroupsResponse []GroupDescription

func (*DescribeGroupsResponse) Marshal

func (t *DescribeGroupsResponse) Marshal(w *wipro.Writer)

func (*DescribeGroupsResponse) Unmarshal

func (t *DescribeGroupsResponse) Unmarshal(r *wipro.Reader)

type ErrorCode

type ErrorCode int16
const (
	NoError                             ErrorCode = 0
	ErrUnknown                          ErrorCode = -1
	ErrOffsetOutOfRange                 ErrorCode = 1
	ErrInvalidMessage                   ErrorCode = 2
	ErrUnknownTopicOrPartition          ErrorCode = 3
	ErrInvalidMessageSize               ErrorCode = 4
	ErrLeaderNotAvailable               ErrorCode = 5
	ErrNotLeaderForPartition            ErrorCode = 6
	ErrRequestTimedOut                  ErrorCode = 7
	ErrBrokerNotAvailable               ErrorCode = 8
	ErrReplicaNotAvailable              ErrorCode = 9
	ErrMessageSizeTooLarge              ErrorCode = 10
	ErrStaleControllerEpochCode         ErrorCode = 11
	ErrOffsetMetadataTooLargeCode       ErrorCode = 12
	ErrGroupLoadInProgressCode          ErrorCode = 14
	ErrGroupCoordinatorNotAvailableCode ErrorCode = 15
	ErrNotCoordinatorForGroupCode       ErrorCode = 16
	ErrInvalidTopicCode                 ErrorCode = 17
	ErrRecordListTooLargeCode           ErrorCode = 18
	ErrNotEnoughReplicasCode            ErrorCode = 19
	ErrNotEnoughReplicasAfterAppendCode ErrorCode = 20
	ErrInvalidRequiredAcksCode          ErrorCode = 21
	ErrIllegalGenerationCode            ErrorCode = 22
	ErrInconsistentGroupProtocolCode    ErrorCode = 23
	ErrInvalidGroupIdCode               ErrorCode = 24
	ErrUnknownMemberIdCode              ErrorCode = 25
	ErrInvalidSessionTimeoutCode        ErrorCode = 26
	ErrRebalanceInProgressCode          ErrorCode = 27
	ErrInvalidCommitOffsetSizeCode      ErrorCode = 28
	ErrTopicAuthorizationFailedCode     ErrorCode = 29
	ErrGroupAuthorizationFailedCode     ErrorCode = 30
	ErrClusterAuthorizationFailedCode   ErrorCode = 31
)

func (ErrorCode) Error

func (code ErrorCode) Error() string

func (ErrorCode) HasError

func (code ErrorCode) HasError() bool

func (*ErrorCode) Marshal

func (t *ErrorCode) Marshal(w *wipro.Writer)

func (*ErrorCode) Unmarshal

func (t *ErrorCode) Unmarshal(r *wipro.Reader)

type ErrorInPartition

type ErrorInPartition struct {
	Partition int32
	ErrorCode
}

func (*ErrorInPartition) Marshal

func (t *ErrorInPartition) Marshal(w *wipro.Writer)

func (*ErrorInPartition) Unmarshal

func (t *ErrorInPartition) Unmarshal(r *wipro.Reader)

type ErrorInTopic

type ErrorInTopic struct {
	TopicName         string
	ErrorInPartitions []ErrorInPartition
}

func (*ErrorInTopic) Marshal

func (t *ErrorInTopic) Marshal(w *wipro.Writer)

func (*ErrorInTopic) Unmarshal

func (t *ErrorInTopic) Unmarshal(r *wipro.Reader)

type FetchMessageSetInPartition

type FetchMessageSetInPartition struct {
	Partition int32
	ErrorCode
	HighwaterMarkOffset int64
	MessageSet
}

func (*FetchMessageSetInPartition) Marshal

func (t *FetchMessageSetInPartition) Marshal(w *wipro.Writer)

func (*FetchMessageSetInPartition) Unmarshal

func (t *FetchMessageSetInPartition) Unmarshal(r *wipro.Reader)

type FetchMessageSetInTopic

type FetchMessageSetInTopic struct {
	TopicName                   string
	FetchMessageSetInPartitions []FetchMessageSetInPartition
}

func (*FetchMessageSetInTopic) Marshal

func (t *FetchMessageSetInTopic) Marshal(w *wipro.Writer)

func (*FetchMessageSetInTopic) Unmarshal

func (t *FetchMessageSetInTopic) Unmarshal(r *wipro.Reader)

type FetchOffsetInPartition

type FetchOffsetInPartition struct {
	Partition   int32
	FetchOffset int64
	MaxBytes    int32
}

func (*FetchOffsetInPartition) Marshal

func (t *FetchOffsetInPartition) Marshal(w *wipro.Writer)

func (*FetchOffsetInPartition) Unmarshal

func (t *FetchOffsetInPartition) Unmarshal(r *wipro.Reader)

type FetchOffsetInTopic

type FetchOffsetInTopic struct {
	TopicName               string
	FetchOffsetInPartitions []FetchOffsetInPartition
}

func (*FetchOffsetInTopic) Marshal

func (t *FetchOffsetInTopic) Marshal(w *wipro.Writer)

func (*FetchOffsetInTopic) Unmarshal

func (t *FetchOffsetInTopic) Unmarshal(r *wipro.Reader)

type FetchRequest

type FetchRequest struct {
	ReplicaID           int32
	MaxWaitTime         int32
	MinBytes            int32
	FetchOffsetInTopics []FetchOffsetInTopic
}

func (*FetchRequest) APIKey

func (*FetchRequest) APIKey() int16

func (*FetchRequest) APIVersion

func (*FetchRequest) APIVersion() int16

func (*FetchRequest) Marshal

func (t *FetchRequest) Marshal(w *wipro.Writer)

func (*FetchRequest) Unmarshal

func (t *FetchRequest) Unmarshal(r *wipro.Reader)

type FetchResponse

type FetchResponse []FetchMessageSetInTopic

func (*FetchResponse) Marshal

func (t *FetchResponse) Marshal(w *wipro.Writer)

func (*FetchResponse) Unmarshal

func (t *FetchResponse) Unmarshal(r *wipro.Reader)

type GetTimeFunc

type GetTimeFunc func([]byte) (time.Time, error)

type Group

type Group struct {
	GroupID      string
	ProtocolType string
}

func (*Group) Marshal

func (t *Group) Marshal(w *wipro.Writer)

func (*Group) Unmarshal

func (t *Group) Unmarshal(r *wipro.Reader)

type GroupAssignment

type GroupAssignment struct {
	MemberID string
	MemberAssignment
}

func (*GroupAssignment) Marshal

func (t *GroupAssignment) Marshal(w *wipro.Writer)

func (*GroupAssignment) Unmarshal

func (t *GroupAssignment) Unmarshal(r *wipro.Reader)

type GroupAssignments

type GroupAssignments []GroupAssignment

func (*GroupAssignments) Marshal

func (t *GroupAssignments) Marshal(w *wipro.Writer)

func (*GroupAssignments) Unmarshal

func (t *GroupAssignments) Unmarshal(r *wipro.Reader)

type GroupCoordinator

type GroupCoordinator string

func (GroupCoordinator) Fetch

func (group GroupCoordinator) Fetch(b model.Broker) (*Broker, error)

type GroupCoordinatorRequest

type GroupCoordinatorRequest string

func (*GroupCoordinatorRequest) APIKey

func (*GroupCoordinatorRequest) APIKey() int16

func (*GroupCoordinatorRequest) APIVersion

func (*GroupCoordinatorRequest) APIVersion() int16

func (*GroupCoordinatorRequest) Marshal

func (t *GroupCoordinatorRequest) Marshal(w *wipro.Writer)

func (*GroupCoordinatorRequest) Unmarshal

func (t *GroupCoordinatorRequest) Unmarshal(r *wipro.Reader)

type GroupCoordinatorResponse

type GroupCoordinatorResponse struct {
	ErrorCode
	Broker
}

func (*GroupCoordinatorResponse) Marshal

func (t *GroupCoordinatorResponse) Marshal(w *wipro.Writer)

func (*GroupCoordinatorResponse) Unmarshal

func (t *GroupCoordinatorResponse) Unmarshal(r *wipro.Reader)

type GroupDescription

type GroupDescription struct {
	ErrorCode
	GroupID      string
	State        string
	ProtocolType string
	Protocol     string
	Members
}

func (*GroupDescription) Marshal

func (t *GroupDescription) Marshal(w *wipro.Writer)

func (*GroupDescription) Unmarshal

func (t *GroupDescription) Unmarshal(r *wipro.Reader)

type GroupProtocol

type GroupProtocol struct {
	ProtocolName string
	ProtocolMetadata
}

func (*GroupProtocol) Marshal

func (t *GroupProtocol) Marshal(w *wipro.Writer)

func (*GroupProtocol) Unmarshal

func (t *GroupProtocol) Unmarshal(r *wipro.Reader)

type GroupProtocols

type GroupProtocols []GroupProtocol

func (*GroupProtocols) Marshal

func (t *GroupProtocols) Marshal(w *wipro.Writer)

func (*GroupProtocols) Unmarshal

func (t *GroupProtocols) Unmarshal(r *wipro.Reader)

type Groups

type Groups []Group

func (*Groups) Marshal

func (t *Groups) Marshal(w *wipro.Writer)

func (*Groups) Unmarshal

func (t *Groups) Unmarshal(r *wipro.Reader)

type HeartbeatRequest

type HeartbeatRequest struct {
	GroupID      string
	GenerationID int32
	MemberID     string
}

func (*HeartbeatRequest) APIKey

func (*HeartbeatRequest) APIKey() int16

func (*HeartbeatRequest) APIVersion

func (*HeartbeatRequest) APIVersion() int16

func (*HeartbeatRequest) Marshal

func (t *HeartbeatRequest) Marshal(w *wipro.Writer)

func (*HeartbeatRequest) Unmarshal

func (t *HeartbeatRequest) Unmarshal(r *wipro.Reader)

type HeartbeatResponse

type HeartbeatResponse ErrorCode

func (*HeartbeatResponse) Marshal

func (t *HeartbeatResponse) Marshal(w *wipro.Writer)

func (*HeartbeatResponse) Unmarshal

func (t *HeartbeatResponse) Unmarshal(r *wipro.Reader)

type JoinGroupRequest

type JoinGroupRequest struct {
	GroupID        string
	SessionTimeout int32
	MemberID       string
	ProtocolType   string
	GroupProtocols
}

func (*JoinGroupRequest) APIKey

func (*JoinGroupRequest) APIKey() int16

func (*JoinGroupRequest) APIVersion

func (*JoinGroupRequest) APIVersion() int16

func (*JoinGroupRequest) Marshal

func (t *JoinGroupRequest) Marshal(w *wipro.Writer)

func (*JoinGroupRequest) Unmarshal

func (t *JoinGroupRequest) Unmarshal(r *wipro.Reader)

type JoinGroupResponse

type JoinGroupResponse struct {
	ErrorCode
	GenerationID      int32
	GroupProtocolName string
	LeaderID          string
	MemberID          string
	MemberWithMetas
}

func (*JoinGroupResponse) Marshal

func (t *JoinGroupResponse) Marshal(w *wipro.Writer)

func (*JoinGroupResponse) Unmarshal

func (t *JoinGroupResponse) Unmarshal(r *wipro.Reader)

type LeaveGroupRequest

type LeaveGroupRequest struct {
	GroupID  string
	MemberID string
}

func (*LeaveGroupRequest) APIKey

func (*LeaveGroupRequest) APIKey() int16

func (*LeaveGroupRequest) APIVersion

func (*LeaveGroupRequest) APIVersion() int16

func (*LeaveGroupRequest) Marshal

func (t *LeaveGroupRequest) Marshal(w *wipro.Writer)

func (*LeaveGroupRequest) Unmarshal

func (t *LeaveGroupRequest) Unmarshal(r *wipro.Reader)

type LeaveGroupResponse

type LeaveGroupResponse ErrorCode

func (*LeaveGroupResponse) Marshal

func (t *LeaveGroupResponse) Marshal(w *wipro.Writer)

func (*LeaveGroupResponse) Unmarshal

func (t *LeaveGroupResponse) Unmarshal(r *wipro.Reader)

type ListGroupsRequest

type ListGroupsRequest struct {
}

func (*ListGroupsRequest) APIKey

func (*ListGroupsRequest) APIKey() int16

func (*ListGroupsRequest) APIVersion

func (*ListGroupsRequest) APIVersion() int16

func (*ListGroupsRequest) Marshal

func (t *ListGroupsRequest) Marshal(w *wipro.Writer)

func (*ListGroupsRequest) Unmarshal

func (t *ListGroupsRequest) Unmarshal(r *wipro.Reader)

type ListGroupsResponse

type ListGroupsResponse struct {
	ErrorCode
	Groups
}

func (*ListGroupsResponse) Marshal

func (t *ListGroupsResponse) Marshal(w *wipro.Writer)

func (*ListGroupsResponse) Unmarshal

func (t *ListGroupsResponse) Unmarshal(r *wipro.Reader)

type Member

type Member struct {
	MemberID       string
	ClientID       string
	ClientHost     string
	MemberMetadata []byte
	MemberAssignment
}

func (*Member) Marshal

func (t *Member) Marshal(w *wipro.Writer)

func (*Member) Unmarshal

func (t *Member) Unmarshal(r *wipro.Reader)

type MemberAssignment

type MemberAssignment struct {
	Version int16
	PartitionAssignments
}

func (*MemberAssignment) Marshal

func (t *MemberAssignment) Marshal(w *wipro.Writer)

func (*MemberAssignment) Unmarshal

func (t *MemberAssignment) Unmarshal(r *wipro.Reader)

type MemberWithMeta

type MemberWithMeta struct {
	MemberID       string
	MemberMetadata []byte
}

func (*MemberWithMeta) Marshal

func (t *MemberWithMeta) Marshal(w *wipro.Writer)

func (*MemberWithMeta) Unmarshal

func (t *MemberWithMeta) Unmarshal(r *wipro.Reader)

type MemberWithMetas

type MemberWithMetas []MemberWithMeta

func (*MemberWithMetas) Marshal

func (t *MemberWithMetas) Marshal(w *wipro.Writer)

func (*MemberWithMetas) Unmarshal

func (t *MemberWithMetas) Unmarshal(r *wipro.Reader)

type Members

type Members []Member

func (*Members) Marshal

func (t *Members) Marshal(w *wipro.Writer)

func (*Members) Unmarshal

func (t *Members) Unmarshal(r *wipro.Reader)

type Message

type Message struct {
	MagicByte  int8
	Attributes int8
	Key        []byte
	Value      []byte
}

func (*Message) Compressed

func (m *Message) Compressed() bool

func (*Message) Decompress

func (m *Message) Decompress() (res MessageSet, _ error)

func (*Message) Marshal

func (t *Message) Marshal(w *wipro.Writer)

func (*Message) Unmarshal

func (t *Message) Unmarshal(r *wipro.Reader)

type MessageSet

type MessageSet []OffsetMessage

func (MessageSet) Flatten

func (ms MessageSet) Flatten() (res MessageSet, _ error)

func (*MessageSet) Marshal

func (t *MessageSet) Marshal(w *wipro.Writer)

func (*MessageSet) Unmarshal

func (t *MessageSet) Unmarshal(r *wipro.Reader)

type MessageSetInPartition

type MessageSetInPartition struct {
	Partition int32
	MessageSet
}

func (*MessageSetInPartition) Marshal

func (t *MessageSetInPartition) Marshal(w *wipro.Writer)

func (*MessageSetInPartition) Unmarshal

func (t *MessageSetInPartition) Unmarshal(r *wipro.Reader)

type MessageSetInTopic

type MessageSetInTopic struct {
	TopicName              string
	MessageSetInPartitions []MessageSetInPartition
}

func (*MessageSetInTopic) Marshal

func (t *MessageSetInTopic) Marshal(w *wipro.Writer)

func (*MessageSetInTopic) Unmarshal

func (t *MessageSetInTopic) Unmarshal(r *wipro.Reader)

type Messages

type Messages struct {
	Topic       string
	Partition   int32
	Offset      int64
	MinBytes    int
	MaxBytes    int
	MaxWaitTime time.Duration
}

func (*Messages) Consume

func (m *Messages) Consume(c model.Cluster) (MessageSet, error)

func (*Messages) DoConsume

func (fr *Messages) DoConsume(c model.Broker) (messages MessageSet, err error)

type Metadata

type Metadata string

func (Metadata) Fetch

type Offset

type Offset struct {
	Topic     string
	Partition int32
	Group     string
	Offset    int64
	Retention time.Duration
}

func (*Offset) Commit

func (o *Offset) Commit(c model.Cluster) error

func (*Offset) DoCommit

func (commit *Offset) DoCommit(b model.Broker) error

func (*Offset) DoFetch

func (o *Offset) DoFetch(b model.Broker) (int64, error)

func (*Offset) Fetch

func (o *Offset) Fetch(c model.Cluster) (int64, error)

type OffsetByTime

type OffsetByTime struct {
	Topic     string
	Partition int32
	Time      time.Time
}

func (*OffsetByTime) DoFetch

func (o *OffsetByTime) DoFetch(b model.Broker) (int64, error)

func (*OffsetByTime) Fetch

func (o *OffsetByTime) Fetch(c model.Cluster) (int64, error)

func (*OffsetByTime) Search

func (o *OffsetByTime) Search(cl model.Cluster, getTime GetTimeFunc) (int64, error)

type OffsetCommitInPartitionV0

type OffsetCommitInPartitionV0 struct {
	Partition int32
	Offset    int64
	Metadata  string
}

func (*OffsetCommitInPartitionV0) Marshal

func (t *OffsetCommitInPartitionV0) Marshal(w *wipro.Writer)

func (*OffsetCommitInPartitionV0) Unmarshal

func (t *OffsetCommitInPartitionV0) Unmarshal(r *wipro.Reader)

type OffsetCommitInPartitionV1

type OffsetCommitInPartitionV1 struct {
	Partition int32
	Offset    int64
	TimeStamp int64
	Metadata  string
}

func (*OffsetCommitInPartitionV1) Marshal

func (t *OffsetCommitInPartitionV1) Marshal(w *wipro.Writer)

func (*OffsetCommitInPartitionV1) Unmarshal

func (t *OffsetCommitInPartitionV1) Unmarshal(r *wipro.Reader)

type OffsetCommitInPartitionV2

type OffsetCommitInPartitionV2 struct {
	Partition int32
	Offset    int64
	Metadata  string
}

func (*OffsetCommitInPartitionV2) Marshal

func (t *OffsetCommitInPartitionV2) Marshal(w *wipro.Writer)

func (*OffsetCommitInPartitionV2) Unmarshal

func (t *OffsetCommitInPartitionV2) Unmarshal(r *wipro.Reader)

type OffsetCommitInTopicV0

type OffsetCommitInTopicV0 struct {
	TopicName                  string
	OffsetCommitInPartitionV0s []OffsetCommitInPartitionV0
}

func (*OffsetCommitInTopicV0) Marshal

func (t *OffsetCommitInTopicV0) Marshal(w *wipro.Writer)

func (*OffsetCommitInTopicV0) Unmarshal

func (t *OffsetCommitInTopicV0) Unmarshal(r *wipro.Reader)

type OffsetCommitInTopicV1

type OffsetCommitInTopicV1 struct {
	TopicName                  string
	OffsetCommitInPartitionV1s []OffsetCommitInPartitionV1
}

func (*OffsetCommitInTopicV1) Marshal

func (t *OffsetCommitInTopicV1) Marshal(w *wipro.Writer)

func (*OffsetCommitInTopicV1) Unmarshal

func (t *OffsetCommitInTopicV1) Unmarshal(r *wipro.Reader)

type OffsetCommitInTopicV2

type OffsetCommitInTopicV2 struct {
	TopicName                  string
	OffsetCommitInPartitionV2s []OffsetCommitInPartitionV2
}

func (*OffsetCommitInTopicV2) Marshal

func (t *OffsetCommitInTopicV2) Marshal(w *wipro.Writer)

func (*OffsetCommitInTopicV2) Unmarshal

func (t *OffsetCommitInTopicV2) Unmarshal(r *wipro.Reader)

type OffsetCommitRequestV0

type OffsetCommitRequestV0 struct {
	ConsumerGroupID        string
	OffsetCommitInTopicV0s []OffsetCommitInTopicV0
}

func (*OffsetCommitRequestV0) APIKey

func (*OffsetCommitRequestV0) APIKey() int16

func (*OffsetCommitRequestV0) APIVersion

func (*OffsetCommitRequestV0) APIVersion() int16

func (*OffsetCommitRequestV0) Marshal

func (t *OffsetCommitRequestV0) Marshal(w *wipro.Writer)

func (*OffsetCommitRequestV0) Unmarshal

func (t *OffsetCommitRequestV0) Unmarshal(r *wipro.Reader)

type OffsetCommitRequestV1

type OffsetCommitRequestV1 struct {
	ConsumerGroupID           string
	ConsumerGroupGenerationID int32
	ConsumerID                string
	OffsetCommitInTopicV1s    []OffsetCommitInTopicV1
}

func (*OffsetCommitRequestV1) APIKey

func (*OffsetCommitRequestV1) APIKey() int16

func (*OffsetCommitRequestV1) APIVersion

func (*OffsetCommitRequestV1) APIVersion() int16

func (*OffsetCommitRequestV1) Marshal

func (t *OffsetCommitRequestV1) Marshal(w *wipro.Writer)

func (*OffsetCommitRequestV1) Unmarshal

func (t *OffsetCommitRequestV1) Unmarshal(r *wipro.Reader)

type OffsetCommitRequestV2

type OffsetCommitRequestV2 struct {
	ConsumerGroup             string
	ConsumerGroupGenerationID int32
	ConsumerID                string
	RetentionTime             int64
	OffsetCommitInTopicV2s    []OffsetCommitInTopicV2
}

func (*OffsetCommitRequestV2) APIKey

func (*OffsetCommitRequestV2) APIKey() int16

func (*OffsetCommitRequestV2) APIVersion

func (*OffsetCommitRequestV2) APIVersion() int16

func (*OffsetCommitRequestV2) Marshal

func (t *OffsetCommitRequestV2) Marshal(w *wipro.Writer)

func (*OffsetCommitRequestV2) Unmarshal

func (t *OffsetCommitRequestV2) Unmarshal(r *wipro.Reader)

type OffsetCommitResponse

type OffsetCommitResponse []ErrorInTopic

func (*OffsetCommitResponse) Marshal

func (t *OffsetCommitResponse) Marshal(w *wipro.Writer)

func (*OffsetCommitResponse) Unmarshal

func (t *OffsetCommitResponse) Unmarshal(r *wipro.Reader)

type OffsetFetchRequestV0

type OffsetFetchRequestV0 struct {
	ConsumerGroup     string
	PartitionInTopics []PartitionInTopic
}

func (*OffsetFetchRequestV0) APIKey

func (*OffsetFetchRequestV0) APIKey() int16

func (*OffsetFetchRequestV0) APIVersion

func (*OffsetFetchRequestV0) APIVersion() int16

func (*OffsetFetchRequestV0) Marshal

func (t *OffsetFetchRequestV0) Marshal(w *wipro.Writer)

func (*OffsetFetchRequestV0) Unmarshal

func (t *OffsetFetchRequestV0) Unmarshal(r *wipro.Reader)

type OffsetFetchRequestV1

type OffsetFetchRequestV1 struct {
	ConsumerGroup     string
	PartitionInTopics []PartitionInTopic
}

func (*OffsetFetchRequestV1) APIKey

func (*OffsetFetchRequestV1) APIKey() int16

func (*OffsetFetchRequestV1) APIVersion

func (*OffsetFetchRequestV1) APIVersion() int16

func (*OffsetFetchRequestV1) Marshal

func (t *OffsetFetchRequestV1) Marshal(w *wipro.Writer)

func (*OffsetFetchRequestV1) Unmarshal

func (t *OffsetFetchRequestV1) Unmarshal(r *wipro.Reader)

type OffsetFetchResponse

type OffsetFetchResponse []OffsetMetadataInTopic

func (*OffsetFetchResponse) Marshal

func (t *OffsetFetchResponse) Marshal(w *wipro.Writer)

func (*OffsetFetchResponse) Unmarshal

func (t *OffsetFetchResponse) Unmarshal(r *wipro.Reader)

type OffsetInPartition

type OffsetInPartition struct {
	Partition int32
	ErrorCode
	Offset int64
}

func (*OffsetInPartition) Marshal

func (t *OffsetInPartition) Marshal(w *wipro.Writer)

func (*OffsetInPartition) Unmarshal

func (t *OffsetInPartition) Unmarshal(r *wipro.Reader)

type OffsetInTopic

type OffsetInTopic struct {
	TopicName          string
	OffsetInPartitions []OffsetInPartition
}

func (*OffsetInTopic) Marshal

func (t *OffsetInTopic) Marshal(w *wipro.Writer)

func (*OffsetInTopic) Unmarshal

func (t *OffsetInTopic) Unmarshal(r *wipro.Reader)

type OffsetMessage

type OffsetMessage struct {
	Offset int64
	SizedMessage
}

func (OffsetMessage) Flatten

func (m OffsetMessage) Flatten() (res MessageSet, _ error)

func (*OffsetMessage) Marshal

func (t *OffsetMessage) Marshal(w *wipro.Writer)

func (*OffsetMessage) Unmarshal

func (t *OffsetMessage) Unmarshal(r *wipro.Reader)

type OffsetMetadataInPartition

type OffsetMetadataInPartition struct {
	Partition int32
	Offset    int64
	Metadata  string
	ErrorCode
}

func (*OffsetMetadataInPartition) Marshal

func (t *OffsetMetadataInPartition) Marshal(w *wipro.Writer)

func (*OffsetMetadataInPartition) Unmarshal

func (t *OffsetMetadataInPartition) Unmarshal(r *wipro.Reader)

type OffsetMetadataInTopic

type OffsetMetadataInTopic struct {
	TopicName                  string
	OffsetMetadataInPartitions []OffsetMetadataInPartition
}

func (*OffsetMetadataInTopic) Marshal

func (t *OffsetMetadataInTopic) Marshal(w *wipro.Writer)

func (*OffsetMetadataInTopic) Unmarshal

func (t *OffsetMetadataInTopic) Unmarshal(r *wipro.Reader)

type OffsetRequest

type OffsetRequest struct {
	ReplicaID    int32
	TimeInTopics []TimeInTopic
}

func (*OffsetRequest) APIKey

func (*OffsetRequest) APIKey() int16

func (*OffsetRequest) APIVersion

func (*OffsetRequest) APIVersion() int16

func (*OffsetRequest) Marshal

func (t *OffsetRequest) Marshal(w *wipro.Writer)

func (*OffsetRequest) Unmarshal

func (t *OffsetRequest) Unmarshal(r *wipro.Reader)

type OffsetResponse

type OffsetResponse []OffsetsInTopic

func (*OffsetResponse) Marshal

func (t *OffsetResponse) Marshal(w *wipro.Writer)

func (*OffsetResponse) Unmarshal

func (t *OffsetResponse) Unmarshal(r *wipro.Reader)

type OffsetsInPartition

type OffsetsInPartition struct {
	Partition int32
	ErrorCode
	Offsets []int64
}

func (*OffsetsInPartition) Marshal

func (t *OffsetsInPartition) Marshal(w *wipro.Writer)

func (*OffsetsInPartition) Unmarshal

func (t *OffsetsInPartition) Unmarshal(r *wipro.Reader)

type OffsetsInTopic

type OffsetsInTopic struct {
	TopicName           string
	OffsetsInPartitions []OffsetsInPartition
}

func (*OffsetsInTopic) Marshal

func (t *OffsetsInTopic) Marshal(w *wipro.Writer)

func (*OffsetsInTopic) Unmarshal

func (t *OffsetsInTopic) Unmarshal(r *wipro.Reader)

type PartitionAssignment

type PartitionAssignment struct {
	Topic      string
	Partitions []int32
}

func (*PartitionAssignment) Marshal

func (t *PartitionAssignment) Marshal(w *wipro.Writer)

func (*PartitionAssignment) Unmarshal

func (t *PartitionAssignment) Unmarshal(r *wipro.Reader)

type PartitionAssignments

type PartitionAssignments []PartitionAssignment

func (*PartitionAssignments) Marshal

func (t *PartitionAssignments) Marshal(w *wipro.Writer)

func (*PartitionAssignments) Unmarshal

func (t *PartitionAssignments) Unmarshal(r *wipro.Reader)

type PartitionInTopic

type PartitionInTopic struct {
	TopicName  string
	Partitions []int32
}

func (*PartitionInTopic) Marshal

func (t *PartitionInTopic) Marshal(w *wipro.Writer)

func (*PartitionInTopic) Unmarshal

func (t *PartitionInTopic) Unmarshal(r *wipro.Reader)

type PartitionMetadata

type PartitionMetadata struct {
	ErrorCode
	PartitionID int32
	Leader      int32
	Replicas    []int32
	ISR         []int32
}

func (*PartitionMetadata) Marshal

func (t *PartitionMetadata) Marshal(w *wipro.Writer)

func (*PartitionMetadata) Unmarshal

func (t *PartitionMetadata) Unmarshal(r *wipro.Reader)

type Payload

type Payload struct {
	Topic        string
	Partition    int32
	MessageSet   MessageSet
	RequiredAcks ProduceAckType
	AckTimeout   time.Duration
}

func (*Payload) DoProduce

func (p *Payload) DoProduce(b model.Broker) error

func (*Payload) Produce

func (p *Payload) Produce(c model.Cluster) error

type ProduceAckType

type ProduceAckType int16
const (
	AckNone  ProduceAckType = 0
	AckLocal ProduceAckType = 1
	AckAll   ProduceAckType = -1
)

type ProduceRequest

type ProduceRequest struct {
	RequiredAcks       int16
	Timeout            int32
	MessageSetInTopics []MessageSetInTopic
}

func (*ProduceRequest) APIKey

func (*ProduceRequest) APIKey() int16

func (*ProduceRequest) APIVersion

func (*ProduceRequest) APIVersion() int16

func (*ProduceRequest) Marshal

func (t *ProduceRequest) Marshal(w *wipro.Writer)

func (*ProduceRequest) Unmarshal

func (t *ProduceRequest) Unmarshal(r *wipro.Reader)

type ProduceResponse

type ProduceResponse []OffsetInTopic

func (*ProduceResponse) Marshal

func (t *ProduceResponse) Marshal(w *wipro.Writer)

func (*ProduceResponse) Unmarshal

func (t *ProduceResponse) Unmarshal(r *wipro.Reader)

type ProtocolMetadata

type ProtocolMetadata struct {
	Version int16
	Subscription
	UserData []byte
}

func (*ProtocolMetadata) Marshal

func (t *ProtocolMetadata) Marshal(w *wipro.Writer)

func (*ProtocolMetadata) Unmarshal

func (t *ProtocolMetadata) Unmarshal(r *wipro.Reader)

type Request

type Request struct {
	APIKey        int16
	APIVersion    int16
	CorrelationID int32
	ClientID      string
	RequestMessage
}

func (*Request) ID

func (r *Request) ID() int32

func (*Request) Marshal

func (t *Request) Marshal(w *wipro.Writer)

func (*Request) Send

func (req *Request) Send(conn io.Writer) error

func (*Request) SetID

func (r *Request) SetID(id int32)

func (*Request) Unmarshal

func (t *Request) Unmarshal(r *wipro.Reader)

type RequestMessage

type RequestMessage interface {
	wipro.M
	APIKey() int16
	APIVersion() int16
}

type RequestOrResponse

type RequestOrResponse struct {
	Size int32
	wipro.M
}

func (*RequestOrResponse) Marshal

func (t *RequestOrResponse) Marshal(w *wipro.Writer)

func (*RequestOrResponse) Unmarshal

func (t *RequestOrResponse) Unmarshal(r *wipro.Reader)

type Response

type Response struct {
	CorrelationID int32
	ResponseMessage
}

func (*Response) ID

func (r *Response) ID() int32

func (*Response) Marshal

func (t *Response) Marshal(w *wipro.Writer)

func (*Response) Receive

func (resp *Response) Receive(conn io.Reader) error

func (*Response) Unmarshal

func (t *Response) Unmarshal(r *wipro.Reader)

type ResponseMessage

type ResponseMessage wipro.M

type SizedMessage

type SizedMessage struct {
	Size int32
	CRCMessage
}

func (*SizedMessage) Marshal

func (t *SizedMessage) Marshal(w *wipro.Writer)

func (*SizedMessage) Unmarshal

func (t *SizedMessage) Unmarshal(r *wipro.Reader)

type Subscription

type Subscription []string

func (*Subscription) Marshal

func (t *Subscription) Marshal(w *wipro.Writer)

func (*Subscription) Unmarshal

func (t *Subscription) Unmarshal(r *wipro.Reader)

type SyncGroupRequest

type SyncGroupRequest struct {
	GroupID      string
	GenerationID int32
	MemberID     string
	GroupAssignments
}

func (*SyncGroupRequest) APIKey

func (*SyncGroupRequest) APIKey() int16

func (*SyncGroupRequest) APIVersion

func (*SyncGroupRequest) APIVersion() int16

func (*SyncGroupRequest) Marshal

func (t *SyncGroupRequest) Marshal(w *wipro.Writer)

func (*SyncGroupRequest) Unmarshal

func (t *SyncGroupRequest) Unmarshal(r *wipro.Reader)

type SyncGroupResponse

type SyncGroupResponse struct {
	ErrorCode
	MemberAssignment
}

func (*SyncGroupResponse) Marshal

func (t *SyncGroupResponse) Marshal(w *wipro.Writer)

func (*SyncGroupResponse) Unmarshal

func (t *SyncGroupResponse) Unmarshal(r *wipro.Reader)

type TimeInPartition

type TimeInPartition struct {
	Partition          int32
	Time               int64
	MaxNumberOfOffsets int32
}

func (*TimeInPartition) Marshal

func (t *TimeInPartition) Marshal(w *wipro.Writer)

func (*TimeInPartition) Unmarshal

func (t *TimeInPartition) Unmarshal(r *wipro.Reader)

type TimeInTopic

type TimeInTopic struct {
	TopicName        string
	TimeInPartitions []TimeInPartition
}

func (*TimeInTopic) Marshal

func (t *TimeInTopic) Marshal(w *wipro.Writer)

func (*TimeInTopic) Unmarshal

func (t *TimeInTopic) Unmarshal(r *wipro.Reader)

type TopicMetadata

type TopicMetadata struct {
	ErrorCode
	TopicName          string
	PartitionMetadatas []PartitionMetadata
}

func (*TopicMetadata) Marshal

func (t *TopicMetadata) Marshal(w *wipro.Writer)

func (*TopicMetadata) Unmarshal

func (t *TopicMetadata) Unmarshal(r *wipro.Reader)

type TopicMetadataRequest

type TopicMetadataRequest []string

func (*TopicMetadataRequest) APIKey

func (*TopicMetadataRequest) APIKey() int16

func (*TopicMetadataRequest) APIVersion

func (*TopicMetadataRequest) APIVersion() int16

func (*TopicMetadataRequest) Marshal

func (t *TopicMetadataRequest) Marshal(w *wipro.Writer)

func (*TopicMetadataRequest) Unmarshal

func (t *TopicMetadataRequest) Unmarshal(r *wipro.Reader)

type TopicMetadataResponse

type TopicMetadataResponse struct {
	Brokers        []Broker
	TopicMetadatas []TopicMetadata
}

func (*TopicMetadataResponse) Marshal

func (t *TopicMetadataResponse) Marshal(w *wipro.Writer)

func (*TopicMetadataResponse) Unmarshal

func (t *TopicMetadataResponse) Unmarshal(r *wipro.Reader)

Jump to

Keyboard shortcuts

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