engine

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTH_MODE_JWT     AuthMethod = "jwt"
	AUTH_MODE_CERT    AuthMethod = "cert"
	AUTH_MODE_DESKTOP AuthMethod = "desktop"

	ST_ON_PREM ServerType = "on_prem"
	ST_CLOUD   ServerType = "cloud"
)
View Source
const (
	RandomMethod   string = "random"
	HashAppMethod  string = "hash_app"
	HashUserMethod string = "hash_user"
	InMemAppMethod string = "in_mem_app"
)
View Source
const (
	MASTER_OBJECT string = "masterobject"
	STORY         string = "story"
	CONNECTION    string = "connection"

	ANY_LIST     string = "AnyList"
	SHEET_LIST   string = "AppObjectList"
	BM_LIST      string = "BookmarkList"
	DIM_LIST     string = "DimensionList"
	MEASURE_LIST string = "MeasureList"
	VAR_LIST     string = "VariableList"
)

Variables

View Source
var (
	GetObjMethods = map[string]string{
		"sheet":     "GetObject",
		"measure":   "GetMeasure",
		"dimension": "GetDimension",
		"variable":  "GetVariableById",
		"bookmark":  "GetBookmark",
	}
	CreateObjMethods = map[string]string{
		"sheet":     "CreateObjectRaw",
		"measure":   "CreateMeasureRaw",
		"dimension": "CreateDimensionRaw",
		"variable":  "CreateVariableExRaw",
		"bookmark":  "CreateBookmarkRaw",
	}
	DestroyObjMethods = map[string]string{
		"sheet":     "DestroyObject",
		"measure":   "DestroyMeasure",
		"dimension": "DestroyDimension",
		"variable":  "DestroyVariableById",
		"bookmark":  "DestroyBookmark",
	}

	ObjectListNameMap = map[string]string{
		"AppObjectList": "AppObject",
		"BookmarkList":  "Bookmark",
		"connection":    "Connection",
		"DimensionList": "Dimension",
		"masterobject":  "MasterObject",
		"MeasureList":   "Measure",
		"story":         "Story",
		"VariableList":  "Variable",
	}
)
View Source
var (
	SessionObjDef = []byte(`
	{
		"qInfo": {
			"qId": "",
			"qType": "SessionLists"
		},
		"qAppObjectListDef": {
			"qType": "sheet",
			"qData": {
				"id": "/qInfo/qId"
			}
		},
		"qDimensionListDef": {
			"qType": "dimension",
			"qData": {
				"id": "/qInfo/qId"
			}
		},
		"qMeasureListDef": {
			"qType": "measure",
			"qData": {
				"id": "/qInfo/qId"
			}
		},
		"qBookmarkListDef": {
			"qType": "bookmark",
			"qData": {
				"id": "/qInfo/qId"
			}
		},
		"qVariableListDef": {
			"qType": "variable",
			"qData": {
				"id": "/qInfo/qId"
			}
		}
	}
	`)

	SessionDimListDefData     = []byte(`{"qDim": "/qDim", "qDimInfos": "/qDimInfos"}`)
	SessionMeasureListDefData = []byte(`{"qMeasure": "/qMeasure"}`)
)
View Source
var (
	// ConnCtx is used for Engine requests per session/connection;
	ConnCtx context.Context
)
View Source
var (
	PAGE_MAX_CELLS int = 8192
)
View Source
var SessionBookmarkListDef = []byte(`
{
	"qInfo": {
		"qId": "BookmarkList",
		"qType": "BookmarkList"
	},
	"qBookmarkListDef": {
		"qType": "bookmark",
		"qData": {
			"sheetId": "/sheetId",
			"selectionFields": "/selectionFields",
			"creationDate": "/creationDate"
		}
	}
}
`)

Functions

func CapSize added in v0.5.1

func CapSize(sz *enigma.Size, cap enigma.Size)

func CreateChild

func CreateChild(doc *enigma.Doc, parentInfo enigma.NxInfo, prop json.RawMessage) (reflect.Value, error)

func CreateObject

func CreateObject(doc *enigma.Doc, qtype string, prop json.RawMessage) (reflect.Value, error)

func DestroyObject

func DestroyObject(doc *enigma.Doc, qtype string, qid string) (reflect.Value, error)

func FlattenObject added in v0.5.1

func FlattenObject[T any](obj *ObjWalkResult[T], m ListWalkResult[T])

func GetCurrentSelection

func GetCurrentSelection(doc *enigma.Doc, stateName string) (*enigma.SelectionObject, *util.Result)

func GetHyperCube added in v0.5.1

