store

package
v0.0.0-...-63bf433 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID        *primitive.ObjectID `json:"_id" bson:"_id"`
	Data      string              `bson:"data"`
	Q         Q                   `bson:"q"`
	ReadCount uint64              `bson:"readCount"`
}

type Q

type Q struct {
	Name string `json:"name"`
}

type ReadResult

type ReadResult struct {
	Q     Q
	Count int64
	ID    string
}

type Store

type Store interface {
	Insert(ctx context.Context, m Message) (*WriteResult, error)
	Tail(name string) (chan Message, error)
	MarkRead(ctx context.Context, m Message) (*ReadResult, error)
	Create(ctx context.Context, name string, size int64) error
}

func New

func New(c *mongo.Client, name string, readCount uint64) Store

type WriteResult

type WriteResult struct {
	Q  Q
	ID string
}

Jump to

Keyboard shortcuts

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