Documentation ¶
Index ¶
- Constants
- func AddEntity(entityType string, schema *runtime.Schema) *entityTypeDef
- func AddEventHandler(handler EventHandler)
- func Entity(entityType string, thriftIDL string) *entityTypeDef
- func StartNode(ctx context.Context, addr string)
- func StopNode(ctx context.Context)
- type CommandHandler
- type Event
- type EventHandler
- type NumberedError
Constants ¶
View Source
const ErrBusinessRuleViolated = 20002 // `throw` in javascript code means business rule violation
View Source
const ErrDocumentSchemaViolated = 10004
View Source
const ErrDuplicatedEntity = LoggedErrStart // create entity with same entity id but with different command id
View Source
const ErrEntityMissing = 10006 // query can not find the entity
View Source
const ErrEventLogConflict = 10001 // the master is no longer in charge, should find out who is the master
View Source
const ErrForwardedTooManyTimes = 10002 // the master can not be found
View Source
const ErrMustCreateFirst = 20001 // entity not created yet, so can not exec other command
View Source
const ErrRequestSchemaViolated = 10003
View Source
const ErrResponseSchemaViolated = 10005
View Source
const ErrUnknown = 10000
View Source
const LoggedErrEnd = 30000
View Source
const LoggedErrStart = 20000
error number within range [LoggedErrStart, LoggedErrEnd) is committed in event_log as fact
Variables ¶
This section is empty.
Functions ¶
func AddEventHandler ¶
func AddEventHandler(handler EventHandler)
Types ¶
type CommandHandler ¶
type CommandHandler func(doc interface{}, request interface{}) (resp interface{})
type Event ¶
type Event struct { PartitionId uint64 `json:"-"` EntityType string `json:"-"` EventId uint64 `json:"-"` EntityId string `json:"e"` BaseEventId uint64 `json:"b"` Version uint64 `json:"v"` CommandId string `json:"c"` CommandType string `json:"t"` CommandRequest json.RawMessage `json:"r"` HandlerVersion string `json:"h"` CommandResponse json.RawMessage `json:"p"` State json.RawMessage `json:"s"` Delta json.RawMessage `json:"d"` CommittedAt int64 `json:"a"` }
type EventHandler ¶
type NumberedError ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.