func GetHyperCube(obj *enigma.GenericObject, sz enigma.Size) (*enigma.HyperCube, *util.Result)

sz contains size cap when get hypercube data if sz.Cx or sz.Cy is greater than 0, it sets upper limit of column/row to get

func GetHyperCubeData

func GetHyperCubeData(obj *enigma.GenericObject, sz enigma.Size, pagingFuncs ...PagingMethod) ([]*enigma.NxDataPage, *util.Result)

func GetHyperCubePivotData

func GetHyperCubePivotData(obj *enigma.GenericObject, sz enigma.Size) ([]*enigma.NxPivotPage, *util.Result)

func GetListObject

func GetListObject(doc *enigma.Doc, stateName, fieldName string) (*enigma.ListObject, *util.Result)

func GetObject

func GetObject(doc *enigma.Doc, qtype string, qid string) (reflect.Value, error)

func GetTitle

func GetTitle(parentInfo *enigma.NxInfo, obj *ObjectPropeties, logger *zerolog.Logger) (*string, *string)

return title, description

func GetTitleEx

func GetTitleEx(obj enigma.GenericObject, objLayout ObjectLayoutEx) (*string, *string, *util.Result)

func HasMethodOn

func HasMethodOn(any reflect.Value, name string) bool

func HyperCubeDiff added in v0.7.5

func HyperCubeDiff(path string, from, to *enigma.HyperCube) (*util.Diff, *util.Result)

func Invoke

func Invoke(any interface{}, name string, args ...interface{}) (Results []reflect.Value, err error)

func Invoke1ErrOn

func Invoke1ErrOn(any reflect.Value, name string, args ...interface{}) error

func Invoke1Res1Err

func Invoke1Res1Err(any interface{}, name string, args ...interface{}) (Result reflect.Value, err error)

func Invoke1Res1ErrOn

func Invoke1Res1ErrOn(any reflect.Value, name string, args ...interface{}) (Result reflect.Value, err error)

func InvokeOn

func InvokeOn(any reflect.Value, name string, args ...interface{}) (Results []reflect.Value, err error)

func Paging

func Paging(rect enigma.Rect) []*enigma.NxPage

func PivotPaging

func PivotPaging(rect enigma.Rect) []*enigma.NxPage

func RecursiveCreateObject

func RecursiveCreateObject(doc *enigma.Doc, prop ObjectPropeties, parent *enigma.NxInfo) (*enigma.GenericObject, *util.Result)

func SetStringVariable

func SetStringVariable(doc *enigma.Doc, name string, value string) error

func SetVariable

func SetVariable(doc *enigma.Doc, name string, value string) error

Types

type AppLayoutMeta

type AppLayoutMeta struct {
	ID                  string                   `json:"id,omitempty"`
	CreatedDate         *string                  `json:"createdDate,omitempty"`
	ModifiedDate        string                   `json:"modifiedDate,omitempty"`
	Published           bool                     `json:"published"`
	PublishTime         string                   `json:"publishTime,omitempty"`
	Privileges          []string                 `json:"privileges,omitempty"`
	DynamicColor        string                   `json:"dynamicColor,omitempty"`
	Title               string                   `json:"qTitle,omitempty"`
	FileName            *string                  `json:"qFileName,omitempty"`
	LastReloadTime      string                   `json:"qLastReloadTime,omitempty"`
	Modified            bool                     `json:"qModified,omitempty"`
	HasScript           bool                     `json:"qHasScript,omitempty"`
	StateNames          []string                 `json:"qStateNames,omitempty"`
	Meta                *AppMeta                 `json:"qMeta,omitempty"`
	LocaleInfo          *enigma.LocaleInfo       `json:"qLocaleInfo,omitempty"`
	HasData             bool                     `json:"qHasData,omitempty"`
	ReadOnly            bool                     `json:"qReadOnly,omitempty"`
	IsOpenedWithoutData bool                     `json:"qIsOpenedWithoutData,omitempty"`
	IsSessionApp        bool                     `json:"qIsSessionApp,omitempty"`
	Thumbnail           *enigma.StaticContentUrl `json:"qThumbnail,omitempty"`
	IsBDILiveMode       bool                     `json:"qIsBDILiveMode,omitempty"`
	Prop                *enigma.NxAppProperties  `json:"qProp,omitempty"`
}

func (*AppLayoutMeta) RemoveVolatileFields added in v0.5.0

func (l *AppLayoutMeta) RemoveVolatileFields()

type AppMeta

type AppMeta struct {
	Name string                  `json:"qName,omitempty"`
	Prop *enigma.NxAppProperties `json:"qProp,omitempty"`
}

