bi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BIConfig

type BIConfig struct {
	MaxDashboards   int           `json:"max_dashboards"`
	MaxReports      int           `json:"max_reports"`
	MaxDatasets     int           `json:"max_datasets"`
	MaxQueries      int           `json:"max_queries"`
	DefaultCacheTTL time.Duration `json:"default_cache_ttl"`
	QueryTimeout    time.Duration `json:"query_timeout"`
	RefreshInterval time.Duration `json:"refresh_interval"`
	AutoRefresh     bool          `json:"auto_refresh"`
}

BIConfig represents configuration for the BI engine

type BIEngine

type BIEngine struct {
	// contains filtered or unexported fields
}

BIEngine provides business intelligence capabilities

func NewBIEngine

func NewBIEngine() *BIEngine

NewBIEngine creates a new business intelligence engine

func (*BIEngine) CreateDashboard

func (bi *BIEngine) CreateDashboard(ctx context.Context, dashboard *Dashboard) error

CreateDashboard creates a new dashboard

func (*BIEngine) CreateDataset

func (bi *BIEngine) CreateDataset(ctx context.Context, dataset *Dataset) error

CreateDataset creates a new dataset

func (*BIEngine) CreateQuery

func (bi *BIEngine) CreateQuery(ctx context.Context, query *Query) error

CreateQuery creates a new query

func (*BIEngine) CreateReport

func (bi *BIEngine) CreateReport(ctx context.Context, report *Report) error

CreateReport creates a new report

func (*BIEngine) ExecuteQuery

func (bi *BIEngine) ExecuteQuery(ctx context.Context, queryID string, parameters map[string]interface{}) (*QueryResult, error)

ExecuteQuery executes a query

func (*BIEngine) GetConfig

func (bi *BIEngine) GetConfig() *BIConfig

GetConfig returns the current BI engine configuration

func (*BIEngine) GetDashboard

func (bi *BIEngine) GetDashboard(ctx context.Context, dashboardID string) (*Dashboard, error)

GetDashboard retrieves a dashboard

func (*BIEngine) GetDataset

func (bi *BIEngine) GetDataset(ctx context.Context, datasetID string) (*Dataset, error)

GetDataset retrieves a dataset

func (*BIEngine) GetQuery

func (bi *BIEngine) GetQuery(ctx context.Context, queryID string) (*Query, error)

GetQuery retrieves a query

func (*BIEngine) GetReport

func (bi *BIEngine) GetReport(ctx context.Context, reportID string) (*Report, error)

GetReport retrieves a report

func (*BIEngine) ListDashboards

func (bi *BIEngine) ListDashboards(ctx context.Context) ([]*Dashboard, error)

ListDashboards lists all dashboards

func (*BIEngine) ListDatasets

func (bi *BIEngine) ListDatasets(ctx context.Context) ([]*Dataset, error)

ListDatasets lists all datasets

func (*BIEngine) ListQueries

func (bi *BIEngine) ListQueries(ctx context.Context) ([]*Query, error)

ListQueries lists all queries

func (*BIEngine) ListReports

func (bi *BIEngine) ListReports(ctx context.Context) ([]*Report, error)

ListReports lists all reports

func (*BIEngine) SetConfig

func (bi *BIEngine) SetConfig(config *BIConfig)

SetConfig updates the BI engine configuration

type BIService

type BIService struct {
	// contains filtered or unexported fields
}

BIService provides a unified interface for business intelligence operations

func NewBIService

func NewBIService() *BIService

NewBIService creates a new BI service

func (*BIService) CreateDashboard

func (bis *BIService) CreateDashboard(ctx context.Context, dashboard *Dashboard) error

CreateDashboard creates a new dashboard

func (*BIService) CreateDataset

func (bis *BIService) CreateDataset(ctx context.Context, dataset *Dataset) error

CreateDataset creates a new dataset

func (*BIService) CreateQuery

func (bis *BIService) CreateQuery(ctx context.Context, query *Query) error

CreateQuery creates a new query

func (*BIService) CreateReport

func (bis *BIService) CreateReport(ctx context.Context, report *Report) error

CreateReport creates a new report

func (*BIService) ExecuteQuery

func (bis *BIService) ExecuteQuery(ctx context.Context, queryID string, parameters map[string]interface{}) (*QueryResult, error)

ExecuteQuery executes a query

func (*BIService) ExportData

func (bis *BIService) ExportData(ctx context.Context, queryID string, format string, parameters map[string]interface{}) (*ExportResult, error)

