kinesis

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyStreamName = errors.New("kinesis stream name can't be empty")
)

Functions

func BuildStore

func BuildStore(cfg StoreConfig) (consumer.Store, error)

Types

type LoggerAdapter added in v0.3.0

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

func (*LoggerAdapter) Log added in v0.3.0

func (l *LoggerAdapter) Log(args ...interface{})

type SessionConfig

type SessionConfig struct {
	Endpoint   string
	Region     string
	StreamName string `split_words:"true" default:"watchops"`
	Store      StoreConfig
	Timeout    time.Duration `default:"5s"`
	MaxRetries int           `split_words:"true" default:"3"`
}

type StoreConfig

type StoreConfig struct {
	Driver  string `default:"memory"`
	AppName string `split_words:"true" default:"watchops_consumer"`
	Redis   struct {
		Address  string
		Password string
		Username string
		DB       int
	}
	Postgres struct {
		TableName string `split_words:"true"`
		DSN       string
	}
	MySQL struct {
		TableName string `split_words:"true"`
		DSN       string
	}
}

type Subscriber

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

Subscriber is the kinesis subscriber.

func NewSubscriber

func NewSubscriber(ctx context.Context, cfg SessionConfig) (*Subscriber, error)

NewSubscriber creates a new instance of Subscriber.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, fn func(ctx context.Context, payload []byte, headers map[string][]string) error) error

Subscribe subscribes to the kinesis stream. nolint: exhaustivestruct

Jump to

Keyboard shortcuts

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