type AppObjectList

type AppObjectList struct {
	Items []*NxContainerEntry `json:"qItems,omitempty"`
}

type AppProperties added in v0.5.0

type AppProperties struct {
	CreatedDate  *string `json:"createdDate,omitempty"`
	ModifiedDate *string `json:"modifiedDate,omitempty"`
	enigma.NxAppProperties
}

func (*AppProperties) RemoveVolatileFields added in v0.5.0

func (p *AppProperties) RemoveVolatileFields()

type AppWalkResult added in v0.5.0

type AppWalkResult[T any] map[string]ListWalkResult[T] // listName => Objects Infos of list

func AppSnapshotDiff added in v0.5.1

func AppSnapshotDiff(from, to AppWalkResult[ObjectSnapshot]) (AppWalkResult[util.Diff], *util.Result)

func RecursiveGetSnapshots added in v0.5.0

func RecursiveGetSnapshots(doc *enigma.Doc, cfg MixedConfig, opts *WalkOptions, _logger *zerolog.Logger) (AppWalkResult[ObjectSnapshot], *util.Result)

func WalkApp added in v0.5.0

func WalkApp[T any](doc *enigma.Doc, cfg MixedConfig, opts *WalkOptions, walkers ListWalkFuncMap[T], _logger *zerolog.Logger) (AppWalkResult[T], *util.Result)

type AppWalker added in v0.5.0

type AppWalker[T any] struct {
	Walkers ListWalkFuncMap[T]
	Logger  *zerolog.Logger
}

func (*AppWalker[T]) Walk added in v0.5.0

func (w *AppWalker[T]) Walk(doc *enigma.Doc, cfg MixedConfig, opts *WalkOptions) (AppWalkResult[T], *util.Result)

func (*AppWalker[T]) WalkSheets added in v0.5.0

func (w *AppWalker[T]) WalkSheets(doc *enigma.Doc, cfg MixedConfig, opts *WalkOptions, walker ObjWalkFunc[T]) (AppWalkResult[T], *util.Result)

type AppsHealthInfo added in v0.7.5

type AppsHealthInfo struct {
	ActiveDocs   []string `json:"active_docs,omitempty" yaml:"active_docs,omitempty"`
	LoadedDocs   []string `json:"loaded_docs,omitempty" yaml:"loaded_docs,omitempty"`
	InMemoryDocs []string `json:"in_memory_docs,omitempty" yaml:"in_memory_docs,omitempty"`
	Calls        int64    `json:"calls" yaml:"calls"`
	Selections   int64    `json:"selections" yaml:"selections"`
}

type AuditLogEntry

type AuditLogEntry struct {
	ProductVersion    string            `csv:"ProductVersion"`
	Timestamp         AuditLogTimeStamp `csv:"Timestamp"`
	Hostname          string            `csv:"Hostname"`
	Id                string            `csv:"Id"`
	EngineTimestamp   AuditLogTimeStamp `csv:"EngineTimestamp"`
	EngineVersion     string            `csv:"EngineVersion"`
	Description       string            `csv:"Description"`
	ProxySessionId    string            `csv:"ProxySessionId"`
	ProxyPackageId    string            `csv:"ProxyPackageId"`
	RequestSequenceId string            `csv:"RequestSequenceId"`
	UserDirectory     string            `csv:"UserDirectory"`
	UserId            string            `csv:"UserId"`
	SessionId         string            `csv:"SessionId"`
	ObjectId          string            `csv:"ObjectId"`
	ObjectName        string            `csv:"ObjectName"`
	Service           string            `csv:"Service"`
	Origin            string            `csv:"Origin"`
	Context           string            `csv:"Context"`
	Command           string            `csv:"Command"`
	Result            string            `csv:"Result"`
	Message           string            `csv:"Message"`
	Id2               string            `csv:"Id2"`
}

func ReadAuditLogFile

func ReadAuditLogFile(file string) ([]AuditLogEntry, *util.Result)

type AuditLogTimeStamp

type AuditLogTimeStamp struct {
	time.Time
}

func (*AuditLogTimeStamp) UnmarshalCSV

func (date *AuditLogTimeStamp) UnmarshalCSV(csv string) (err error)

type AuthMethod

type AuthMethod string

type BookmarkEntry

type BookmarkEntry struct {
	Info *enigma.NxInfo  `json:"qInfo,omitempty"`
	Meta *BookmarkMeta   `json:"qMeta,omitempty"`
	Data json.RawMessage `json:"qData,omitempty"`
}

func GetBookmarks

func GetBookmarks(doc *enigma.Doc) ([]*BookmarkEntry, *util.Result)