ExportData exports data in various formats

func (*BIService) GenerateReport

func (bis *BIService) GenerateReport(ctx context.Context, reportID string, parameters map[string]interface{}) (*ReportResult, error)

GenerateReport generates a report

func (*BIService) GetBIEngine

func (s *BIService) GetBIEngine() *BIEngine

GetBIEngine returns the BI engine

func (*BIService) GetBIStatus

func (bis *BIService) GetBIStatus(ctx context.Context) (*BIStatus, error)

GetBIStatus returns the overall BI status

func (*BIService) GetConfig

func (bis *BIService) GetConfig() *BIServiceConfig

GetConfig returns the current BI service configuration

func (*BIService) GetExportEngine

func (s *BIService) GetExportEngine() *ExportEngine

GetExportEngine returns the export engine

func (*BIService) GetReportEngine

func (s *BIService) GetReportEngine() *ReportEngine

GetReportEngine returns the report engine

func (*BIService) SetConfig

func (bis *BIService) SetConfig(config *BIServiceConfig)

SetConfig updates the BI service configuration

func (*BIService) Start

func (bis *BIService) Start(ctx context.Context) error

Start starts the BI service

func (*BIService) Stop

func (bis *BIService) Stop(ctx context.Context) error

Stop stops the BI service

type BIServiceConfig

type BIServiceConfig struct {
	DashboardEnabled    bool          `json:"dashboard_enabled"`
	ReportEnabled       bool          `json:"report_enabled"`
	ExportEnabled       bool          `json:"export_enabled"`
	AutoRefresh         bool          `json:"auto_refresh"`
	RefreshInterval     time.Duration `json:"refresh_interval"`
	NotificationEnabled bool          `json:"notification_enabled"`
	AuditLogging        bool          `json:"audit_logging"`
}

BIServiceConfig represents configuration for the BI service

type BIStatus

type BIStatus struct {
	OverallStatus string                 `json:"overall_status"`
	Dashboards    map[string]int         `json:"dashboards"`
	Reports       map[string]int         `json:"reports"`
	Datasets      map[string]int         `json:"datasets"`
	Queries       map[string]int         `json:"queries"`
	LastRefresh   time.Time              `json:"last_refresh"`
	Metadata      map[string]interface{} `json:"metadata,omitempty"`
}

BIStatus represents the overall BI status

type Dashboard

type Dashboard struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Category    string                 `json:"category"`
	Widgets     []Widget               `json:"widgets"`
	Layout      DashboardLayout        `json:"layout"`
	Filters     []Filter               `json:"filters"`
	RefreshRate time.Duration          `json:"refresh_rate"`
	Public      bool                   `json:"public"`
	CreatedAt   time.Time              `json:"created_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

Dashboard represents a business intelligence dashboard

type DashboardLayout

type DashboardLayout struct {
	Columns int    `json:"columns"`
	Rows    int    `json:"rows"`
	Theme   string `json:"theme"`
}

DashboardLayout represents dashboard layout configuration

type Dataset

type Dataset struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Source      string                 `json:"source"`
	Type        string                 `json:"type"` // table, view, query, file
	Schema      map[string]interface{} `json:"schema"`
	RefreshRate time.Duration          `json:"refresh_rate"`
	LastRefresh time.Time              `json:"last_refresh"`
	Size        int64                  `json:"size"`
	CreatedAt   time.Time              `json:"created_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

Dataset represents a business intelligence dataset

type ExportConfig

type ExportConfig struct {
	MaxExporters        int           `json:"max_exporters"`
	DefaultTimeout      time.Duration `json:"default_timeout"`
	RetentionPeriod     time.Duration `json:"retention_period"`
	AutoCleanup         bool          `json:"auto_cleanup"`
	MaxFileSize         int64         `json:"max_file_size"`
	NotificationEnabled bool          `json:"notification_enabled"`
}

ExportConfig represents configuration for the export engine

type ExportEngine

type ExportEngine struct {
	// contains filtered or unexported fields
}

ExportEngine manages data export in various formats

func NewExportEngine

func NewExportEngine() *ExportEngine

NewExportEngine creates a new export engine

func (*ExportEngine) CreateExporter

func (ee *ExportEngine) CreateExporter(ctx context.Context, exporter *Exporter) error

CreateExporter creates a new data exporter

func (*ExportEngine) ExportData

