filequeue

package
v0.0.0-...-e6c7ec5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileQueue

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

FileQueue implements the haraqa queue by storing messages in log files, under topic based directories

func New

func New(cacheFiles bool, maxEntries int64, dirs ...string) (*FileQueue, error)

New creates a new FileQueue

func (*FileQueue) Close

func (q *FileQueue) Close() error

Close closes the queue cached files

func (*FileQueue) Consume

func (q *FileQueue) Consume(group, topic string, id int64, limit int64, w http.ResponseWriter) (int, error)

Consume copies messages from a log to the writer

func (*FileQueue) CreateTopic

func (q *FileQueue) CreateTopic(topic string) error

CreateTopic creates a new topic if it does not already exist

func (*FileQueue) DeleteTopic

func (q *FileQueue) DeleteTopic(topic string) error

DeleteTopic deletes the topic and any nested topic within

func (*FileQueue) ListTopics

func (q *FileQueue) ListTopics(regex *regexp.Regexp) ([]string, error)

ListTopics returns all of the topic names in the queue

func (*FileQueue) ModifyTopic

func (q *FileQueue) ModifyTopic(topic string, request headers.ModifyRequest) (*headers.TopicInfo, error)

ModifyTopic updates the topic to truncate/remove messages and return the topic offset info

func (*FileQueue) Produce

func (q *FileQueue) Produce(topic string, msgSizes []int64, timestamp uint64, r io.Reader) error

Produce copies messages from the reader into the queue log

func (*FileQueue) RootDir

func (q *FileQueue) RootDir() string

RootDir returns the path to the haraqa queue root directory. This is used to serve the raw files

func (*FileQueue) WatchTopics

func (q *FileQueue) WatchTopics(topics []string) (written, deleted chan string, closer io.Closer, err error)

type MultiWriteAtCloser

type MultiWriteAtCloser []WriteAtCloser

MultiWriteAtCloser provides methods for a slice of WriteAtCloser

func (MultiWriteAtCloser) Close

func (mw MultiWriteAtCloser) Close() error

Close closes all writers in the slice

func (MultiWriteAtCloser) CopyNAt

func (mw MultiWriteAtCloser) CopyNAt(r io.Reader, N, off int64) error

CopyNAt performs a CopyNAt to each of the writers in order

func (MultiWriteAtCloser) WriteAt

func (mw MultiWriteAtCloser) WriteAt(p []byte, off int64) error

WriteAt performs a WriteAt to each of the writers in order

type WriteAtCloser

type WriteAtCloser interface {
	io.Closer
	io.WriterAt
}

WriteAtCloser is a combination of io.Writer and io.Closer, similar to io.WriteCloser

Jump to

Keyboard shortcuts

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