analysis

package
v0.0.0-...-9337120 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ByDay    = "按天"
	ByMinute = "按分钟"
	ByHour   = "按小时"
	ByWeek   = "按周"
	Monthly  = "按月"
	ByTotal  = "合计"
)
View Source
const (
	Zhibiao = 1
	Formula = 2
)
View Source
const (
	TimeError           int = 60001
	ZhiBiaoNumError     int = 60002
	GroupNumError       int = 60003
	GroupEmptyError     int = 60004
	UIEmptyError        int = 60005
	EventNameEmptyError int = 60006
)

内置异常

View Source
const ChartSql int = 1
View Source
const TableSql int = 2

Variables

View Source
var ERROR_TABLE = map[int]string{
	TimeError:           "筛选时间异常",
	ZhiBiaoNumError:     "筛选指标个数异常",
	GroupNumError:       "筛选分组个数异常",
	GroupEmptyError:     "筛选分组不能为空字段",
	UIEmptyError:        "用户id列表不能为空",
	EventNameEmptyError: "事件名不能为空",
}

内置异常表

Functions

func ClearCacheByAppid

func ClearCacheByAppid(key string) (err error)

func GetAnalysisRes

func GetAnalysisRes(i Ianalysis) (res interface{}, err error)

Types

type AttributeName

type AttributeName struct {
	AttributeName string            `json:"attribute_name" db:"attribute_name"`
	ShowName      string            `json:"show_name" db:"show_name"`
	DataType      int               `json:"data_type" db:"data_type"`
	Analysis      map[string]string `json:"analysis" db:"-"`
}

type BehaviorAnalysisService

type BehaviorAnalysisService struct {
}

func (*BehaviorAnalysisService) GetConfigs

func (this *BehaviorAnalysisService) GetConfigs(appid int) (eventNameList []response.MetaEventListRes, attributeMap map[int][]response.AttributeRes, err error)

func (*BehaviorAnalysisService) GetValues

func (this *BehaviorAnalysisService) GetValues(appid string, table string, col string, reqData []byte) (values []ValueStruct, err error)

func (*BehaviorAnalysisService) LoadPropQuotas

func (this *BehaviorAnalysisService) LoadPropQuotas(reqData request.LoadPropQuotasReq) (attributeNameList []AttributeName, err error)

type Cache

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

func NewCache

func NewCache(overTime time.Duration, analysisType string, reqData []byte) *Cache

func (*Cache) LoadData

func (this *Cache) LoadData() (b []byte, err error)

func (*Cache) SetData

func (this *Cache) SetData(b []byte) (err error)

type Command

type Command int
const (
	FunnelComand               Command = 1
	RetentionComand            Command = 2
	TraceComand                Command = 3
	EventComand                Command = 4
	UserAttrCommand            Command = 5
	UserListCommand            Command = 6
	UserEventDetailListCommand Command = 7
	UserEventCountCommand      Command = 8
)

type Event

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

func (*Event) GetExecSql

func (this *Event) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*Event) GetFilterDateSql

func (this *Event) GetFilterDateSql() (SQL string, args []interface{})

func (*Event) GetGroupDateSql

func (this *Event) GetGroupDateSql() (groupSQL string, groupCol string)

func (*Event) GetGroupSql

func (this *Event) GetGroupSql() (groupSql []string, groupCol []string)

func (*Event) GetList

func (this *Event) GetList() (interface{}, error)

type Funnel

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

func (*Funnel) GetExecSql

func (this *Funnel) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*Funnel) GetList

func (this *Funnel) GetList() (interface{}, error)

type FunnelGroupRes

type FunnelGroupRes struct {
	Groupkey   sql.NullString `json:"groupkey" db:"groupkey"`
	LevelIndex int            `json:"level_index" db:"level_index"`
	UI         []string       `json:"ui" db:"ui"`
	Count      int            `json:"count" db:"count"`
}

type FunnelRes

type FunnelRes struct {
	LevelIndex int      `json:"level_index" db:"level_index"`
	Count      int      `json:"count" db:"count"`
	UI         []string `json:"ui" db:"ui"`
}

type Ianalysis

type Ianalysis interface {
	GetList() (interface{}, error)
	GetExecSql() (SQL string, allArgs []interface{}, err error) //后续开发  查看执行sql功能
}

func NewAnalysisByCommand

func NewAnalysisByCommand(command Command, reqData []byte) (i Ianalysis, err error)

func NewEvent

func NewEvent(reqData []byte) (Ianalysis, error)

func NewFunnel

func NewFunnel(reqData []byte) (Ianalysis, error)

func NewRetention

func NewRetention(reqData []byte) (Ianalysis, error)

func NewTrace

func NewTrace(reqData []byte) (Ianalysis, error)

func NewUserAttr

func NewUserAttr(reqData []byte) (Ianalysis, error)

func NewUserEventCountList

func NewUserEventCountList(reqData []byte) (Ianalysis, error)

func NewUserEventDetailList

func NewUserEventDetailList(reqData []byte) (Ianalysis, error)

func NewUserList

func NewUserList(reqData []byte) (Ianalysis, error)

type Retention

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

func (*Retention) GetExecSql

func (this *Retention) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*Retention) GetList

func (this *Retention) GetList() (interface{}, error)

type Trace

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

func (*Trace) GetChartSql

func (this *Trace) GetChartSql() (SQL string, allArgs []interface{}, err error)

func (*Trace) GetExecSql

func (this *Trace) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*Trace) GetList

func (this *Trace) GetList() (interface{}, error)

func (*Trace) GetTableSql

func (this *Trace) GetTableSql() (SQL string, allArgs []interface{}, err error)

type UserAttr

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

func (*UserAttr) GetExecSql

func (this *UserAttr) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*UserAttr) GetList

func (this *UserAttr) GetList() (interface{}, error)

func (*UserAttr) UserCountSql

func (this *UserAttr) UserCountSql() string

type UserEventCount

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

func (*UserEventCount) GetExecSql

func (this *UserEventCount) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*UserEventCount) GetGroupDateSql

func (this *UserEventCount) GetGroupDateSql() (groupSQL string, groupCol string)

func (*UserEventCount) GetList

func (this *UserEventCount) GetList() (interface{}, error)

type UserEventDetail

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

func (*UserEventDetail) GetExecSql

func (this *UserEventDetail) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*UserEventDetail) GetList

func (this *UserEventDetail) GetList() (interface{}, error)

type UserList

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

func (*UserList) GetExecSql

func (this *UserList) GetExecSql() (SQL string, allArgs []interface{}, err error)

func (*UserList) GetList

func (this *UserList) GetList() (interface{}, error)

type ValueStruct

type ValueStruct struct {
	Value interface{} `json:"value" db:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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