common

package module
v0.0.0-...-90a9341 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

GoshawkDB Common

This repo contains Go code which is common between the server and the Go client. It also contains the Capn'Proto definition files for communication between the server and all clients.

Documentation

Index

Constants

View Source
const (
	DefaultPort          = 7894
	ProductVersion       = "0.3" // protocol version!
	ProductName          = "GoshawkDB"
	HeartbeatInterval    = 2 * time.Second
	ConnectionBufferSize = 131072
)
View Source
const (
	RMIdEmpty = RMId(0)
	KeyLen    = 20
	ClientLen = KeyLen - 8
)

Variables

View Source
var (
	VersionZero = MakeTxnId([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
)

Functions

func ConfigureSocket

func ConfigureSocket(socket *net.TCPConn) error

Types

type Capability

type Capability struct {
	msgs.Capability
}
var MaxCapability *Capability

func NewCapability

func NewCapability(c msgs.Capability) *Capability

func (*Capability) Equal

func (a *Capability) Equal(b *Capability) bool

func (*Capability) String

func (c *Capability) String() string

func (*Capability) Union

func (a *Capability) Union(b *Capability) *Capability

type Cmp

type Cmp int8
const (
	LT Cmp = iota - 1
	EQ
	GT
)

type KeyType

type KeyType [KeyLen]byte

type Positions

type Positions capn.UInt8List

func (*Positions) Equal

func (a *Positions) Equal(b *Positions) bool

func (*Positions) String

func (p *Positions) String() string

type RMId

type RMId uint32

func (RMId) String

func (rmId RMId) String() string

type RMIds

type RMIds []RMId

func (RMIds) EmptyLen

func (rmIds RMIds) EmptyLen() int

func (RMIds) Equal

func (a RMIds) Equal(b RMIds) bool

func (RMIds) Len

func (rmIds RMIds) Len() int

func (RMIds) Less

func (rmIds RMIds) Less(i, j int) bool

func (RMIds) NonEmpty

func (rmIds RMIds) NonEmpty() RMIds

func (RMIds) NonEmptyLen

func (rmIds RMIds) NonEmptyLen() int

func (RMIds) Sort

func (rmIds RMIds) Sort()

func (RMIds) Swap

func (rmIds RMIds) Swap(i, j int)

type SortUInt32

type SortUInt32 []uint32

func (SortUInt32) Len

func (nums SortUInt32) Len() int

func (SortUInt32) Less

func (nums SortUInt32) Less(i, j int) bool

func (SortUInt32) Sort

func (nums SortUInt32) Sort()

func (SortUInt32) Swap

func (nums SortUInt32) Swap(i, j int)

type TxnId

type TxnId KeyType

func MakeTxnId

func MakeTxnId(data []byte) *TxnId

func (TxnId) BootCount

func (txnId TxnId) BootCount() uint32

func (TxnId) ClientId

func (txnId TxnId) ClientId() [ClientLen]byte

func (*TxnId) Compare

func (a *TxnId) Compare(b *TxnId) Cmp

func (TxnId) ConnectionCount

func (txnId TxnId) ConnectionCount() uint32

func (TxnId) RMId

func (txnId TxnId) RMId() RMId

func (TxnId) String

func (txnId TxnId) String() string

type VarUUId

type VarUUId KeyType

func MakeVarUUId

func MakeVarUUId(data []byte) *VarUUId

func MakeVarUUIdFromStr

func MakeVarUUIdFromStr(str string) *VarUUId

func (VarUUId) BootCount

func (vUUId VarUUId) BootCount() uint32

func (*VarUUId) Compare

func (a *VarUUId) Compare(b *VarUUId) Cmp

func (VarUUId) ConnectionCount

func (vUUId VarUUId) ConnectionCount() uint32

func (VarUUId) RMId

func (vUUId VarUUId) RMId() RMId

func (VarUUId) String

func (vUUId VarUUId) String() string

type VarUUIds

type VarUUIds []*VarUUId

func (VarUUIds) Len

func (vUUIds VarUUIds) Len() int

func (VarUUIds) Less

func (vUUIds VarUUIds) Less(i, j int) bool

func (VarUUIds) Sort

func (vUUIds VarUUIds) Sort()

func (VarUUIds) Swap

func (vUUIds VarUUIds) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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