Documentation
¶
Index ¶
- func AddService(sysConfig *types.SysConfig, serviceName string, serviceArea int32)
- func IsNil(any interface{}) bool
- func NewUuid() string
- func NewVNicConfig(maxDataSize uint64, txQueueSize, rxQueueSize uint64, vNetPort uint32) *types.SysConfig
- func SeekResource(path string, filename string) string
- type API
- type Action
- type IComparator
- type ICondition
- type IDatatListener
- type IElements
- type IExpression
- type IInfo
- type IIntrospector
- type ILogger
- type IMessage
- type IProperty
- type IQuery
- type IRegistry
- type IResources
- type ISecurityProvider
- type ISerializer
- type IServicePointHandler
- type IServicePoints
- type ITransaction
- type IVirtualNetworkInterface
- type LogLevel
- type Priority
- type SerializerMode
- type TransactionState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddService ¶
func NewVNicConfig ¶
func SeekResource ¶
Types ¶
type IComparator ¶
type ICondition ¶
type ICondition interface {
Comparator() IComparator
Operator() string
Next() ICondition
}
type IDatatListener ¶
type IDatatListener interface {
ShutdownVNic(IVirtualNetworkInterface)
HandleData([]byte, IVirtualNetworkInterface)
Failed([]byte, IVirtualNetworkInterface, string)
}
type IExpression ¶
type IExpression interface {
Condition() ICondition
Operator() string
Next() IExpression
Child() IExpression
}
type IInfo ¶
type IInfo interface {
Type() reflect.Type
Name() string
Serializer(SerializerMode) ISerializer
AddSerializer(ISerializer)
NewInstance() (interface{}, error)
}
type IIntrospector ¶
type IIntrospector interface {
Inspect(interface{}) (*types.RNode, error)
Node(string) (*types.RNode, bool)
NodeByType(p reflect.Type) (*types.RNode, bool)
NodeByTypeName(string) (*types.RNode, bool)
NodeByValue(interface{}) (*types.RNode, bool)
Nodes(bool, bool) []*types.RNode
Registry() IRegistry
Kind(*types.RNode) reflect.Kind
Clone(interface{}) interface{}
TableView(string) (*types.TableView, bool)
TableViews() []*types.TableView
}
type IMessage ¶
type IMessage interface {
Source() string
Vnet() string
Destination() string
ServiceArea() uint16
ServiceName() string
Sequence() uint32
Priority() Priority
Action() Action
SetAction(Action)
Timeout() uint16
Request() bool
Reply() bool
FailMessage() string
Data() string
SetData(string)
Tr() ITransaction
SetTr(transaction ITransaction)
}
type IQuery ¶
type IQuery interface {
RootType() *types.RNode
Properties() []IProperty
Criteria() IExpression
}
type IRegistry ¶
type IRegistry interface {
//Register - receive as an input an instance and register, extract the Type and register it.
Register(interface{}) (bool, error)
//RegisterType - receive a reflect.Type instance and register it.
RegisterType(reflect.Type) (bool, error)
//Info Retrieve the registered entry for this type.
Info(string) (IInfo, error)
//Register Enum string to int32 values
RegisterEnums(map[string]int32)
//Get int32 value of an enum
Enum(string) int32
}
IRegistry - Interface for encapsulating a Type registry service so a struct instance can be instantiated based on the type name.
type IResources ¶
type IResources interface {
Registry() IRegistry
ServicePoints() IServicePoints
Security() ISecurityProvider
DataListener() IDatatListener
Serializer(SerializerMode) ISerializer
Logger() ILogger
SysConfig() *types.SysConfig
Introspector() IIntrospector
AddService(string, int32)
}
type ISecurityProvider ¶
type ISecurityProvider interface {
CanDial(string, uint32) (net.Conn, error)
CanAccept(net.Conn) error
ValidateConnection(net.Conn, *types.SysConfig) error
Encrypt([]byte) (string, error)
Decrypt(string) ([]byte, error)
CanDoAction(Action, IElements, string, string, ...string) error
ScopeView(IElements, string, string, ...string) IElements
Authenticate(string, string, ...string) string
}
func LoadSecurityProvider ¶
func LoadSecurityProvider(soFileName string) (ISecurityProvider, error)
type ISerializer ¶
type IServicePointHandler ¶
type IServicePointHandler interface {
Post(IElements, IResources) IElements
Put(IElements, IResources) IElements
Patch(IElements, IResources) IElements
Delete(IElements, IResources) IElements
GetCopy(IElements, IResources) IElements
Get(IElements, IResources) IElements
Failed(IElements, IResources, IMessage) IElements
ServiceName() string
ServiceModel() IElements
EndPoint() string
Transactional() bool
ReplicationCount() int
ReplicationScore() int
}
type IServicePoints ¶
type IServicePoints interface {
// Register A Service Point, handler + service area
RegisterServicePoint(IServicePointHandler, uint16) error
// Handle a message and forward to the handler
Handle(IElements, Action, IVirtualNetworkInterface, IMessage, bool) IElements
// Handle a notification message, massage it to a change set and forward to the handler
Notify(IElements, IVirtualNetworkInterface, IMessage, bool) IElements
// Return the service point handler for the service name and area
ServicePointHandler(string, uint16) (IServicePointHandler, bool)
}
Add a bool for transaction
type ITransaction ¶
type ITransaction interface {
Id() string
State() TransactionState
SetState(TransactionState)
ErrorMessage() string
SetErrorMessage(string)
StartTime() int64
}
type IVirtualNetworkInterface ¶
type IVirtualNetworkInterface interface {
Start()
Shutdown()
Name() string
SendMessage([]byte) error
// Unicast a message without expecting response
Unicast(string, string, uint16, Action, interface{}) error
// Unicast a message expecting response
Request(string, string, uint16, Action, interface{}) IElements
// Reply to a Request
Reply(IMessage, IElements) error
// Multicast a message to all service name listeners, without expecting a response
Multicast(string, uint16, Action, interface{}) error
// Single a message to ONLY ONE service provider of the group,
// not expecting a response. Provider is chosen by residency to the requester.
Single(string, uint16, Action, interface{}) error
// SingleRequest same as single but expecting a response
SingleRequest(string, uint16, Action, interface{}) IElements
// Leader Same as SingleRequest but sending always to the leader.
Leader(string, uint16, Action, interface{}) IElements
Forward(IMessage, string) IElements
API(string, uint16) API
Resources() IResources
}
type SerializerMode ¶
type SerializerMode int
const ( BINARY SerializerMode = 1 JSON SerializerMode = 2 STRING SerializerMode = 3 )
type TransactionState ¶
type TransactionState uint8
const ( Create TransactionState = 1 Created TransactionState = 2 Start TransactionState = 3 Lock TransactionState = 4 Locked TransactionState = 5 LockFailed TransactionState = 6 Commit TransactionState = 7 Commited TransactionState = 8 Rollback TransactionState = 9 Rollbacked TransactionState = 10 Finish TransactionState = 11 Finished TransactionState = 12 Errored TransactionState = 13 )
func (TransactionState) String ¶
func (t TransactionState) String() string
Click to show internal directories.
Click to hide internal directories.