hub

package
v0.0.0-...-3949d01 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package hub implements the CDB server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(addr string, peerAddrs []string) error

Types

type MsgType

type MsgType struct {
	Type string
}

For detecting incoming message type. Each struct below has Type set to the struct type name.

type PatchC2S

type PatchC2S struct {
	Type  string
	Key   string
	DType string // "delete" means, delete this record
	Patch string // encoded
}

type PatchR2I

type PatchR2I struct {
	Type     string
	AgentId  uint32 // agent that created this patch
	AgentSeq uint32 // creator's sequence number for this patch
	Key      string
	DType    string
	Patch    string // encoded
}

type PatchS2C

type PatchS2C struct {
	Type    string
	AgentId uint32 // agent that created this patch
	IsLocal bool   // true iff patch originated from this client (on this agent)
	Key     string
	DType   string // "delete" means, delete this record
	Patch   string // encoded
}

type SubscribeC2S

type SubscribeC2S struct {
	Type string
}

type SubscribeI2R

type SubscribeI2R struct {
	Type          string
	AgentId       uint32 // initiator's agent id
	Addr          string // initiator's network address
	VersionVector *common.VersionVector
}

type ValueS2C

type ValueS2C struct {
	Type  string
	Key   string
	DType string
	Value string // encoded
}

type ValuesDoneS2C

type ValuesDoneS2C struct {
	Type string
}

Jump to

Keyboard shortcuts

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