type BookmarkList

type BookmarkList struct {
	Items []*NxContainerEntry `json:"qItems,omitempty"`
}

type BookmarkMeta

type BookmarkMeta struct {
	Title string `json:"title,omitempty"`
}

type CPUHealthInfo added in v0.7.5

type CPUHealthInfo struct {
	Total int `json:"total" yaml:"total"`
}

type CacheHealthInfo added in v0.7.5

type CacheHealthInfo struct {
	Hits       int64 `json:"hits" yaml:"hits"`
	Lookups    int64 `json:"lookups" yaml:"lookups"`
	Added      int64 `json:"added" yaml:"added"`
	Replaced   int64 `json:"replaced" yaml:"replaced"`
	BytesAdded int64 `json:"bytes_added" yaml:"bytes_added"`
}

type Cluster added in v0.7.3

type Cluster struct {
	Method string    `json:"method" yaml:"method"`
	Nodes  []*Config `json:"nodes" yaml:"nodes"`

	Logger *zerolog.Logger
	// contains filtered or unexported fields
}

func (Cluster) PickOneFor added in v0.7.3

func (c Cluster) PickOneFor(appid, uid string) *Config

type ColumnInfo

type ColumnInfo struct {
	FallbackTitle     string
	ApprMaxGlyphCount int
	NumFormat         *enigma.FieldAttributes
	AttrExprInfo      []*enigma.NxAttrExprInfo
	AttrDimInfo       []*enigma.NxAttrDimInfo
	Error             *enigma.NxValidationError
}

func NewColumnInfoFromDimension

func NewColumnInfoFromDimension(dim *enigma.NxDimensionInfo) *ColumnInfo

func NewColumnInfoFromMeasure

func NewColumnInfoFromMeasure(m *enigma.NxMeasureInfo) *ColumnInfo

type Config

type Config struct {
	EngineURI          string              `json:"engine_uri,omitempty" yaml:"engine_uri,omitempty" bson:"engine_uri,omitempty"`
	AppID              string              `json:"app_id,omitempty" yaml:"app_id,omitempty" bson:"app_id,omitempty"`
	QRSBaseURI         string              `json:"qrs_base_uri,omitempty" yaml:"qrs_base_uri,omitempty" bson:"qrs_base_uri,omitempty"` //if ServerType is ST_CLOUD, this field is base URL of the QCS tenant e.g. https://tenant.eu.qlikcloud.com
	HubURI             *HubUri             `json:"hub_uri,omitempty" yaml:"hub_uri,omitempty" bson:"hub_uri,omitempty"`
	SharedFolderRoot   *string             `json:"shared_folder_root,omitempty" yaml:"shared_folder_root,omitempty" bson:"shared_folder_root,omitempty"` //QSEoK shared folder which contains: `Apps`, `StaticContent` etc.
	UserName           string              `json:"user_id,omitempty" yaml:"user_id,omitempty" bson:"user_id,omitempty"`
	UserDirectory      string              `json:"user_directory,omitempty" yaml:"user_directory,omitempty" bson:"user_directory,omitempty"`
	AuthMode           AuthMethod          `json:"auth_mode,omitempty" yaml:"auth_mode,omitempty" bson:"auth_mode,omitempty"`
	ServerType         ServerType          `json:"server_type,omitempty" yaml:"server_type,omitempty" bson:"server_type,omitempty"`
	JWT                string              `json:"jwt,omitempty" yaml:"jwt,omitempty" bson:"jwt,omitempty"`
	Certs              crypto.Certificates `json:"certs,omitempty" yaml:"certs,omitempty" bson:"certs,omitempty"`
	RandomProxySession bool                `json:"random_proxy_session" yaml:"random_proxy_session" bson:"random_proxy_session"`

	Cookie http.CookieJar `json:"-" yaml:"-" bson:"-"` // used when connect to cloud
}

Config contains connection info used to make wss to Engine.

func (Config) GetAppUrl added in v0.5.2

func (c Config) GetAppUrl() (string, *util.Result)

func (Config) GetHttpsBaseUrl added in v0.7.5

func (cfg Config) GetHttpsBaseUrl() (*url.URL, *util.Result)

func (Config) IsCloud

func (cfg Config) IsCloud() bool

func (Config) IsDesktop

func (cfg Config) IsDesktop() bool

func (Config) IsOnPrem

func (cfg Config) IsOnPrem() bool

func (*Config) QCSEngineURIAppendAppID

func (cfg *Config) QCSEngineURIAppendAppID(appid string) *util.Result

type Conn

