storageadapter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte) (*parser.Data, error)

func Encode

func Encode(data *parser.Data) ([]byte, error)

Types

type QueueAdapter

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

QueueAdapter is a general storage adapter for the message brokers

func NewQueueAdapter

func NewQueueAdapter(stor storage.Storage) *QueueAdapter

func (*QueueAdapter) Inject

func (s *QueueAdapter) Inject(data *parser.Data) error

func (*QueueAdapter) ReadStream

func (s *QueueAdapter) ReadStream(topic string) (<-chan *parser.Data, <-chan error)

func (*QueueAdapter) Retrieve

func (s *QueueAdapter) Retrieve(topic string) (*parser.Data, error)

type SimpleAdapter

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

func NewSimpleAdapter

func NewSimpleAdapter(stor storage.Storage) *SimpleAdapter

func (*SimpleAdapter) Inject

func (s *SimpleAdapter) Inject(data *parser.Data) error

func (*SimpleAdapter) ReadStream

func (s *SimpleAdapter) ReadStream(blocknum string) (<-chan *parser.Data, <-chan error)

func (*SimpleAdapter) Retrieve

func (s *SimpleAdapter) Retrieve(blocknum string) (*parser.Data, error)

type StorageAdapter

type StorageAdapter interface {
	Inject(data *parser.Data) error
	Retrieve(key string) (*parser.Data, error)
	ReadStream(key string) (<-chan *parser.Data, <-chan error)
}

Jump to

Keyboard shortcuts

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