subscription

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BoltDBFile = "subscriptions.db"

BoltDBFile is the filename to store the boltdb database

View Source
const BucketName = "subscriptions"

BucketName is the bucket name to store the invitations on the bolt db

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Has(sub *Subscription) bool
	Store(sub *Subscription) error
	Remove(sub *Subscription) error
}

Repository is the interface that needs to be implemented by subscription storage

func NewBoltRepository

func NewBoltRepository(dbpath string) Repository

NewBoltRepository initializes a new repository

func NewRedisRepository

func NewRedisRepository(opts *redis.Options) Repository

NewRedisRepository initializes a new repository

type Subscription

type Subscription struct {
	From           hash.Hash
	To             hash.Hash
	SubscriptionID string
}

Subscription is a tuple that can be used to identify a mailing list user. If one is found, we are allowed to skip proof-of-work during uploading messages.

func New

func New(from, to hash.Hash, subscriptionID string) Subscription

New returns a new subscription

Jump to

Keyboard shortcuts

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