type Conn struct {
	Global *enigma.Global `json:"-"`
	Cfg    Config         `json:"config"`
}

Conn creates wss connection to Engine

func NewConn

func NewConn(cfg Config) (con *Conn, err error)

NewConn creates a Engine wss according to cfg.

func NewConnFromCluster added in v0.7.5

func NewConnFromCluster(c *Cluster, appId string) (*Conn, *util.Result)

func NewConnFromRAC added in v0.7.5

func NewConnFromRAC(c *rac.RestApiClient, appId string) (*Conn, *util.Result)

type ContainerChildInfo

type ContainerChildInfo struct {
	ContainerChildId string `json:"containerChildId,omitempty"`
	QExtendsId       string `json:"qExtendsId,omitempty"`
	ShowCondition    string `json:"showCondition,omitempty"`
	Title            string `json:"title,omitempty"`
	Visualization    string `json:"visualization,omitempty"`
}

type ContainerChildItem

type ContainerChildItem struct {
	Entry *enigma.NxContainerEntry
	Info  *ContainerChildInfo
}

type DimensionList

type DimensionList struct {
	Items []*NxContainerEntry `json:"qItems,omitempty"`
}

type FilterOptions added in v0.7.5

type FilterOptions struct {
	SheetBlackList  []string `json:"sheet_black_list,omitempty" yaml:"sheet_black_list"`
	ObjectBlackList []string `json:"object_black_list,omitempty" yaml:"object_black_list"`
	ObjectWhiteList []string `json:"object_white_list,omitempty" yaml:"object_white_list"`
	// contains filtered or unexported fields
}

func (*FilterOptions) BuildMap added in v0.7.5

func (f *FilterOptions) BuildMap()

func (*FilterOptions) IsObjectBlackListed added in v0.7.5

func (f *FilterOptions) IsObjectBlackListed(object string) bool

func (*FilterOptions) IsObjectWhiteListed added in v0.7.5

func (f *FilterOptions) IsObjectWhiteListed(object string) bool

func (*FilterOptions) IsSheetBlackListed added in v0.7.5

func (f *FilterOptions) IsSheetBlackListed(sheet string) bool

type HealthInfo added in v0.7.5

type HealthInfo struct {
	Version   string            `json:"version" yaml:"version"`
	Started   string            `json:"started" yaml:"started"`
	Mem       MemHealthInfo     `json:"mem" yaml:"mem"`
	Cpu       CPUHealthInfo     `json:"cpu" yaml:"cpu"`
	Session   SessionHealthInfo `json:"session" yaml:"session"`
	Apps      AppsHealthInfo    `json:"apps" yaml:"apps"`
	Users     UsersHealthInfo   `json:"users" yaml:"users"`
	Cache     CacheHealthInfo   `json:"cache" yaml:"cache"`
	Saturated bool              `json:"saturated" yaml:"saturated"`
}

type HttpClient added in v0.7.5

type HttpClient struct {
	BaseUrl      *url.URL
	ExtraHeaders http.Header
	Logger       *zerolog.Logger
	// contains filtered or unexported fields
}

func NewHttpClient added in v0.7.5

func NewHttpClient(cfg Config) (*HttpClient, *util.Result)

func (*HttpClient) Do added in v0.7.5

func (c *HttpClient) Do(method string, endpoint string, params map[string]string, body interface{}) ([]byte, *util.Result)

func (*HttpClient) DoRequest added in v0.7.5

func (c *HttpClient) DoRequest(req *http.Request) ([]byte, *util.Result)

func (*HttpClient) Get added in v0.7.5

func (c *HttpClient) Get(endpoint string, params map[string]string) ([]byte, *util.Result)

func (*HttpClient) GetHealthInfo added in v0.7.5

func (c *HttpClient) GetHealthInfo() (*HealthInfo, *util.Result)

func (*HttpClient) GetUrl added in v0.7.5

func (c *HttpClient) GetUrl(endpoint string) string

func (*HttpClient) NewRequest added in v0.7.5

func (c *HttpClient) NewRequest(method string, endpoint string, params map[string]string, body interface{}) (*http.Request, *util.Result)

type HubUri

type HubUri struct {
	Host     string `json:"host,omitempty" yaml:"host,omitempty" bson:"host,omitempty"`
	Port     int    `json:"port,omitempty" yaml:"port,omitempty" bson:"port,omitempty"`
	Prefix   string `json:"prefix,omitempty" yaml:"prefix,omitempty" bson:"prefix,omitempty"`
	IsSecure bool   `json:"isSecure,omitempty" yaml:"isSecure,omitempty" bson:"isSecure,omitempty"`
}

type ListWalkFuncMap added in v0.5.0

