bolt

package
v0.0.0-...-466853b Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	DB *storm.DB
}

Backend is a BoltDB backend.

func NewBackend

func NewBackend(path string) (*Backend, error)

NewBackend returns a BoltDB backend.

func (*Backend) Close

func (s *Backend) Close() error

Close BoltDB connection.

func (*Backend) Topic

func (s *Backend) Topic(name string) (lobby.Topic, error)

Topic returns the topic associated with the given name.

type Registry

type Registry struct {
	DB *storm.DB
	// contains filtered or unexported fields
}

Registry is a BoltDB registry.

func NewRegistry

func NewRegistry(path string, logger *log.Logger) (*Registry, error)

NewRegistry returns a BoltDB Registry.

func (*Registry) Close

func (r *Registry) Close() error

Close BoltDB connection and registered backends.

func (*Registry) Create

func (r *Registry) Create(backendName, topicName string) error

Create a topic in the registry.

func (*Registry) RegisterBackend

func (r *Registry) RegisterBackend(name string, backend lobby.Backend)

RegisterBackend registers a backend under the given name.

func (*Registry) Topic

func (r *Registry) Topic(name string) (lobby.Topic, error)

Topic returns the selected topic from the Backend.

type Topic

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

Topic is a BoltDB implementation of a topic.

func NewTopic

func NewTopic(node storm.Node) *Topic

NewTopic returns a Topic

func (*Topic) Close

func (t *Topic) Close() error

Close the topic session.

func (*Topic) Send

func (t *Topic) Send(message *lobby.Message) error

Send a message to the topic.

Directories

Path Synopsis
Package boltpb is a generated protocol buffer package.
Package boltpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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