models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	Topic      string `json:"topic"`
	Partitions []int  `json:"partitions"`
}

type BrokerInfo added in v0.1.0

type BrokerInfo struct {
	ID           int32  `json:"id"`
	Addr         string `json:"addr"`
	IsController bool   `json:"is_controller"`
}

func NewBrokerInfo added in v0.1.0

func NewBrokerInfo(
	id int32,
	addr string,
	isController bool,
) BrokerInfo

type ClusterInfo added in v0.1.0

type ClusterInfo struct {
	Brokers []BrokerInfo `json:"brokers"`
}

func NewClusterInfo added in v0.1.0

func NewClusterInfo() ClusterInfo

type Group

type Group struct {
	GroupID string `json:"group_id"`
	State   string `json:"state"`
	/// TODO:
	Offsets map[string][]Offset `json:"offsets"`
	// Protocol     string
	// ProtocolType string
	Members []Member `json:"members"`
}

func NewGroup

func NewGroup() Group

type Member

type Member struct {
	Host        string       `json:"host"`
	ID          string       `json:"id"`
	Assignments []Assignment `json:"assignments"`
}

type Message

type Message struct {
	Headers   map[string]string
	Timestamp time.Time
	// TODO: remove
	BlockTimestamp time.Time

	Topic     string
	Partition int32
	Offset    int64
	Key       []byte
	Value     []byte
}

func MessageFromSarama

func MessageFromSarama(msg *sarama.ConsumerMessage) Message

TODO: headers

type Offset

type Offset struct {
	Partition      int32 `json:"partition"`
	Offset         int64 `json:"offset"`
	HightWatermark int64 `json:"hight_watermark"`
	Lag            int64 `json:"lag"`
	LogStartOffset int64 `json:"log_start_offset"`
}

type PartitionInfo

type PartitionInfo struct {
	Partition      int32   `json:"partition"`
	HightWatermark int64   `json:"hight_watermark"`
	Leader         int32   `json:"leader"`
	Replicas       int     `json:"replicas"`
	ISR            []int32 `json:"isr"`
	LogEndOffset   int64   `json:"log_end_offset"`
	LogStartOffset int64   `json:"log_start_offset"`
}

type Topic

type Topic struct {
	Name       string
	Partitions int
	Replicas   int
}

TODO: migrate as part TopicInfo

type TopicConfigRecord

type TopicConfigRecord struct {
	Name      string `json:"name,omitempty"`
	Value     string `json:"value,omitempty"`
	ReadOnly  bool   `json:"read_only,omitempty"`
	Sensitive bool   `json:"sensitive,omitempty"`
}

type TopicConsumerInfo

type TopicConsumerInfo struct {
	Name         string `json:"name,omitempty"`
	MembersCount int    `json:"members_count,omitempty"`
}

type TopicConsumers

type TopicConsumers struct {
	Consumers []TopicConsumerInfo `json:"consumers,omitempty"`
}

type TopicInfo

type TopicInfo struct {
	TopicName  string              `json:"topic_name,omitempty"`
	Internal   bool                `json:"internal,omitempty"`
	Compacted  bool                `json:"compacted,omitempty"`
	Partitions []PartitionInfo     `json:"partitions,omitempty"`
	Config     []TopicConfigRecord `json:"config,omitempty"`
}

func NewTopicInfo

func NewTopicInfo() TopicInfo

Jump to

Keyboard shortcuts

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