type ListWalkFuncMap[T any] map[string]ObjWalkFunc[T] // listName => ObjWalkFunc

type ListWalkResult added in v0.5.0

type ListWalkResult[T any] map[string]*ObjWalkResult[T] // objectId => Object Info

func FlattenList added in v0.5.1

func FlattenList[T any](list ListWalkResult[T]) ListWalkResult[T]

type MeasureList

type MeasureList struct {
	// Information about the list of measures.
	Items []*NxContainerEntry `json:"qItems,omitempty"`
}

type MemHealthInfo added in v0.7.5

type MemHealthInfo struct {
	Committed float64 `json:"committed" yaml:"committed"`
	Allocated float64 `json:"allocated" yaml:"allocated"`
	Free      float64 `json:"free" yaml:"free"`
}

type MixedConfig added in v0.7.5

type MixedConfig struct {
	AppId         string      `json:"app_id" yaml:"app_id" bson:"app_id"`
	OnPrem        *Config     `json:"on_prem,omitempty" yaml:"on_prem,omitempty" bson:"on_prem,omitempty"`
	OnPremCluster *Cluster    `json:"on_prem_cluster,omitempty" yaml:"on_prem_cluster,omitempty" bson:"on_prem_cluster,omitempty"`
	QCS           *rac.Config `json:"qcs,omitempty" yaml:"qcs,omitempty" bson:"qcs,omitempty"`
}

func (MixedConfig) Connect added in v0.7.5

func (mc MixedConfig) Connect() (*Conn, *util.Result)

type NxContainerEntry

type NxContainerEntry struct {
	Info *enigma.NxInfo  `json:"qInfo,omitempty"`
	Meta *NxMeta         `json:"qMeta,omitempty"`
	Data json.RawMessage `json:"qData,omitempty"`
}

func GetObjectList

func GetObjectList(doc *enigma.Doc, ctx context.Context, objType string) ([]*NxContainerEntry, error)

type NxMeta

type NxMeta struct {
	Title        *string  `json:"title,omitempty"`
	Description  *string  `json:"description,omitempty"`
	CreatedDate  *string  `json:"createdDate,omitempty"`
	ModifiedDate *string  `json:"modifiedDate,omitempty"`
	Published    bool     `json:"published,omitempty"`
	PublishTime  *string  `json:"publishTime,omitempty"`
	Privileges   []string `json:"privileges,omitempty"`
	Approved     bool     `json:"approved,omitempty"`
	DynamicColor *string  `json:"dynamicColor,omitempty"`
}

type ObjWalkEntry added in v0.7.0

type ObjWalkEntry struct {
	*WalkOptions

	Config    *MixedConfig
	AppId     *string
	Doc       *enigma.Doc
	Item      *NxContainerEntry
	SheetId   string
	SheetName string
	Info      *enigma.NxInfo
	Parent    *enigma.NxInfo
	Logger    *zerolog.Logger
}

type ObjWalkFunc added in v0.5.0

type ObjWalkFunc[T any] func(e ObjWalkEntry) (*ObjWalkResult[T], *util.Result)

func NewRecurObjWalkFunc added in v0.5.0

func NewRecurObjWalkFunc[T any](walker ObjWalkFunc[T]) ObjWalkFunc[T]

func NewRecurObjWalkFuncSync added in v0.7.5

func NewRecurObjWalkFuncSync[T any](walker ObjWalkFunc[T]) ObjWalkFunc[T]

type ObjWalkResult added in v0.5.0

type ObjWalkResult[T any] struct {
	SheetId      string              `json:"sheet_id" yaml:"sheet_id"`
	SheetName    string              `json:"sheet_name" yaml:"sheet_name"`
	ObjectTitle  *string             `json:"object_title" yaml:"object_title"`
	Info         *enigma.NxInfo      `json:"info,omitempty" yaml:"info,omitempty"`
	Parent       *enigma.NxInfo      `json:"parent,omitempty" yaml:"parent,omitempty"`
	Meta         *NxMeta             `json:"meta,omitempty" yaml:"meta,omitempty"`
	Result       *T                  `json:"result,omitempty" yaml:"result,omitempty"`
	ChildResults []*ObjWalkResult[T] `json:"child_results,omitempty" yaml:"child_results,omitempty"`
}

func ObjSnapshoter added in v0.5.1

func ObjSnapshoter(e ObjWalkEntry) (*ObjWalkResult[ObjectSnapshot], *util.Result)

func RecurWalkObject added in v0.5.0

func RecurWalkObject[T any](e ObjWalkEntry, walker ObjWalkFunc[T]) (*ObjWalkResult[T], *util.Result)

