core

package
v0.0.0-...-be0592b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GCommands global db operation command map definition
	GCommands = &commands{cmds: nil}
)

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute(ctx ContextParams, decoder rpc.Request) (*types.OPReply, error)
}

Command db operation definition

type ContextParams

type ContextParams struct {
	context.Context
	Session  mongodb.Session
	ListenIP string
	Header   types.MsgHeader
}

ContextParams the logic function params

func (ContextParams) Deadline

func (c ContextParams) Deadline() (deadline time.Time, ok bool)

Deadline overwrite Context Deadline methods

func (ContextParams) Done

func (c ContextParams) Done() <-chan struct{}

Done overwrite Context Done methods

func (ContextParams) Err

func (c ContextParams) Err() error

Err overwrite Context Err methods

func (ContextParams) Value

func (c ContextParams) Value(key interface{}) interface{}

Value overwrite Context Value methods

type Core

type Core interface {
	ExecuteCommand(ctx ContextParams, input rpc.Request) (*types.OPReply, error)
	Subscribe(chan *types.Transaction)
	UnSubscribe(chan<- *types.Transaction)
}

Core core operation methods

func New

func New(txnMgr *transaction.Manager, db mongodb.Client) Core

New create a core instance

type SetDBProxy

type SetDBProxy interface {
	SetDBProxy(db mongodb.Client)
}

SetDBProxy set db proxy

type SetTransaction

type SetTransaction interface {
	SetTxn(txn *transaction.Manager)
}

SetTransaction set txc method interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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