messages

package
v1.9.24 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Encoding is the default binary encoding
	Encoding = binary.BigEndian
	// ErrKeyNotFound is an error indicating a given key does not exist
	ErrKeyNotFound = errors.New("not found")
	// ErrBucketNotFound is an error indicating a given key does not exist
	ErrBucketNotFound = errors.New("bucket not found")
	// ErrIndexOutdated is an error indicating that the supplied index is outdated
	ErrIndexOutdated = errors.New("index outdated")
)

Functions

func New

func New(options Options) (*messageLog, error)

Types

type Log

type Log interface {
	io.Closer
	Append(b []*packet.Publish) error
	Consume(ctx context.Context, from uint64, f func(string, *packet.Publish) error) error
}

type Options

type Options struct {
	// Path is the file path to the BoltDB to use
	Path string

	// BoltOptions contains any specific BoltDB options you might
	// want to specify [e.g. open timeout]
	BoltOptions *bolt.Options

	// NoSync causes the database to skip fsync calls after each
	// write to the log. This is unsafe, so it should be used
	// with caution.
	NoSync bool
}

type StoredMessage added in v1.5.0

type StoredMessage struct {
	Sender               string          `protobuf:"bytes,1,opt,name=Sender,proto3" json:"Sender,omitempty"`
	Publish              *packet.Publish `protobuf:"bytes,2,opt,name=Publish,proto3" json:"Publish,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*StoredMessage) Descriptor added in v1.5.0

func (*StoredMessage) Descriptor() ([]byte, []int)

func (*StoredMessage) GetPublish added in v1.5.0

func (m *StoredMessage) GetPublish() *packet.Publish

func (*StoredMessage) GetSender added in v1.5.0

func (m *StoredMessage) GetSender() string

func (*StoredMessage) ProtoMessage added in v1.5.0

func (*StoredMessage) ProtoMessage()

func (*StoredMessage) Reset added in v1.5.0

func (m *StoredMessage) Reset()

func (*StoredMessage) String added in v1.5.0

func (m *StoredMessage) String() string

func (*StoredMessage) XXX_DiscardUnknown added in v1.5.0

func (m *StoredMessage) XXX_DiscardUnknown()

func (*StoredMessage) XXX_Marshal added in v1.5.0

func (m *StoredMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoredMessage) XXX_Merge added in v1.5.0

func (m *StoredMessage) XXX_Merge(src proto.Message)

func (*StoredMessage) XXX_Size added in v1.5.0

func (m *StoredMessage) XXX_Size() int

func (*StoredMessage) XXX_Unmarshal added in v1.5.0

func (m *StoredMessage) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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