func RecurWalkObjectSync added in v0.7.5

func RecurWalkObjectSync[T any](e ObjWalkEntry, walker ObjWalkFunc[T]) (*ObjWalkResult[T], *util.Result)

type ObjWalker added in v0.5.0

type ObjWalker[T any] struct {
	Walker ObjWalkFunc[T]
	Entry  ObjWalkEntry
}

func (*ObjWalker[T]) Walk added in v0.5.0

func (w *ObjWalker[T]) Walk(doc *enigma.Doc, info *enigma.NxInfo) (*ObjWalkResult[T], *util.Result)

type ObjectChildEx

type ObjectChildEx struct {
	Id       string `json:"cId"`
	IsMaster bool   `json:"isMaster"`
	Label    string `json:"label"`
	RefId    string `json:"refId"`
}

type ObjectLayoutEx

type ObjectLayoutEx struct {
	enigma.GenericObjectLayout
	Children    []*ObjectChildEx    `json:"children"`
	Footnote    string              `json:"footnote"`
	Title       string              `json:"title"`
	Subtitle    string              `json:"subtitle"`
	Totals      *ObjectLayoutTotals `json:"totals,omitempty"`
	ColumnInfos []*ColumnInfo       `json:"-"`
}

func GetObjectLayoutEx

func GetObjectLayoutEx(obj *enigma.GenericObject) (*ObjectLayoutEx, *util.Result)

type ObjectLayoutTotals

type ObjectLayoutTotals struct {
	Label    string `json:"label,omitempty"`
	Position string `json:"position,omitempty"`
	Show     bool   `json:"show,omitempty"`
}

type ObjectPropeties

type ObjectPropeties struct {
	Info       *enigma.NxInfo     `json:"qInfo"`
	Meta       *NxMeta            `json:"qMeta"`
	Properties json.RawMessage    `json:"qProperties"`
	ChildInfos []*ObjectPropeties `json:"qChildInfos"`
}

func GetSheetsObjectProperties

func GetSheetsObjectProperties(doc *enigma.Doc) ([]*ObjectPropeties, *util.Result)

func RecursiveGetProperties

func RecursiveGetProperties(doc *enigma.Doc, entry NxContainerEntry) (*ObjectPropeties, error)

func (*ObjectPropeties) GetChild

func (p *ObjectPropeties) GetChild(id string) (*ObjectPropeties, bool)

func (*ObjectPropeties) RemoveVolatileFields added in v0.5.0

func (p *ObjectPropeties) RemoveVolatileFields()

type ObjectSnapshot added in v0.5.0

type ObjectSnapshot struct {
	Title       *string           `json:"title,omitempty"`
	Description *string           `json:"description,omitempty"`
	Properties  json.RawMessage   `json:"properties,omitempty"`
	HyperCube   *enigma.HyperCube `json:"hypercube,omitempty"`
	Digest      string            `json:"digest,omitempty"`
}

func (*ObjectSnapshot) Diff added in v0.5.1

func (from *ObjectSnapshot) Diff(to *ObjectSnapshot) (*util.Diff, *util.Result)

type PagingMethod added in v0.6.0

type PagingMethod func(rect enigma.Rect) []*enigma.NxPage

type ServerType

type ServerType string

type SessionBookmark

type SessionBookmark struct {
	Info            *enigma.NxInfo     `json:"qInfo,omitempty"`
	Meta            *NxMeta            `json:"qMeta,omitempty"`
	SheetId         string             `json:"sheetId,omitempty"`
	SelectionFields string             `json:"selectionFields,omitempty"`
	Bookmark        *enigma.NxBookmark `json:"qBookmark,omitempty"`
}

func GetSessionBookmarks

func GetSessionBookmarks(doc *enigma.Doc) ([]SessionBookmark, *util.Result)

type SessionDimensionData added in v0.4.0

type SessionDimensionData struct {
	Dim      *enigma.NxLibraryDimension     `json:"qDim,omitempty"`
	DimInfos []*enigma.GenericDimensionInfo `json:"qDimInfos,omitempty"`
	Title    *string                        `json:"qTitle,omitempty"`
}

type SessionDimensionLayout added in v0.4.0

type SessionDimensionLayout struct {
	Info     *enigma.NxInfo                 `json:"qInfo,omitempty"`
	Meta     *NxMeta                        `json:"qMeta,omitempty"`
	Dim      *enigma.NxLibraryDimension     `json:"qDim,omitempty"`
	DimInfos []*enigma.GenericDimensionInfo `json:"qDimInfos,omitempty"`
}

