backend

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: Apache-2.0 Imports: 6 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 {
	Config *Config

	DB       db.DB
	MutexMap *sync.MutexMap
	PubSub   *pubsub.PubSub
	// contains filtered or unexported fields
}

Backend manages Yorkie's remote states such as data store, distributed lock and etc. And it has the server status like the configuration.

func New

func New(conf *Config, mongoConf *mongo.Config) (*Backend, error)

New creates a new instance of Backend.

func (*Backend) AttachGoroutine

func (b *Backend) AttachGoroutine(f func())

AttachGoroutine creates a goroutine on a given function and tracks it using the backend's WaitGroup.

func (*Backend) Close

func (b *Backend) Close() error

Close closes all resources of this instance.

type Config

type Config struct {
	// SnapshotThreshold is the threshold that determines if changes should be
	// sent with snapshot when the number of changes is greater than this value.
	SnapshotThreshold uint64 `json:"SnapshotThreshold"`

	// SnapshotInterval is the interval of changes to create a snapshot.
	SnapshotInterval uint64 `json:"SnapshotInterval"`
}

Config is the configuration for creating a Backend instance.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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