yorkie

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCPort     = 11101
	DefaultMetricsPort = 11102

	DefaultMongoConnectionURI        = "mongodb://localhost:27017"
	DefaultMongoConnectionTimeoutSec = 5
	DefaultMongoPingTimeoutSec       = 5
	DefaultMongoYorkieDatabase       = "yorkie-meta"

	DefaultSnapshotThreshold = 500
	DefaultSnapshotInterval  = 100
)

Below are the values of the default values of Yorkie config.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RPC     *rpc.Config        `json:"RPC"`
	Metrics *prometheus.Config `json:"Metrics"`
	Mongo   *mongo.Config      `json:"Mongo"`
	ETCD    *etcd.Config       `json:"ETCD"`
	Backend *backend.Config    `json:"Backend"`
}

Config is the configuration for creating a Yorkie instance.

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct that contains reasonable defaults for most of the configurations.

func NewConfigFromFile

func NewConfigFromFile(path string) (*Config, error)

NewConfigFromFile returns a Config struct for the given conf file.

func (*Config) RPCAddr

func (c *Config) RPCAddr() string

RPCAddr returns the RPC address.

type Yorkie

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

Yorkie is an agent of Yorkie framework. The agent receives changes from the client, stores them in the repository, and propagates the changes to clients who subscribe to the document.

func New

func New(conf *Config) (*Yorkie, error)

New creates a new instance of Yorkie.

func (*Yorkie) RPCAddr

func (r *Yorkie) RPCAddr() string

RPCAddr returns the address of the RPC.

func (*Yorkie) Shutdown

func (r *Yorkie) Shutdown(graceful bool) error

Shutdown shuts down this Yorkie agent.

func (*Yorkie) ShutdownCh

func (r *Yorkie) ShutdownCh() <-chan struct{}

ShutdownCh returns the shutdown channel.

func (*Yorkie) Start

func (r *Yorkie) Start() error

Start starts the agent by opening the rpc port.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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