{"modulePath":"github.com/segmentio/topicctl","version":"v1.23.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package groups\n\n## Constants\n\n```go\nconst (\n\tLatestResetOffsetsStrategy   string = \"latest\"\n\tEarliestResetOffsetsStrategy string = \"earliest\"\n)\n```\nConsumer Group Offset reset strategies\n\n## Functions\n\n```go\nfunc FormatGroupCoordinators(groupCoordinators []GroupCoordinator) string\n```\nFormatGroupCoordinators generates a pretty table from the results of a call to GetGroups.\n\n```go\nfunc FormatGroupMembers(members []MemberInfo, full bool) string\n```\nFormatGroupMembers generates a pretty table from a slice of MemberInfo details.\n\n```go\nfunc FormatMemberLags(memberLags []MemberPartitionLag, full bool) string\n```\nFormatMemberLags generates a pretty table from the results of GetMemberLags.\n\n```go\nfunc FormatMemberPartitionCounts(members []MemberInfo) string\n```\nFormatMemberPartitionCounts generates a pretty table with the details on how many partitions group members are consuming from.\n\n```go\nfunc FormatPartitionOffsets(partitionOffsets map[int]int64) string\n```\nFormatPartitionOffsets generates a pretty table that shows the proposed offsets for each partition in a reset.\n\n```go\nfunc GetEarliestOrLatestOffset(\n\tctx context.Context,\n\tconnector *admin.Connector,\n\ttopic string,\n\tstrategy string,\n\tpartition int,\n) (int64, error)\n```\nGetEarliestorLatestOffset gets earliest/latest offset for a given topic partition for resetting offsets of consumer group\n\n```go\nfunc ResetOffsets(\n\tctx context.Context,\n\tconnector *admin.Connector,\n\ttopic string,\n\tgroupID string,\n\tpartitionOffsets map[int]int64,\n) error\n```\nResetOffsets updates the offsets for a given topic / group combination.\n\n## Types\n\n```go\ntype GroupCoordinator struct {\n\tGroupID     string\n\tCoordinator int\n\tTopics      []string\n}\n```\nGroupCoordinator stores the coordinator broker for a single consumer group.\n\n```go\nfunc GetGroups(\n\tctx context.Context,\n\tconnector *admin.Connector,\n) ([]GroupCoordinator, error)\n```\nGetGroups fetches and returns information about all consumer groups in the cluster.\n\n```go\ntype GroupDetails struct {\n\tGroupID string\n\tState   string\n\tMembers []MemberInfo\n}\n```\nGroupDetails stores the state and members for a consumer group.\n\n```go\nfunc GetGroupDetails(\n\tctx context.Context,\n\tconnector *admin.Connector,\n\tgroupID string,\n) (*GroupDetails, error)\n```\nGetGroupDetails returns the details (membership, etc.) for a single consumer group.\n\n```go\nfunc (g GroupDetails) PartitionMembers(topic string) map[int]MemberInfo\n```\nPartitionMembers returns the members for each partition in the argument topic.\n\n```go\nfunc (g GroupDetails) TopicsMap() map[string]struct{}\n```\nTopicsMap returns a map of all the topics consumed by the current group.\n\n```go\ntype MemberInfo struct {\n\tMemberID        string\n\tClientID        string\n\tClientHost      string\n\tTopicPartitions map[string][]int\n}\n```\nMemberInfo stores information about a single consumer group member.\n\n```go\nfunc (m MemberInfo) Topics() []string\n```\nTopics returns a slice of all topics that the current MemberInfo is consuming from.\n\n```go\ntype MemberPartitionLag struct {\n\tTopic        string\n\tPartition    int\n\tMemberID     string\n\tNewestOffset int64\n\tNewestTime   time.Time\n\tMemberOffset int64\n\tMemberTime   time.Time\n}\n```\nMemberPartitionLag information about the lag for a single topic / partition / group member combination.\n\n```go\nfunc GetMemberLags(\n\tctx context.Context,\n\tconnector *admin.Connector,\n\ttopic string,\n\tgroupID string,\n) ([]MemberPartitionLag, error)\n```\nGetMemberLags returns the lag for each partition being consumed by the argument group in the argument topic.\n\n```go\nfunc (m MemberPartitionLag) OffsetLag() int64\n```\nOffsetLag returns the difference between the latest offset in the partition and the latest one committed by the group member.\n\n```go\nfunc (m MemberPartitionLag) TimeLag() time.Duration\n```\nTimeLag returns the time difference between the latest timestamp in the the partition and the timestamp in the latest message committed by the group member.\n\n","path":"github.com/segmentio/topicctl/pkg/groups","name":"groups","synopsis":"","isRedistributable":true}
