/go-buffer

go-buffer represents a Generic buffer that asynchronously flushes its contents.

Primary LanguageGoApache License 2.0Apache-2.0

go-buffer

go-buffer represents a Generic buffer that asynchronously flushes its contents.

Motivation

Provide generic buffer for user, which is useful for applications that need to aggregate data / write to an external storage before flush it. Compatible with various data types (Container), providing error handling and secure Close.

Features

  • Periodic automatic flush
  • Manually flush(async/sync)
  • Safely Close
  • Error Channel for error handling
  • Generic Support
  • Asynchronous cancellations and timeouts using Go contexts

Install

go get github.com/Kevinello/go-buffer@latest

⚠️ Retracted versions

Versions released erroneously, Please do not install these versions(retracted versions)

  • v0.0.1
  • v0.0.2
  • v0.0.3
  • v0.1.0

Usage

Life Cycle

Project Structure

Project Structure

TODO

  • add test and benchmark
  • preset kafka container(kafka-go message)

Contribution & Support

Feel free to send a pull request if you consider there's something which can be improved. Also, please open up an issue if you run into a problem when using benchvisual or just have a question.