func (ee *ExportEngine) ExportData(ctx context.Context, queryID string, format string, parameters map[string]interface{}) (*ExportResult, error)

ExportData exports data in the specified format

func (*ExportEngine) GetConfig

func (ee *ExportEngine) GetConfig() *ExportConfig

GetConfig returns the current export engine configuration

func (*ExportEngine) GetExporter

func (ee *ExportEngine) GetExporter(ctx context.Context, exporterID string) (*Exporter, error)

GetExporter retrieves a data exporter

func (*ExportEngine) GetFormatInfo

func (ee *ExportEngine) GetFormatInfo(ctx context.Context, format string) (*FormatInfo, error)

GetFormatInfo returns information about a specific export format

func (*ExportEngine) GetSupportedFormats

func (ee *ExportEngine) GetSupportedFormats(ctx context.Context) ([]string, error)

GetSupportedFormats returns the list of supported export formats

func (*ExportEngine) ListExporters

func (ee *ExportEngine) ListExporters(ctx context.Context) ([]*Exporter, error)

ListExporters lists all data exporters

func (*ExportEngine) SetConfig

func (ee *ExportEngine) SetConfig(config *ExportConfig)

SetConfig updates the export engine configuration

type ExportResult

type ExportResult struct {
	ID         string                 `json:"id"`
	QueryID    string                 `json:"query_id"`
	Format     string                 `json:"format"`
	Size       int64                  `json:"size"`
	Path       string                 `json:"path"`
	URL        string                 `json:"url,omitempty"`
	ExportedAt time.Time              `json:"exported_at"`
	Duration   time.Duration          `json:"duration"`
	Status     string                 `json:"status"` // success, failed, in_progress
	Error      string                 `json:"error,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

ExportResult represents the result of data export

type Exporter

type Exporter struct {
	ID        string                 `json:"id"`
	Name      string                 `json:"name"`
	Type      string                 `json:"type"` // csv, excel, json, xml, pdf
	Config    map[string]interface{} `json:"config"`
	Enabled   bool                   `json:"enabled"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
}

Exporter represents a data exporter

type Filter

