commands

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsumerGroupAsyncCommandVersion int16 = 1 // Basic AsyncCommand Compatibility Check

	StopConsumerGroupOpCode        ctrl.OpCode = 10
	StopConsumerGroupResultOpCode  ctrl.OpCode = 11
	StartConsumerGroupOpCode       ctrl.OpCode = 12
	StartConsumerGroupResultOpCode ctrl.OpCode = 13
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandLock

type CommandLock struct {
	Token       string        `json:"token"`       // A Token Identifying The Owner Of The Lock
	Timeout     time.Duration `json:"timeout"`     // Custom Lock Timeout, If 0 Then Default Timeout May Apply
	LockBefore  bool          `json:"lockBefore"`  // Optionally Lock The Resource Before The Command
	UnlockAfter bool          `json:"unlockAfter"` // Optionally Unlock The Resource After The Command
}

CommandLock provides common meta-data for adding/removing locks before/after commands.

func NewCommandLock

func NewCommandLock(token string, timeout time.Duration, lockBefore bool, unlockAfter bool) *CommandLock

NewCommandLock is a convenience constructor for the CommandLock struct.

type ConsumerGroupAsyncCommand

type ConsumerGroupAsyncCommand struct {
	Version   int16        `json:"version"`
	CommandId int64        `json:"commandId"`
	TopicName string       `json:"topicName"`
	GroupId   string       `json:"groupId"`
	Lock      *CommandLock `json:"lock,omitempty"`
}

ConsumerGroupAsyncCommand implements an AsyncCommand for handling ConsumerGroup related operations.

func NewConsumerGroupAsyncCommand

func NewConsumerGroupAsyncCommand(commandId int64, topicName string, groupId string, lock *CommandLock) *ConsumerGroupAsyncCommand

NewConsumerGroupAsyncCommand constructs and returns a new ConsumerGroupAsyncCommand.

func (*ConsumerGroupAsyncCommand) MarshalBinary

func (s *ConsumerGroupAsyncCommand) MarshalBinary() (data []byte, err error)

MarshalBinary implements the Control-Protocol AsyncCommand interface.

func (*ConsumerGroupAsyncCommand) SerializedId

func (s *ConsumerGroupAsyncCommand) SerializedId() []byte

SerializedId implements the Control-Protocol AsyncCommand interface.

func (*ConsumerGroupAsyncCommand) UnmarshalBinary

func (s *ConsumerGroupAsyncCommand) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the Control-Protocol AsyncCommand interface.

Jump to

Keyboard shortcuts

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