func GetDimensionList

func GetDimensionList(doc *enigma.Doc) ([]*SessionDimensionLayout, *util.Result)

type SessionHealthInfo added in v0.7.5

type SessionHealthInfo struct {
	Active int `json:"active" yaml:"active"`
	Total  int `json:"total" yaml:"total"`
}

type SessionMeasureData added in v0.4.0

type SessionMeasureData struct {
	Measure *enigma.NxLibraryMeasure `json:"qMeasure,omitempty"`
	Title   *string                  `json:"qTitle,omitempty"`
}

type SessionMeasureLayout added in v0.4.0

type SessionMeasureLayout struct {
	Info    *enigma.NxInfo           `json:"qInfo,omitempty"`
	Measure *enigma.NxLibraryMeasure `json:"qMeasure,omitempty"`
	Meta    *NxMeta                  `json:"qMeta,omitempty"`
}

func GetMeasureList added in v0.4.0

func GetMeasureList(doc *enigma.Doc) ([]*SessionMeasureLayout, *util.Result)

type SessionObjectLayout

type SessionObjectLayout struct {
	Info           *enigma.NxInfo          `json:"qInfo,omitempty"`
	Meta           *NxMeta                 `json:"qMeta,omitempty"`
	ExtendsId      string                  `json:"qExtendsId,omitempty"`
	HasSoftPatches bool                    `json:"qHasSoftPatches,omitempty"`
	Error          *enigma.NxLayoutErrors  `json:"qError,omitempty"`
	SelectionInfo  *enigma.NxSelectionInfo `json:"qSelectionInfo,omitempty"`
	StateName      string                  `json:"qStateName,omitempty"`

	AppObjectList *AppObjectList `json:"qAppObjectList,omitempty"`
	BookmarkList  *BookmarkList  `json:"qBookmarkList,omitempty"`
	DimensionList *DimensionList `json:"qDimensionList,omitempty"`
	MeasureList   *MeasureList   `json:"qMeasureList,omitempty"`
	VariableList  *VariableList  `json:"qVariableList,omitempty"`

	MediaList          *enigma.MediaList          `json:"qMediaList,omitempty"`
	NxLibraryDimension *enigma.NxLibraryDimension `json:"qNxLibraryDimension,omitempty"`
	NxLibraryMeasure   *enigma.NxLibraryMeasure   `json:"qNxLibraryMeasure,omitempty"`
	SelectionObject    *enigma.SelectionObject    `json:"qSelectionObject,omitempty"`
	StaticContentUrl   *enigma.StaticContentUrl   `json:"qStaticContentUrl,omitempty"`
	TreeData           *enigma.TreeData           `json:"qTreeData,omitempty"`
	UndoInfo           *enigma.UndoInfo           `json:"qUndoInfo,omitempty"`
	ChildList          *enigma.ChildList          `json:"qChildList,omitempty"`
	EmbeddedSnapshot   *enigma.EmbeddedSnapshot   `json:"qEmbeddedSnapshot,omitempty"`
	ExtensionList      *enigma.ExtensionList      `json:"qExtensionList,omitempty"`
	FieldList          *enigma.FieldList          `json:"qFieldList,omitempty"`
	HyperCube          *enigma.HyperCube          `json:"qHyperCube,omitempty"`
	ListObject         *enigma.ListObject         `json:"qListObject,omitempty"`
}

func GetSessionObjectLayout

func GetSessionObjectLayout(doc *enigma.Doc) (*SessionObjectLayout, *util.Result)

type UsersHealthInfo added in v0.7.5

type UsersHealthInfo struct {
	Active int `json:"active" yaml:"active"`
	Total  int `json:"total" yaml:"total"`
}

type VariableList

type VariableList struct {
	// List of the variables.
	Items []*NxContainerEntry `json:"qItems,omitempty"`
}

type WalkOptions added in v0.7.5

type WalkOptions struct {
	Sync           bool           `json:"sync" yaml:"sync"`
	MaxWorkers     int            `json:"max_workers" yaml:"max_workers"`
	IgnoreError    bool           `json:"ignore_error" yaml:"ignore_error"`
	OpendocRetries int            `json:"opendoc_retries" yaml:"opendoc_retries"`
	RetryDelay     int            `json:"retry_delay" yaml:"retry_delay"`
	Filter         *FilterOptions `json:"filter" yaml:"filter"`
}

func DefaultWalkOptions added in v0.7.5

func DefaultWalkOptions() *WalkOptions

func WalkOptionsForHuge added in v0.7.5

func WalkOptionsForHuge() *WalkOptions

Jump to

Keyboard shortcuts

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