type Filter struct {
	ID       string                 `json:"id"`
	Name     string                 `json:"name"`
	Type     string                 `json:"type"` // date, select, text, number, etc.
	Field    string                 `json:"field"`
	Options  []FilterOption         `json:"options,omitempty"`
	Default  interface{}            `json:"default,omitempty"`
	Required bool                   `json:"required"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Filter represents a dashboard filter

type FilterOption

type FilterOption struct {
	Label string      `json:"label"`
	Value interface{} `json:"value"`
}

FilterOption represents a filter option

type FormatInfo

type FormatInfo struct {
	Format      string                 `json:"format"`
	Description string                 `json:"description"`
	MimeType    string                 `json:"mime_type"`
	Extension   string                 `json:"extension"`
	MaxSize     int64                  `json:"max_size"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

FormatInfo represents information about an export format

type Query

type Query struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	SQL         string                 `json:"sql"`
	Parameters  []QueryParameter       `json:"parameters"`
	Cache       bool                   `json:"cache"`
	CacheTTL    time.Duration          `json:"cache_ttl"`
	CreatedAt   time.Time              `json:"created_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

Query represents a business intelligence query

type QueryParameter

type QueryParameter struct {
	Name        string      `json:"name"`
	Type        string      `json:"type"`
	Default     interface{} `json:"default,omitempty"`
	Required    bool        `json:"required"`
	Description string      `json:"description,omitempty"`
}

QueryParameter represents a query parameter

type QueryResult

type QueryResult struct {
	ID         string                 `json:"id"`
	QueryID    string                 `json:"query_id"`
	Columns    []string               `json:"columns"`
	Rows       [][]interface{}        `json:"rows"`
	RowCount   int                    `json:"row_count"`
	ExecutedAt time.Time              `json:"executed_at"`
	Duration   time.Duration          `json:"duration"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

QueryResult represents the result of a query execution

type Report

type Report struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Category    string                 `json:"category"`
	Type        string                 `json:"type"` // scheduled, on-demand, real-time
	Query       string                 `json:"query"`
	Format      string                 `json:"format"` // pdf, excel, csv, json
	Schedule    *ReportSchedule        `json:"schedule,omitempty"`
	Recipients  []string               `json:"recipients"`
	Parameters  map[string]interface{} `json:"parameters"`
	CreatedAt   time.Time              `json:"created_at"`
	UpdatedAt   time.Time              `json:"updated_at"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

Report represents a business intelligence report

type ReportConfig

type ReportConfig struct {
	MaxSchedules        int           `json:"max_schedules"`
	MaxGenerators       int           `json:"max_generators"`
	DefaultTimeout      time.Duration `json:"default_timeout"`
	RetentionPeriod     time.Duration `json:"retention_period"`
	AutoCleanup         bool          `json:"auto_cleanup"`
	NotificationEnabled bool          `json:"notification_enabled"`
}

ReportConfig represents configuration for the report engine

type ReportEngine

type ReportEngine struct {
	// contains filtered or unexported fields
}

ReportEngine manages report generation and scheduling

func NewReportEngine

func NewReportEngine() *ReportEngine

NewReportEngine creates a new report engine

func (*ReportEngine) CreateGenerator

func (re *ReportEngine) CreateGenerator(ctx context.Context, generator *ReportGenerator) error

CreateGenerator creates a new report generator

func (*ReportEngine) GenerateReport

func (re *ReportEngine) GenerateReport(ctx context.Context, reportID string, parameters map[string]interface{}) (*ReportResult, error)

GenerateReport generates a report

func (*ReportEngine) GetConfig

func (re *ReportEngine) GetConfig() *ReportConfig

GetConfig returns the current report engine configuration

func (*ReportEngine) GetGenerator

func (re *ReportEngine) GetGenerator(ctx context.Context, generatorID string) (*ReportGenerator, error)

GetGenerator retrieves a report generator

func (*ReportEngine) GetSchedule

func (re *ReportEngine) GetSchedule(ctx context.Context, reportID string) (*ReportSchedule, error)

GetSchedule retrieves a report schedule

func (*ReportEngine) ListGenerators

func (re *ReportEngine) ListGenerators(ctx context.Context) ([]*ReportGenerator, error)

ListGenerators lists all report generators

func (*ReportEngine) ListSchedules

func (re *ReportEngine) ListSchedules(ctx context.Context) (map[string]*ReportSchedule, error)

ListSchedules lists all report schedules

func (*ReportEngine) ScheduleReport

func (re *ReportEngine) ScheduleReport(ctx context.Context, reportID string, schedule *ReportSchedule) error

ScheduleReport schedules a report for generation

func (*ReportEngine) SetConfig

func (re *ReportEngine) SetConfig(config *ReportConfig)

SetConfig updates the report engine configuration

type ReportGenerator

type ReportGenerator struct {
	ID        string                 `json:"id"`
	Name      string                 `json:"name"`
	Type      string                 `json:"type"` // pdf, excel, csv, json, html
	Template  string                 `json:"template"`
	Config    map[string]interface{} `json:"config"`
	Enabled   bool                   `json:"enabled"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
}

ReportGenerator represents a report generator

type ReportResult

type ReportResult struct {
	ID          string                 `json:"id"`
	ReportID    string                 `json:"report_id"`
	Format      string                 `json:"format"`
	Size        int64                  `json:"size"`
	Path        string                 `json:"path"`
	URL         string                 `json:"url,omitempty"`
	GeneratedAt time.Time              `json:"generated_at"`
	Duration    time.Duration          `json:"duration"`
	Status      string                 `json:"status"` // success, failed, in_progress
	Error       string                 `json:"error,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

ReportResult represents the result of report generation

type ReportSchedule

type ReportSchedule struct {
	Frequency string    `json:"frequency"` // daily, weekly, monthly, custom
	Cron      string    `json:"cron,omitempty"`
	Time      time.Time `json:"time,omitempty"`
	Timezone  string    `json:"timezone"`
}

ReportSchedule represents report scheduling configuration

type Widget

type Widget struct {
	ID          string                 `json:"id"`
	Type        string                 `json:"type"` // chart, table, metric, text, etc.
	Title       string                 `json:"title"`
	Query       string                 `json:"query"`
	Config      map[string]interface{} `json:"config"`
	Position    WidgetPosition         `json:"position"`
	Size        WidgetSize             `json:"size"`
	RefreshRate time.Duration          `json:"refresh_rate"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

Widget represents a dashboard widget

type WidgetPosition

type WidgetPosition struct {
	X int `json:"x"`
	Y int `json:"y"`
}

WidgetPosition represents widget position on dashboard

type WidgetSize

type WidgetSize struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

WidgetSize represents widget size

Jump to

Keyboard shortcuts

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