Documentation
¶
Index ¶
- func Micros(duration time.Duration) uint64
- type ChangePassword
- type Code
- type Command
- type CreateConsumerGroup
- type CreatePartitions
- type CreatePersonalAccessToken
- type CreateStream
- type CreateTopic
- type CreateUser
- type DeleteConsumerGroup
- type DeleteConsumerOffset
- type DeletePartitions
- type DeletePersonalAccessToken
- type DeleteSegments
- type DeleteStream
- type DeleteTopic
- type DeleteUser
- type DescribeOptions
- type FetchMessages
- type FetchTarget
- type GetClient
- type GetClients
- type GetClusterMetadata
- type GetConsumerGroup
- type GetConsumerGroups
- type GetConsumerOffset
- type GetMe
- type GetMetadataChanges
- type GetPersonalAccessTokens
- type GetStats
- type GetStream
- type GetStreams
- type GetTopic
- type GetTopics
- type GetUser
- type GetUsers
- type JoinConsumerGroup
- type LeaveConsumerGroup
- type LoginUser
- type LoginWithPersonalAccessToken
- type LogoutUser
- type Ping
- type PollMessages
- type SendMessages
- type StoreConsumerOffsetRequest
- type SyncConsumerGroup
- type TopicPath
- type UpdatePermissions
- type UpdateStream
- type UpdateTopic
- type UpdateUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangePassword ¶
type ChangePassword struct {
UserID iggcon.Identifier `json:"-"`
CurrentPassword string `json:"CurrentPassword"`
NewPassword string `json:"NewPassword"`
}
func (*ChangePassword) Code ¶
func (c *ChangePassword) Code() Code
func (*ChangePassword) MarshalBinary ¶
func (c *ChangePassword) MarshalBinary() ([]byte, error)
type Code ¶
type Code int
const ( PingCode Code = 1 GetStatsCode Code = 10 GetSnapshotFileCode Code = 11 GetClusterMetadataCode Code = 12 DescribeOptionsCode Code = 13 BindSessionCode Code = 15 UpdateResourceCode Code = 16 GetMetadataChangesCode Code = 17 GetMeCode Code = 20 GetClientCode Code = 21 GetClientsCode Code = 22 GetUserCode Code = 31 GetUsersCode Code = 32 CreateUserCode Code = 33 DeleteUserCode Code = 34 UpdatePermissionsCode Code = 36 ChangePasswordCode Code = 37 LoginUserCode Code = 38 LogoutUserCode Code = 39 LoginRegisterCode Code = 40 GetAccessTokensCode Code = 41 CreateAccessTokenCode Code = 42 DeleteAccessTokenCode Code = 43 LoginWithAccessTokenCode Code = 44 LoginRegisterWithPATCode Code = 45 PollMessagesCode Code = 100 SendMessagesCode Code = 101 // 35, 103, 104, 123, 124, 204 and 304 are retired and must never be reused. GetPartitionRouteCode Code = 105 PollMessagesDeferredCode Code = 106 CancelDeferredRequestCode Code = 108 FetchMessagesCode Code = 109 GetOffsetCode Code = 120 StoreOffsetCode Code = 121 DeleteConsumerOffsetCode Code = 122 GetStreamCode Code = 200 GetStreamsCode Code = 201 CreateStreamCode Code = 202 DeleteStreamCode Code = 203 GetTopicCode Code = 300 GetTopicsCode Code = 301 CreateTopicCode Code = 302 DeleteTopicCode Code = 303 CreatePartitionsCode Code = 402 DeletePartitionsCode Code = 403 DeleteSegmentsCode Code = 503 GetGroupCode Code = 600 GetGroupsCode Code = 601 CreateGroupCode Code = 602 DeleteGroupCode Code = 603 JoinGroupCode Code = 604 LeaveGroupCode Code = 605 SyncGroupCode Code = 606 )
type Command ¶
type Command interface {
// Code returns the command code associated with this command.
Code() Code
encoding.BinaryMarshaler
}
type CreateConsumerGroup ¶
func (*CreateConsumerGroup) Code ¶
func (c *CreateConsumerGroup) Code() Code
func (*CreateConsumerGroup) MarshalBinary ¶
func (c *CreateConsumerGroup) MarshalBinary() ([]byte, error)
type CreatePartitions ¶
type CreatePartitions struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
PartitionsCount uint32 `json:"partitionsCount"`
}
func (*CreatePartitions) Code ¶
func (c *CreatePartitions) Code() Code
func (*CreatePartitions) MarshalBinary ¶
func (c *CreatePartitions) MarshalBinary() ([]byte, error)
type CreatePersonalAccessToken ¶
type CreatePersonalAccessToken struct {
Name string `json:"Name"`
Expiry iggcon.Duration `json:"Expiry"`
}
func (*CreatePersonalAccessToken) Code ¶
func (c *CreatePersonalAccessToken) Code() Code
func (*CreatePersonalAccessToken) MarshalBinary ¶
func (c *CreatePersonalAccessToken) MarshalBinary() ([]byte, error)
type CreateStream ¶
type CreateStream struct {
Name string
Options iggcon.StreamOptions
}
func (*CreateStream) Code ¶
func (request *CreateStream) Code() Code
func (*CreateStream) MarshalBinary ¶
func (request *CreateStream) MarshalBinary() ([]byte, error)
MarshalBinary refuses an invalid key, typed or raw, so it never leaves the client.
type CreateTopic ¶
type CreateTopic struct {
StreamId iggcon.Identifier
Name string
Options iggcon.TopicOptions
}
func (*CreateTopic) Code ¶
func (t *CreateTopic) Code() Code
func (*CreateTopic) MarshalBinary ¶
func (t *CreateTopic) MarshalBinary() ([]byte, error)
type CreateUser ¶
type CreateUser struct {
Username string `json:"username"`
Password string `json:"Password"`
Status iggcon.UserStatus `json:"Status"`
Permissions *iggcon.Permissions `json:"Permissions,omitempty"`
Options iggcon.UserOptions `json:"-"`
}
func (*CreateUser) Code ¶
func (c *CreateUser) Code() Code
func (*CreateUser) MarshalBinary ¶
func (c *CreateUser) MarshalBinary() ([]byte, error)
type DeleteConsumerGroup ¶
type DeleteConsumerGroup struct {
TopicPath
GroupId iggcon.Identifier
}
func (*DeleteConsumerGroup) Code ¶
func (d *DeleteConsumerGroup) Code() Code
func (*DeleteConsumerGroup) MarshalBinary ¶
func (d *DeleteConsumerGroup) MarshalBinary() ([]byte, error)
type DeleteConsumerOffset ¶
type DeleteConsumerOffset struct {
Consumer iggcon.Consumer
StreamId iggcon.Identifier
TopicId iggcon.Identifier
PartitionId *uint32
}
func (*DeleteConsumerOffset) Code ¶
func (d *DeleteConsumerOffset) Code() Code
func (*DeleteConsumerOffset) MarshalBinary ¶
func (d *DeleteConsumerOffset) MarshalBinary() ([]byte, error)
type DeletePartitions ¶
type DeletePartitions struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
PartitionsCount uint32 `json:"partitionsCount"`
}
func (*DeletePartitions) Code ¶
func (d *DeletePartitions) Code() Code
func (*DeletePartitions) MarshalBinary ¶
func (d *DeletePartitions) MarshalBinary() ([]byte, error)
type DeletePersonalAccessToken ¶
type DeletePersonalAccessToken struct {
Name string `json:"Name"`
}
func (*DeletePersonalAccessToken) Code ¶
func (d *DeletePersonalAccessToken) Code() Code
func (*DeletePersonalAccessToken) MarshalBinary ¶
func (d *DeletePersonalAccessToken) MarshalBinary() ([]byte, error)
type DeleteSegments ¶ added in v0.9.0
type DeleteSegments struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
PartitionId uint32 `json:"partitionId"`
SegmentsCount uint32 `json:"segmentsCount"`
}
func (*DeleteSegments) Code ¶ added in v0.9.0
func (d *DeleteSegments) Code() Code
func (*DeleteSegments) MarshalBinary ¶ added in v0.9.0
func (d *DeleteSegments) MarshalBinary() ([]byte, error)
type DeleteStream ¶
type DeleteStream struct {
StreamId iggcon.Identifier
}
func (*DeleteStream) Code ¶
func (d *DeleteStream) Code() Code
func (*DeleteStream) MarshalBinary ¶
func (d *DeleteStream) MarshalBinary() ([]byte, error)
type DeleteTopic ¶
type DeleteTopic struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
}
func (*DeleteTopic) Code ¶
func (d *DeleteTopic) Code() Code
func (*DeleteTopic) MarshalBinary ¶
func (d *DeleteTopic) MarshalBinary() ([]byte, error)
type DeleteUser ¶
type DeleteUser struct {
Id iggcon.Identifier
}
func (*DeleteUser) Code ¶
func (d *DeleteUser) Code() Code
func (*DeleteUser) MarshalBinary ¶
func (d *DeleteUser) MarshalBinary() ([]byte, error)
type DescribeOptions ¶ added in v0.9.0
type DescribeOptions struct {
Scope iggcon.OptionsScope
}
DescribeOptions asks for the option catalog of one resource scope.
func (*DescribeOptions) Code ¶ added in v0.9.0
func (d *DescribeOptions) Code() Code
func (*DescribeOptions) MarshalBinary ¶ added in v0.9.0
func (d *DescribeOptions) MarshalBinary() ([]byte, error)
type FetchMessages ¶ added in v0.10.0
type FetchMessages struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
Consumer iggcon.Consumer
Targets []FetchTarget
Count uint32
AutoCommit bool
Options iggcon.DeferredPollOptions
}
FetchMessages reads the targets of one primary in one deferred request. Each target carries its own cap and partition fence, so the request header carries no partition context.
func (*FetchMessages) AppendBinary ¶ added in v0.10.0
func (m *FetchMessages) AppendBinary(b []byte) ([]byte, error)
func (*FetchMessages) Code ¶ added in v0.10.0
func (m *FetchMessages) Code() Code
func (*FetchMessages) MarshalBinary ¶ added in v0.10.0
func (m *FetchMessages) MarshalBinary() ([]byte, error)
type FetchTarget ¶ added in v0.10.0
type FetchTarget struct {
iggcon.FetchMessagesTarget
MaxBytes uint32
}
FetchTarget is a fetch target with its cap, the most record bytes that its section holds. Its fence is Strategy.Context, zero without one.
type GetClients ¶
type GetClients struct{}
func (*GetClients) Code ¶
func (c *GetClients) Code() Code
func (*GetClients) MarshalBinary ¶
func (c *GetClients) MarshalBinary() ([]byte, error)
type GetClusterMetadata ¶
type GetClusterMetadata struct {
}
func (*GetClusterMetadata) Code ¶
func (m *GetClusterMetadata) Code() Code
func (*GetClusterMetadata) MarshalBinary ¶
func (m *GetClusterMetadata) MarshalBinary() ([]byte, error)
type GetConsumerGroup ¶
type GetConsumerGroup struct {
TopicPath
GroupId iggcon.Identifier
}
func (*GetConsumerGroup) Code ¶
func (g *GetConsumerGroup) Code() Code
func (*GetConsumerGroup) MarshalBinary ¶
func (g *GetConsumerGroup) MarshalBinary() ([]byte, error)
type GetConsumerGroups ¶
type GetConsumerGroups struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
}
func (*GetConsumerGroups) Code ¶
func (g *GetConsumerGroups) Code() Code
func (*GetConsumerGroups) MarshalBinary ¶
func (g *GetConsumerGroups) MarshalBinary() ([]byte, error)
type GetConsumerOffset ¶
type GetConsumerOffset struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
Consumer iggcon.Consumer `json:"consumer"`
PartitionId *uint32 `json:"partitionId"`
}
func (*GetConsumerOffset) Code ¶
func (g *GetConsumerOffset) Code() Code
func (*GetConsumerOffset) MarshalBinary ¶
func (g *GetConsumerOffset) MarshalBinary() ([]byte, error)
type GetMe ¶ added in v0.10.0
type GetMe struct{}
GetMe asks for the info of the client that sent the request, so it needs no identifier and carries no payload.
func (*GetMe) MarshalBinary ¶ added in v0.10.0
type GetMetadataChanges ¶ added in v0.10.0
type GetMetadataChanges struct {
Query iggcon.MetadataChangesQuery
}
GetMetadataChanges asks for one page of the metadata change log, or of the current state.
func (*GetMetadataChanges) AppendBinary ¶ added in v0.10.0
func (g *GetMetadataChanges) AppendBinary(b []byte) ([]byte, error)
AppendBinary validates the query, then encodes [start:u8][cursor:44] [has_since:u8][since:u64][has_until:u8][until:u64][limit:u32] [groups_count:u8][group:u8]*[token_len:u16][token]. The cursor is all zero unless the query starts after one, and the token is empty unless it continues a current scan. Groups keep the caller's order.
func (*GetMetadataChanges) Code ¶ added in v0.10.0
func (g *GetMetadataChanges) Code() Code
func (*GetMetadataChanges) MarshalBinary ¶ added in v0.10.0
func (g *GetMetadataChanges) MarshalBinary() ([]byte, error)
type GetPersonalAccessTokens ¶
type GetPersonalAccessTokens struct{}
func (*GetPersonalAccessTokens) Code ¶
func (g *GetPersonalAccessTokens) Code() Code
func (*GetPersonalAccessTokens) MarshalBinary ¶
func (g *GetPersonalAccessTokens) MarshalBinary() ([]byte, error)
type GetStream ¶
type GetStream struct {
StreamId iggcon.Identifier
}
func (*GetStream) MarshalBinary ¶
type GetStreams ¶
type GetStreams struct{}
func (*GetStreams) Code ¶
func (g *GetStreams) Code() Code
func (*GetStreams) MarshalBinary ¶
func (g *GetStreams) MarshalBinary() ([]byte, error)
type GetTopic ¶
type GetTopic struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
}
func (*GetTopic) MarshalBinary ¶
type GetTopics ¶
type GetTopics struct {
StreamId iggcon.Identifier
}
func (*GetTopics) MarshalBinary ¶
type JoinConsumerGroup ¶
type JoinConsumerGroup struct {
TopicPath
GroupId iggcon.Identifier
}
func (*JoinConsumerGroup) Code ¶
func (j *JoinConsumerGroup) Code() Code
func (*JoinConsumerGroup) MarshalBinary ¶
func (j *JoinConsumerGroup) MarshalBinary() ([]byte, error)
type LeaveConsumerGroup ¶
type LeaveConsumerGroup struct {
TopicPath
GroupId iggcon.Identifier
}
func (*LeaveConsumerGroup) Code ¶
func (l *LeaveConsumerGroup) Code() Code
func (*LeaveConsumerGroup) MarshalBinary ¶
func (l *LeaveConsumerGroup) MarshalBinary() ([]byte, error)
type LoginUser ¶
func (*LoginUser) MarshalBinary ¶
type LoginWithPersonalAccessToken ¶
type LoginWithPersonalAccessToken struct {
Token string `json:"token"`
}
func (*LoginWithPersonalAccessToken) Code ¶
func (lw *LoginWithPersonalAccessToken) Code() Code
func (*LoginWithPersonalAccessToken) MarshalBinary ¶
func (lw *LoginWithPersonalAccessToken) MarshalBinary() ([]byte, error)
type LogoutUser ¶
type LogoutUser struct{}
func (*LogoutUser) Code ¶
func (lu *LogoutUser) Code() Code
func (*LogoutUser) MarshalBinary ¶
func (lu *LogoutUser) MarshalBinary() ([]byte, error)
type PollMessages ¶
type PollMessages struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
Consumer iggcon.Consumer `json:"consumer"`
PartitionId *uint32 `json:"partitionId"`
Strategy iggcon.PollingStrategy `json:"pollingStrategy"`
Count uint32 `json:"count"`
AutoCommit bool `json:"autoCommit"`
// Deferred makes the poll a deferred poll, which the server holds until
// its limits are met.
Deferred *iggcon.DeferredPollOptions `json:"deferred"`
}
func (*PollMessages) AppendBinary ¶ added in v0.9.0
func (m *PollMessages) AppendBinary(b []byte) ([]byte, error)
func (*PollMessages) Code ¶
func (m *PollMessages) Code() Code
func (*PollMessages) MarshalBinary ¶
func (m *PollMessages) MarshalBinary() ([]byte, error)
type SendMessages ¶
type SendMessages struct {
Compression iggcon.IggyMessageCompression
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
Partitioning iggcon.Partitioning `json:"partitioning"`
Messages []iggcon.IggyMessage `json:"messages"`
}
func (*SendMessages) AppendBinary ¶ added in v0.9.0
func (s *SendMessages) AppendBinary(b []byte) ([]byte, error)
AppendBinary encodes the batch straight into b: [metadata_length u32] [stream id][topic id][partitioning][messages_count u32], then one canonical batch record: a 256-byte batch header followed by one frame per message.
func (*SendMessages) Code ¶
func (s *SendMessages) Code() Code
func (*SendMessages) MarshalBinary ¶
func (s *SendMessages) MarshalBinary() ([]byte, error)
type StoreConsumerOffsetRequest ¶
type StoreConsumerOffsetRequest struct {
StreamId iggcon.Identifier `json:"streamId"`
TopicId iggcon.Identifier `json:"topicId"`
Consumer iggcon.Consumer `json:"consumer"`
PartitionId *uint32 `json:"partitionId"`
Offset uint64 `json:"offset"`
}
func (*StoreConsumerOffsetRequest) Code ¶
func (s *StoreConsumerOffsetRequest) Code() Code
func (*StoreConsumerOffsetRequest) MarshalBinary ¶
func (s *StoreConsumerOffsetRequest) MarshalBinary() ([]byte, error)
type SyncConsumerGroup ¶ added in v0.9.0
type SyncConsumerGroup struct {
TopicPath
GroupId iggcon.Identifier
}
func (*SyncConsumerGroup) Code ¶ added in v0.9.0
func (s *SyncConsumerGroup) Code() Code
func (*SyncConsumerGroup) MarshalBinary ¶ added in v0.9.0
func (s *SyncConsumerGroup) MarshalBinary() ([]byte, error)
type TopicPath ¶
type TopicPath struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
}
type UpdatePermissions ¶
type UpdatePermissions struct {
UserID iggcon.Identifier `json:"-"`
Permissions *iggcon.Permissions `json:"Permissions,omitempty"`
}
func (*UpdatePermissions) Code ¶
func (u *UpdatePermissions) Code() Code
func (*UpdatePermissions) MarshalBinary ¶
func (u *UpdatePermissions) MarshalBinary() ([]byte, error)
type UpdateStream ¶
type UpdateStream struct {
StreamId iggcon.Identifier
Name *string
Reset []iggcon.StreamOptionKey
RawReset []string
Options []iggcon.HeaderEntry
}
UpdateStream patches a stream through the generic UpdateResource command.
func (*UpdateStream) Code ¶
func (u *UpdateStream) Code() Code
func (*UpdateStream) MarshalBinary ¶
func (u *UpdateStream) MarshalBinary() ([]byte, error)
type UpdateTopic ¶
type UpdateTopic struct {
StreamId iggcon.Identifier
TopicId iggcon.Identifier
Name *string
MessageExpiry *iggcon.Duration
MaxTopicSize *uint64
Reset []iggcon.TopicOptionKey
RawReset []string
Options []iggcon.HeaderEntry
}
UpdateTopic patches a topic through the generic UpdateResource command. Create-only settings, compression included, have no field here.
func (*UpdateTopic) Code ¶
func (u *UpdateTopic) Code() Code
func (*UpdateTopic) MarshalBinary ¶
func (u *UpdateTopic) MarshalBinary() ([]byte, error)
MarshalBinary encodes the patch. A zero expiry or size is the server-default sentinel and changes nothing, Reset returns a key to its default.
type UpdateUser ¶
type UpdateUser struct {
UserID iggcon.Identifier
Username *string
Status *iggcon.UserStatus
Reset []iggcon.UserOptionKey
RawReset []string
Options []iggcon.HeaderEntry
}
UpdateUser patches a user through the generic UpdateResource command.
func (*UpdateUser) Code ¶
func (u *UpdateUser) Code() Code
func (*UpdateUser) MarshalBinary ¶
func (u *UpdateUser) MarshalBinary() ([]byte, error)