server

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCPort             = 11101
	DefaultRPCMaxRequestsBytes = 4 * 1024 * 1024 // 4MiB

	DefaultProfilingPort = 11102

	DefaultAdminPort = 11103

	DefaultHousekeepingInterval            = time.Minute
	DefaultHousekeepingDeactivateThreshold = 7 * 24 * time.Hour
	DefaultHousekeepingCandidateLimit      = 500

	DefaultMongoConnectionURI     = "mongodb://localhost:27017"
	DefaultMongoConnectionTimeout = 5 * time.Second
	DefaultMongoPingTimeout       = 5 * time.Second
	DefaultMongoYorkieDatabase    = "yorkie-meta"

	DefaultUseDefaultProject = true
	DefaultSnapshotThreshold = 500
	DefaultSnapshotInterval  = 1000

	DefaultAuthWebhookMaxRetries      = 10
	DefaultAuthWebhookMaxWaitInterval = 3000 * time.Millisecond
	DefaultAuthWebhookCacheSize       = 5000
	DefaultAuthWebhookCacheAuthTTL    = 10 * time.Second
	DefaultAuthWebhookCacheUnauthTTL  = 10 * time.Second
)

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          `yaml:"RPC"`
	Profiling    *profiling.Config    `yaml:"Profiling"`
	Admin        *admin.Config        `yaml:"Admin"`
	Housekeeping *housekeeping.Config `yaml:"Housekeeping"`
	Backend      *backend.Config      `yaml:"Backend"`
	Mongo        *mongo.Config        `yaml:"Mongo"`
	ETCD         *etcd.Config         `yaml:"ETCD"`
}

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) AdminAddr

func (c *Config) AdminAddr() string

AdminAddr returns the Admin address.

func (*Config) RPCAddr

func (c *Config) RPCAddr() string

RPCAddr returns the RPC address.

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if the provided Config is invalidated.

type Yorkie

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

Yorkie is a server of Yorkie. The server 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) AdminAddr

func (r *Yorkie) AdminAddr() string

AdminAddr returns the address of the admin server.

func (*Yorkie) Members

func (r *Yorkie) Members() map[string]*sync.ServerInfo

Members returns the members of this cluster.

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 server.

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 server by opening the rpc port.

Jump to

Keyboard shortcuts

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