Documentation ¶
Index ¶
- Constants
- func ContextWithoutRetries(ctx context.Context) context.Context
- func NewTopicsHandler(channel chan enigma.SessionMessage) *topicsHandler
- type Cache
- type ErrWarn
- type FieldCache
- type HyperCube
- type ITrafficLogger
- type NoSessionOnConnectError
- type ObjChild
- type Object
- func (obj *Object) ChildList() *enigma.ChildList
- func (obj *Object) Close() error
- func (obj *Object) ExternalReferenceApps() []string
- func (obj *Object) HasDims() bool
- func (obj *Object) HyperCube() *HyperCube
- func (obj *Object) HyperCubeDataPages() []*enigma.NxDataPage
- func (obj *Object) HyperCubeStackPages() []*enigma.NxStackPage
- func (obj *Object) HyperPivotPages() []*enigma.NxPivotPage
- func (obj *Object) ListObject() *enigma.ListObject
- func (obj *Object) ListObjectDataPages() []*enigma.NxDataPage
- func (obj *Object) Properties() *enigma.GenericObjectProperties
- func (obj *Object) RegisterCloseFunc(f func() error)
- func (obj *Object) SetChildList(children *enigma.ChildList)
- func (obj *Object) SetChildren(children *[]ObjChild)
- func (obj *Object) SetHyperCube(hypercube *enigma.HyperCube)
- func (obj *Object) SetHyperCubeDataPages(datapages []*enigma.NxDataPage, binned bool) error
- func (obj *Object) SetListObject(listobject *enigma.ListObject)
- func (obj *Object) SetListObjectDataPages(datapages []*enigma.NxDataPage) error
- func (obj *Object) SetPivotHyperCubePages(datapages []*enigma.NxPivotPage) error
- func (obj *Object) SetProperties(properties *enigma.GenericObjectProperties)
- func (obj *Object) SetStackHyperCubePages(datapages []*enigma.NxStackPage) error
- func (obj *Object) SetTreeDataPages(treeDataPages []*enigma.NxTreeNode) error
- type ObjectIDNotFound
- type ObjectNotFound
- type ObjectType
- type ObjectsMap
- func (o *ObjectsMap) AddObject(obj *Object) error
- func (o *ObjectsMap) AddObjectLink(baseHandle, linkedHandle int)
- func (o *ObjectsMap) ClearObject(handle int) error
- func (o *ObjectsMap) ClearObjects(handles []int) error
- func (o *ObjectsMap) ClearObjectsOfType(t ObjectType) ([]int, error)
- func (o *ObjectsMap) ForEach(fe func(obj *Object) error) error
- func (o *ObjectsMap) ForEachWithLock(fe func(obj *Object) error) error
- func (o *ObjectsMap) GetAllObjectHandles(lock bool, t ObjectType) []int
- func (o *ObjectsMap) GetObject(handle int) (*Object, error)
- func (o *ObjectsMap) GetObjectByID(id string) (*Object, error)
- func (o *ObjectsMap) GetObjectLink(baseHandle int) int
- func (o *ObjectsMap) GetObjectsOfType(typ ObjectType) []*Object
- func (o *ObjectsMap) Len() int
- func (o *ObjectsMap) Load(handle int) *Object
- func (o *ObjectsMap) RemoveObject(handle int) error
- func (o *ObjectsMap) RemoveObjectLink(baseHandle int)
- func (o *ObjectsMap) Store(handle int, object *Object)
- type OnAuthenticationInformation
- type OnConnected
- type SenseConnection
- type SenseDialer
- type SenseUplink
- func (uplink *SenseUplink) AddNewObject(handle int, t ObjectType, id string, enigmaobject interface{}) (*Object, error)
- func (uplink *SenseUplink) Connect(ctx context.Context, url string, headers http.Header, cookieJar http.CookieJar, ...) error
- func (uplink *SenseUplink) Disconnect()
- func (uplink *SenseUplink) IsConnected() bool
- func (uplink *SenseUplink) LogMetric(invocation *enigma.Invocation, metrics *enigma.InvocationMetrics, ...)
- func (uplink *SenseUplink) OnUnexpectedDisconnect(f func())
- func (uplink *SenseUplink) SetCurrentApp(appGUID string, doc *enigma.Doc) error
- type TrafficLogger
- type TrafficRequestCounter
- func (tl *TrafficRequestCounter) Closed()
- func (tl *TrafficRequestCounter) Opened()
- func (tl *TrafficRequestCounter) Received(message []byte)
- func (tl *TrafficRequestCounter) RequestCount() uint64
- func (tl *TrafficRequestCounter) ResetRequestCount()
- func (tl *TrafficRequestCounter) Sent(message []byte)
- type VarCache
Constants ¶
const (
//MaxRetries when engine aborts request
MaxRetries = 3
)
const (
// SenseWsType defines websocket type, used for logging purposes
SenseWsType = "SenseWebsocket"
)
Variables ¶
This section is empty.
Functions ¶
func ContextWithoutRetries ¶ added in v0.14.12
ContextWithoutRetries creates a new context which disables retires for aborted ws requests.
func NewTopicsHandler ¶ added in v0.16.5
func NewTopicsHandler(channel chan enigma.SessionMessage) *topicsHandler
NewTopicsHandler handles pusched topics on message channel
Types ¶
type Cache ¶ added in v0.5.8
type Cache struct { Field FieldCache Var VarCache }
type ErrWarn ¶
type ErrWarn struct {
// contains filtered or unexported fields
}
ErrWarn keeps track of errors and warnings within action + total
func (*ErrWarn) TotWarnings ¶
TotWarnings report total warnings count
type FieldCache ¶ added in v0.5.8
type FieldCache struct {
// contains filtered or unexported fields
}
FieldCache
func NewFieldCache ¶ added in v0.5.8
func NewFieldCache() FieldCache
func (*FieldCache) Lookup ¶ added in v0.5.8
func (fc *FieldCache) Lookup(name string) (field *enigma.Field, hit bool)
func (*FieldCache) Store ¶ added in v0.5.8
func (fc *FieldCache) Store(name string, field *enigma.Field)
type HyperCube ¶
type HyperCube struct { *enigma.HyperCube Binned bool }
HyperCube wrapping enigma hypercube with additional if binned or not
type ITrafficLogger ¶
type ITrafficLogger interface { enigma.TrafficLogger RequestCount() uint64 ResetRequestCount() }
ITrafficLogger interface for traffic logger
type NoSessionOnConnectError ¶ added in v0.17.0
type NoSessionOnConnectError struct{}
func (NoSessionOnConnectError) Error ¶ added in v0.17.0
func (err NoSessionOnConnectError) Error() string
Error to be returned on reconnect without session attached
type Object ¶
type Object struct { // Handle of sense object Handle int // ID of object ID string // Type of object Type ObjectType // EnigmaObject enigma object instance EnigmaObject interface{} // contains filtered or unexported fields }
Object sense object handler
func NewObject ¶
func NewObject(handle int, t ObjectType, id string, enigmaobject interface{}) *Object
NewObject container for enigma object
func (*Object) ChildList ¶
func (obj *Object) ChildList() *enigma.ChildList
ChildList child objects of object
func (*Object) ExternalReferenceApps ¶
Get all apps from ExternalReference
func (*Object) HyperCubeDataPages ¶
func (obj *Object) HyperCubeDataPages() []*enigma.NxDataPage
HyperCubeDataPages from object hypercube
func (*Object) HyperCubeStackPages ¶
func (obj *Object) HyperCubeStackPages() []*enigma.NxStackPage
HyperCubeStackPages from object hypercube
func (*Object) HyperPivotPages ¶
func (obj *Object) HyperPivotPages() []*enigma.NxPivotPage
HyperPivotPages from object hypercube
func (*Object) ListObjectDataPages ¶
func (obj *Object) ListObjectDataPages() []*enigma.NxDataPage
ListObjectDataPages from object listobject
func (*Object) Properties ¶
func (obj *Object) Properties() *enigma.GenericObjectProperties
Properties get object properties
func (*Object) RegisterCloseFunc ¶
RegisterCloseFunc register function to be executed on object close
func (*Object) SetChildList ¶
func (obj *Object) SetChildList(children *enigma.ChildList)
SetChildList set object childlist
func (*Object) SetChildren ¶
SetChildren set object children
func (*Object) SetHyperCube ¶
func (obj *Object) SetHyperCube(hypercube *enigma.HyperCube)
SetHyperCube of object
func (*Object) SetHyperCubeDataPages ¶
SetHyperCubeDataPages on object hypercube
func (*Object) SetListObject ¶
func (obj *Object) SetListObject(listobject *enigma.ListObject)
SetListObject of object
func (*Object) SetListObjectDataPages ¶
SetListObjectDataPages on object listobject
func (*Object) SetPivotHyperCubePages ¶
SetPivotHyperCubePages on object hypercube
func (*Object) SetProperties ¶
func (obj *Object) SetProperties(properties *enigma.GenericObjectProperties)
SetProperties set/update properties of object
func (*Object) SetStackHyperCubePages ¶
SetStackHyperCubePages on object hypercube
func (*Object) SetTreeDataPages ¶ added in v0.6.26
SetTreeDataPages on object
type ObjectIDNotFound ¶
type ObjectIDNotFound string
ObjectIDNotFound error
func (ObjectIDNotFound) Error ¶
func (onf ObjectIDNotFound) Error() string
type ObjectNotFound ¶
type ObjectNotFound int
ObjectNotFound error
func (ObjectNotFound) Error ¶
func (onf ObjectNotFound) Error() string
type ObjectType ¶
type ObjectType int
ObjectType type of enigma object
const ( // ObjTypeApp object is an app ObjTypeApp ObjectType = iota // ObjTypeSheet object is a sheet ObjTypeSheet // ObjTypeGenericObject object is sheet object ObjTypeGenericObject )
type ObjectsMap ¶
type ObjectsMap struct {
// contains filtered or unexported fields
}
ObjectsMap currently subscribed objects
func (*ObjectsMap) AddObject ¶
func (o *ObjectsMap) AddObject(obj *Object) error
AddObject to object list
func (*ObjectsMap) AddObjectLink ¶
func (o *ObjectsMap) AddObjectLink(baseHandle, linkedHandle int)
AddObjectLink link object and sessionobject, to be used for e.g. auto-charts
func (*ObjectsMap) ClearObject ¶
func (o *ObjectsMap) ClearObject(handle int) error
ClearObject remove object from list
func (*ObjectsMap) ClearObjects ¶
func (o *ObjectsMap) ClearObjects(handles []int) error
ClearObjects remove all objects in list
func (*ObjectsMap) ClearObjectsOfType ¶
func (o *ObjectsMap) ClearObjectsOfType(t ObjectType) ([]int, error)
ClearObjectsOfType remove all objects of type from list
func (*ObjectsMap) ForEach ¶
func (o *ObjectsMap) ForEach(fe func(obj *Object) error) error
ForEach Perform function on each object
func (*ObjectsMap) ForEachWithLock ¶
func (o *ObjectsMap) ForEachWithLock(fe func(obj *Object) error) error
ForEachWithLock Perform function on each object and lock map during loop, don't combine lock with any other locking function
func (*ObjectsMap) GetAllObjectHandles ¶
func (o *ObjectsMap) GetAllObjectHandles(lock bool, t ObjectType) []int
GetAllObjectHandles returns a slice of the handles present in the ObjectsMap
func (*ObjectsMap) GetObject ¶
func (o *ObjectsMap) GetObject(handle int) (*Object, error)
GetObject get object from object list
func (*ObjectsMap) GetObjectByID ¶
func (o *ObjectsMap) GetObjectByID(id string) (*Object, error)
GetObjectByID get object by id or ObjectIDNotFound error
func (*ObjectsMap) GetObjectLink ¶
func (o *ObjectsMap) GetObjectLink(baseHandle int) int
GetObjectLink get linked object handle, defaults to 0 if not found
func (*ObjectsMap) GetObjectsOfType ¶
func (o *ObjectsMap) GetObjectsOfType(typ ObjectType) []*Object
GetObjectsOfType get all objects of type
func (*ObjectsMap) Len ¶ added in v0.5.7
func (o *ObjectsMap) Len() int
Len locks objects map and gets current length
func (*ObjectsMap) RemoveObject ¶
func (o *ObjectsMap) RemoveObject(handle int) error
RemoveObject from object list
func (*ObjectsMap) RemoveObjectLink ¶
func (o *ObjectsMap) RemoveObjectLink(baseHandle int)
RemoveObjectLink for handle
func (*ObjectsMap) Store ¶
func (o *ObjectsMap) Store(handle int, object *Object)
Store object with handle
type OnAuthenticationInformation ¶
type OnAuthenticationInformation struct { // MustAuthenticate tells us if we are authenticated MustAuthenticate bool `json:"mustAuthenticate"` }
OnAuthenticationInformation content structure of OnAuthenticationInformation event
type OnConnected ¶
type OnConnected struct { // SessionState received session state, possible states listed as constants in constant.EventTopicOnConnected* SessionState string `json:"qSessionState"` }
OnConnected content structure of EventTopicOnConnected event
type SenseConnection ¶
type SenseConnection struct {
*SenseUplink
}
SenseConnection direct sense connection implementing IConnection interface
func (*SenseConnection) Disconnect ¶
func (connection *SenseConnection) Disconnect() error
Disconnect uplink
func (*SenseConnection) Sense ¶
func (connection *SenseConnection) Sense() *SenseUplink
Sense implements IConnection interface
func (*SenseConnection) SetSense ¶
func (connection *SenseConnection) SetSense(uplink *SenseUplink)
SetSense implements IConnection interface
type SenseDialer ¶
SenseDialer glue between net.Conn and enigma.Socket implementing required methods
type SenseUplink ¶
type SenseUplink struct { Global *enigma.Global CurrentApp *senseobjects.App Objects ObjectsMap FieldCache FieldCache VarCache VarCache Traffic ITrafficLogger MaxFrameSize int64 MockMode bool // contains filtered or unexported fields }
SenseUplink handle sense connection for a user
func NewSenseUplink ¶
func NewSenseUplink(ctx context.Context, logentry *logger.LogEntry, metrics *requestmetrics.RequestMetrics, trafficLogger ITrafficLogger, maxFrameSize int64) *SenseUplink
NewSenseUplink SenseUplink constructor
func (*SenseUplink) AddNewObject ¶
func (uplink *SenseUplink) AddNewObject(handle int, t ObjectType, id string, enigmaobject interface{}) (*Object, error)
AddNewObject to object list
func (*SenseUplink) Connect ¶
func (uplink *SenseUplink) Connect(ctx context.Context, url string, headers http.Header, cookieJar http.CookieJar, allowUntrusted bool, timeout time.Duration, reconnect bool) error
Connect connect to sense environment
func (*SenseUplink) Disconnect ¶
func (uplink *SenseUplink) Disconnect()
Disconnect Sense connection
func (*SenseUplink) IsConnected ¶ added in v0.16.5
func (uplink *SenseUplink) IsConnected() bool
IsConnected returns true if uplink is live
func (*SenseUplink) LogMetric ¶
func (uplink *SenseUplink) LogMetric(invocation *enigma.Invocation, metrics *enigma.InvocationMetrics, result *enigma.InvocationResponse)
LogMetric async log metric, this is injected into the enigma dialer and is responsible for recording message sent and received times, these times are used to record response times both for individual requests and entire actions
func (*SenseUplink) OnUnexpectedDisconnect ¶
func (uplink *SenseUplink) OnUnexpectedDisconnect(f func())
OnUnexpectedDisconnect registers an function to be executed on unexpected disconnect
func (*SenseUplink) SetCurrentApp ¶ added in v0.5.7
func (uplink *SenseUplink) SetCurrentApp(appGUID string, doc *enigma.Doc) error
type TrafficLogger ¶
type TrafficLogger struct { LogEntry *logger.LogEntry Requests *atomichandlers.AtomicCounter Counters *statistics.ExecutionCounters }
trafficLogger implementation of enigma.trafficLogger interface
func NewTrafficLogger ¶
func NewTrafficLogger(logEntry *logger.LogEntry, counters *statistics.ExecutionCounters) *TrafficLogger
NewTrafficLogger create new instance of traffic logger with default values
func (*TrafficLogger) Received ¶
func (tl *TrafficLogger) Received(message []byte)
Received message received on socket
func (*TrafficLogger) RequestCount ¶
func (tl *TrafficLogger) RequestCount() uint64
RequestCount get current request count
func (*TrafficLogger) ResetRequestCount ¶
func (tl *TrafficLogger) ResetRequestCount()
ResetRequestCount reset current request count
func (*TrafficLogger) Sent ¶
func (tl *TrafficLogger) Sent(message []byte)
Sent message sent on socket
type TrafficRequestCounter ¶
type TrafficRequestCounter struct { Requests *atomichandlers.AtomicCounter Counters *statistics.ExecutionCounters }
TrafficRequestCounter implementation of enigma.trafficLogger interface
func NewTrafficRequestCounter ¶
func NewTrafficRequestCounter(counters *statistics.ExecutionCounters) *TrafficRequestCounter
NewTrafficRequestCounter create new instance of traffic request counter
func (*TrafficRequestCounter) Closed ¶
func (tl *TrafficRequestCounter) Closed()
Closed implements trafficLogger interface
func (*TrafficRequestCounter) Opened ¶
func (tl *TrafficRequestCounter) Opened()
Opened implements trafficLogger interface
func (*TrafficRequestCounter) Received ¶
func (tl *TrafficRequestCounter) Received(message []byte)
Received implements trafficLogger interface
func (*TrafficRequestCounter) RequestCount ¶
func (tl *TrafficRequestCounter) RequestCount() uint64
RequestCount get current request count
func (*TrafficRequestCounter) ResetRequestCount ¶
func (tl *TrafficRequestCounter) ResetRequestCount()
ResetRequestCount reset current request count
func (*TrafficRequestCounter) Sent ¶
func (tl *TrafficRequestCounter) Sent(message []byte)
Sent count sent requests