kafka

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitKafkaTopic

func InitKafkaTopic(bootstrapUrl string, partitionNumber int, topics ...string) (err error)

func NewKafkaWriter

func NewKafkaWriter(config configuration.Config, topic model.Topic) *kafka.Writer

Types

type Command

type Command struct {
	Command string               `json:"command"`
	Id      string               `json:"id"`
	Rights  *ResourcePermissions `json:"rights"`
	Owner   string               `json:"owner,omitempty"`
}

func (Command) String

func (this Command) String() string

type KafkaProducer

type KafkaProducer struct {
	// contains filtered or unexported fields
}

func (*KafkaProducer) Close

func (this *KafkaProducer) Close() (err error)

func (*KafkaProducer) SendPermissions

func (this *KafkaProducer) SendPermissions(ctx context.Context, topic model.Topic, id string, permissions model.ResourcePermissions) (err error)

type KafkaProducerProvider

type KafkaProducerProvider struct{}

func NewKafkaProducerProvider

func NewKafkaProducerProvider() *KafkaProducerProvider

func (*KafkaProducerProvider) GetProducer

func (this *KafkaProducerProvider) GetProducer(config configuration.Config, topic model.Topic) (result Producer, err error)

type KeySeparationBalancer

type KeySeparationBalancer struct {
	SubBalancer kafka.Balancer
	Seperator   string
}

func (*KeySeparationBalancer) Balance

func (this *KeySeparationBalancer) Balance(msg kafka.Message, partitions ...int) (partition int)

type Producer

type Producer interface {
	Close() error
	SendPermissions(ctx context.Context, topic model.Topic, id string, permissions model.ResourcePermissions) (err error)
}

type Provider

type Provider interface {
	GetProducer(config configuration.Config, topic model.Topic) (Producer, error)
}

type ResourcePermissions

type ResourcePermissions struct {
	UserRights           map[string]Right `json:"user_rights"`
	GroupRights          map[string]Right `json:"group_rights"`
	KeycloakGroupsRights map[string]Right `json:"keycloak_groups_rights"`
}
type Right struct {
	Read         bool `json:"read"`
	Write        bool `json:"write"`
	Execute      bool `json:"execute"`
	Administrate bool `json:"administrate"`
}

type VoidProducer

type VoidProducer struct{}

func (*VoidProducer) Close

func (this *VoidProducer) Close() (err error)

func (*VoidProducer) SendPermissions

func (this *VoidProducer) SendPermissions(ctx context.Context, topic model.Topic, id string, permissions model.ResourcePermissions) (err error)

type VoidProducerProvider

type VoidProducerProvider struct{}

func NewVoidProducerProvider

func NewVoidProducerProvider() *VoidProducerProvider

func (*VoidProducerProvider) GetProducer

func (this *VoidProducerProvider) GetProducer(config configuration.Config, topic model.Topic) (result Producer, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