storage

package
v0.0.0-...-7b65136 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

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

func NewGroup

func NewGroup(storagers ...Storager) *Group

func (*Group) Add

func (g *Group) Add(s Storager)

func (*Group) Close

func (g *Group) Close() (err error)

func (*Group) Size

func (g *Group) Size() int

func (*Group) Write

func (g *Group) Write(msg *Message) (err error)

type Marshaler

type Marshaler interface {
	Marshal() ([]byte, error)
}

func JSONMarshaler

func JSONMarshaler(v interface{}) Marshaler

type Message

type Message struct {
	Topic string
	Key   string
	Value Marshaler
}

func NewMessage

func NewMessage(topic, key string, value Marshaler) *Message

type MockStorage

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

func NewMockStorage

func NewMockStorage(bufferSize int) (*MockStorage, error)

func (*MockStorage) Close

func (s *MockStorage) Close() error

func (*MockStorage) Successes

func (s *MockStorage) Successes() <-chan *Message

func (*MockStorage) Write

func (s *MockStorage) Write(msg *Message) error

type Storage

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

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) Write

func (s *Storage) Write(msg *Message) error

type Storager

type Storager interface {
	Write(*Message) error
	Close() error
}

func New

func New(w io.Writer) Storager

type StringMarshaler

type StringMarshaler string

func (StringMarshaler) Marshal

func (s StringMarshaler) Marshal() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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