Documentation
¶
Index ¶
- Constants
- Variables
- func Events(dis edis.EventDispatcherInterface) *events
- func ParseDateRange(start, end string) (startDate, endDate time.Time, err error)
- func Random(min, max int, cb func(i, v int) bool)
- func RegisterFuncFactory(id string, factory ChartFuncFactory)
- type Chart
- func (c *Chart) Description() string
- func (c *Chart) Find(ctx *Context) (out *OutputChart, err error)
- func (c *Chart) GetInfo(infos ...ChartInfo) (label, description string)
- func (c *Chart) Label() string
- func (c *Chart) Option(key string) interface{}
- func (c *Chart) OptionMap(key string) map[string]interface{}
- func (c *Chart) String() string
- type ChartConfig
- type ChartFactory
- type ChartFuncFactory
- type ChartInfo
- type ChartRenderInfo
- type ChartReportEvent
- type ChartReportFactoryEvent
- type ChartReportsFactoryEvent
- type Charts
- func (c *Charts) AdminHandler(ctx *admin.Context)
- func (c *Charts) RegisterAdminRoutes(Admin *admin.Admin)
- func (c *Charts) RegisterFuncMaps(register func(string, interface{}))
- func (c *Charts) RegisterSiteRoutes(router *xroute.Mux)
- func (c *Charts) SiteHandler(w http.ResponseWriter, r *http.Request, rctx *xroute.RouteContext)
- type ChartsMap
- type Config
- type Context
- type FakeFinder
- type Finder
- type FinderFunc
- type FinderInfo
- type IntRange
- type OutputChart
- type OutputChartFactory
- func (f *OutputChartFactory) AdminFactory(context *admin.Context, startDate, endDate time.Time, chartsUID ...string) (result map[string]*OutputChart)
- func (f *OutputChartFactory) GetOrRegisterResource(res *admin.Resource) (rf *ResourceFactory)
- func (f *OutputChartFactory) LoadAdminResources(Admin *admin.Admin)
- func (f *OutputChartFactory) LoadFuncs()
- func (f *OutputChartFactory) RegisterFunc(cfg *ChartConfig) bool
- type Plugin
- type QueryFinder
- type Record
- type ResourceFactory
Constants ¶
View Source
const ( DEFAULT_CONFIG_DIR = "config/charts" URI = "/reports.json" )
Variables ¶
View Source
var ( E_REPORT_FACTORY = PKG + ".reportFactory" E_REPORTS_FACTORY = PKG + ".reportsFactory" )
View Source
var (
PKG = path_helpers.GetCalledDir()
)
Functions ¶
func Events ¶
func Events(dis edis.EventDispatcherInterface) *events
func ParseDateRange ¶
date format 2015-01-23
func RegisterFuncFactory ¶
func RegisterFuncFactory(id string, factory ChartFuncFactory)
Types ¶
type Chart ¶
type Chart struct { ChartFactory `json:"-"` ID string ChartLabel string ChartDescription string Config *ChartConfig IsSite bool AdminName string }
func NewChart ¶
func NewChart(cfg *ChartConfig, factory ChartFactory) *Chart
func (*Chart) Description ¶
type ChartConfig ¶
type ChartFactory ¶
type ChartFuncFactory ¶
type ChartRenderInfo ¶
type ChartReportEvent ¶
type ChartReportEvent struct { edis.EventInterface Context *Context }
type ChartReportFactoryEvent ¶
type ChartReportFactoryEvent struct { *ChartReportEvent Finder Finder }
func NewReportFactoryEvent ¶
func NewReportFactoryEvent(ctx *Context) *ChartReportFactoryEvent
type ChartReportsFactoryEvent ¶
type ChartReportsFactoryEvent struct { *ChartReportEvent Finder Finder }
type Charts ¶
type Charts struct {
Factory *OutputChartFactory
}
func (*Charts) AdminHandler ¶
func (*Charts) RegisterAdminRoutes ¶
func (*Charts) RegisterFuncMaps ¶
func (*Charts) RegisterSiteRoutes ¶
func (*Charts) SiteHandler ¶
func (c *Charts) SiteHandler(w http.ResponseWriter, r *http.Request, rctx *xroute.RouteContext)
type Config ¶
type Config struct { Uri struct { SiteUri string AdminUri string } Charts map[string]*ChartConfig }
func LoadConfigDir ¶
func LoadConfigFile ¶
func (*Config) LoadDefaults ¶
func (c *Config) LoadDefaults()
type FakeFinder ¶
type FinderFunc ¶
type FinderInfo ¶
func NewFinderInfo ¶
func NewFinderInfo(finder Finder, label, description string) FinderInfo
type IntRange ¶
type IntRange struct {
// contains filtered or unexported fields
}
range specification, note that min <= max
type OutputChart ¶
type OutputChartFactory ¶
type OutputChartFactory struct { Config *Config Resources map[string]map[string]*ResourceFactory Funcs map[string]ChartFuncFactory AdminCharts map[string]*ChartsMap SiteCharts ChartsMap }
func NewOutputChartFactory ¶
func NewOutputChartFactory(config *Config) (f *OutputChartFactory)
func (*OutputChartFactory) AdminFactory ¶
func (f *OutputChartFactory) AdminFactory(context *admin.Context, startDate, endDate time.Time, chartsUID ...string) (result map[string]*OutputChart)
func (*OutputChartFactory) GetOrRegisterResource ¶
func (f *OutputChartFactory) GetOrRegisterResource(res *admin.Resource) (rf *ResourceFactory)
func (*OutputChartFactory) LoadAdminResources ¶
func (f *OutputChartFactory) LoadAdminResources(Admin *admin.Admin)
func (*OutputChartFactory) LoadFuncs ¶
func (f *OutputChartFactory) LoadFuncs()
func (*OutputChartFactory) RegisterFunc ¶
func (f *OutputChartFactory) RegisterFunc(cfg *ChartConfig) bool
type Plugin ¶
type Plugin struct { admin_plugin.AdminNames plug.EventDispatcher ConfigDir string RouterKey string ChartsKey string // contains filtered or unexported fields }
func (*Plugin) OnRegister ¶
func (p *Plugin) OnRegister()
func (*Plugin) ProvideOptions ¶
func (*Plugin) RequireOptions ¶
type QueryFinder ¶
type ResourceFactory ¶
func (*ResourceFactory) RegisterChart ¶
func (f *ResourceFactory) RegisterChart(cfg *ChartConfig) *Chart
Source Files
¶
Click to show internal directories.
Click to hide internal directories.