Documentation ¶
Index ¶
- Constants
- type Action
- type AlgoModelIndex
- type ApolloConfig
- func (this *ApolloConfig) GetApolloParam(experimentName, paramName, defaultParamValue string) (string, error)
- func (this *ApolloConfig) GetApolloParams(experimentName string) (map[string]string, error)
- func (this *ApolloConfig) GetDispatchExperimentName() string
- func (this *ApolloConfig) GetDispatchGroupName() (string, error)
- func (this *ApolloConfig) GetGroupName(experimentName string) (string, error)
- func (this *ApolloConfig) GetRawApolloParams(experimentName string) (map[string]interface{}, error)
- func (this *ApolloConfig) SetApolloUser(experimentName string, apolloUser *apolloModel.User)
- func (this *ApolloConfig) SetDispatchExperimentName(experimentName string)
- func (this *ApolloConfig) SetDispatchUser(apolloUser *apolloModel.User)
- type CenterServerReportResponseInfo
- type Dimension
- type DimensionIndex
- type DowngradeLevel
- type DowngradeStrategyInfo
- type ModuleResultInfo
- type OmegaInfo
- type RecallConfig
- type RecallRuleType
- type SceneModule
- type StrategyContext
- func (this *StrategyContext) AddTimeoutAction(actionName string)
- func (this *StrategyContext) AddToArray(arrayKey string, value interface{})
- func (this *StrategyContext) Get(key string) interface{}
- func (this *StrategyContext) GetArray(arrayKey string) ([]interface{}, error)
- func (this *StrategyContext) GetErrorMap() *sync.Map
- func (this *StrategyContext) GetModuleResultMap() *sync.Map
- func (this *StrategyContext) GetTimeoutActions() []string
- func (this *StrategyContext) IsSkip() bool
- func (this *StrategyContext) Set(key string, value interface{})
- func (this *StrategyContext) SetDebug(actionName string, key string, value interface{})
- func (this *StrategyContext) SetError(actionId string, err error)
- func (this *StrategyContext) SetModuleResult(actionId, actionName string, costTime int64)
- func (this *StrategyContext) Skip(errNo int32, errMsg string)
- type SystemConfigInfo
- type TraceInfo
- type Workflow
- type WorkflowChart
Constants ¶
View Source
const (
KEY_TIMEOUT_ACTION = "timeout_action"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgoModelIndex ¶
type AlgoModelIndex struct { IndexVersion string `json:"index_version"` IndexMap map[string][]string `json:"index_map"` UpdateTime time.Time `json:"updateTime"` }
算法模型配置索引
type ApolloConfig ¶
type ApolloConfig struct { ApolloUsers map[string]*apolloModel.User // contains filtered or unexported fields }
func NewApolloConfig ¶
func NewApolloConfig() *ApolloConfig
func (*ApolloConfig) GetApolloParam ¶
func (this *ApolloConfig) GetApolloParam(experimentName, paramName, defaultParamValue string) (string, error)
GetApolloParam 取指定实验的指定参数值,注意:此函数有可能由于缺省值的补漏而隐藏取参数值失败的错误, 已经弃用,建议自己采用 Apollo SDK 执行实验相关操作
func (*ApolloConfig) GetApolloParams ¶
func (this *ApolloConfig) GetApolloParams(experimentName string) (map[string]string, error)
GetApolloParams 取指定实验的全部参数并以map[string]string格式返回,如value不为string类型,则转为string 已经弃用,建议自己采用 Apollo SDK 执行实验相关操作
func (*ApolloConfig) GetDispatchExperimentName ¶
func (this *ApolloConfig) GetDispatchExperimentName() string
func (*ApolloConfig) GetDispatchGroupName ¶
func (this *ApolloConfig) GetDispatchGroupName() (string, error)
func (*ApolloConfig) GetGroupName ¶
func (this *ApolloConfig) GetGroupName(experimentName string) (string, error)
GetGroupName 已经弃用,建议自己采用 Apollo SDK 执行实验相关操作
func (*ApolloConfig) GetRawApolloParams ¶
func (this *ApolloConfig) GetRawApolloParams(experimentName string) (map[string]interface{}, error)
GetRawApolloParams 取指定实验的全部原始参数 已经弃用,建议自己采用 Apollo SDK 执行实验相关操作
func (*ApolloConfig) SetApolloUser ¶
func (this *ApolloConfig) SetApolloUser(experimentName string, apolloUser *apolloModel.User)
SetApolloUser 已经弃用,建议自己采用 Apollo SDK 执行实验相关操作
func (*ApolloConfig) SetDispatchExperimentName ¶
func (this *ApolloConfig) SetDispatchExperimentName(experimentName string)
SetDispatchExperimentName 设置分流实验名,如果分流实验名保存在数据库中,则不需要 SetDispatchExperimentName
func (*ApolloConfig) SetDispatchUser ¶
func (this *ApolloConfig) SetDispatchUser(apolloUser *apolloModel.User)
SetDispatchUser 设置分流 User
type CenterServerReportResponseInfo ¶
type CenterServerReportResponseInfo struct { ErrNo int32 `thrift:"err_no,1,required" json:"err_no"` ErrMsg string `thrift:"err_msg,2,required" json:"err_msg"` }
索引更新后,向center回报状态的返回结果:ErrNo=0,表示操作成功
type DimensionIndex ¶
type DowngradeLevel ¶
type DowngradeStrategyInfo ¶
type DowngradeStrategyInfo struct { LevelList []*DowngradeLevel `json:"levels"` SceneIds []int64 `json:"scene_ids"` UpdateTime time.Time }
type ModuleResultInfo ¶
type OmegaInfo ¶
type OmegaInfo struct { Bootstrap string `json:"boot_strap"` User string `json:"user"` Password string `json:"pass_word"` Topic string `json:"topic"` SceneId int64 `json:"scene_id"` EventId map[string]string `json:"event_id"` BuryData map[string]string `json:"bury_data"` IsCollectUserAction bool `json:"is_collect_user_action"` }
type RecallConfig ¶
type RecallConfig struct { Id int64 `json:"id"` SceneId int64 `json:"scene_id"` RecallRule []RecallRuleType `json:"recall_rule"` }
type RecallRuleType ¶
type SceneModule ¶
type SceneModule struct { Id int64 `json:"id"` Name string `json:"name"` AppId int64 `json:"appid"` BucketType int `json:"bucketType"` //第一层key:维度id;第二层key:0-99的数字;value:workflowid DimensionMap map[int64]map[int]int64 `json:"dimensionMap"` /**第一层key:moduleName,如:“bonus.BonusStrategyAwareStrengthen” 第二层key:参数组合,如:“[p1=2&p2=9]” 第三层key:参数名称,如:“p1” value:每个参数对应的值,支持string类型 */ ModuleInfoMap map[string]map[string]map[string]string `json:"moduleInfoMap"` UpdateTime time.Time `json:"updateTime"` FlowType int `json:"flow_type"` //第一层key:维度id;第二层key:manualSlotId;value:workflowid ManualSlotIdsMap map[int64]map[int64]int64 `json:"manualSlotIdsMap"` GroupWorkflowMap map[string]int64 `json:"groupWorkflowMap"` }
func (*SceneModule) GetWorkflowId ¶
func (this *SceneModule) GetWorkflowId(dispatchExperimentName, groupName string) (int64, error)
type StrategyContext ¶
type StrategyContext struct { AppId int64 AppName string SceneId int64 FlowId int64 IsLimited bool IsDebug bool CtxTrace *trace.DefaultTrace UserId string Phone string ContextMap *sync.Map ActionResultMap map[string]map[string]string ErrNo int32 ErrMsg string ApolloInfo *ApolloConfig // contains filtered or unexported fields }
func NewStrategyContext ¶
func NewStrategyContext(ctx context.Context) *StrategyContext
func (*StrategyContext) AddTimeoutAction ¶
func (this *StrategyContext) AddTimeoutAction(actionName string)
func (*StrategyContext) AddToArray ¶
func (this *StrategyContext) AddToArray(arrayKey string, value interface{})
func (*StrategyContext) Get ¶
func (this *StrategyContext) Get(key string) interface{}
func (*StrategyContext) GetArray ¶
func (this *StrategyContext) GetArray(arrayKey string) ([]interface{}, error)
func (*StrategyContext) GetErrorMap ¶
func (this *StrategyContext) GetErrorMap() *sync.Map
func (*StrategyContext) GetModuleResultMap ¶
func (this *StrategyContext) GetModuleResultMap() *sync.Map
func (*StrategyContext) GetTimeoutActions ¶
func (this *StrategyContext) GetTimeoutActions() []string
func (*StrategyContext) IsSkip ¶
func (this *StrategyContext) IsSkip() bool
func (*StrategyContext) Set ¶
func (this *StrategyContext) Set(key string, value interface{})
func (*StrategyContext) SetDebug ¶
func (this *StrategyContext) SetDebug(actionName string, key string, value interface{})
func (*StrategyContext) SetError ¶
func (this *StrategyContext) SetError(actionId string, err error)
func (*StrategyContext) SetModuleResult ¶
func (this *StrategyContext) SetModuleResult(actionId, actionName string, costTime int64)
func (*StrategyContext) Skip ¶
func (this *StrategyContext) Skip(errNo int32, errMsg string)
type SystemConfigInfo ¶
type TraceInfo ¶
type TraceInfo struct { TraceId string `thrift:"traceId,1,required" json:"traceId"` Caller string `thrift:"caller,2,required" json:"caller"` SpanId string `thrift:"spanId,3" json:"spanId,omitempty"` SrcMethod string `thrift:"srcMethod,4" json:"srcMethod,omitempty"` HintCode int64 `thrift:"hintCode,5" json:"hintCode,omitempty"` HintContent string `thrift:"hintContent,6" json:"hintContent,omitempty"` }
type Workflow ¶
type Workflow struct { Id int64 `json:"id"` DimensionId int64 `json:"dimensionId"` ExperimentId int64 `json:"experimentId"` ModulesArray [][]string `json:"modulesArray"` FlowChart *WorkflowChart `json:"flow_chart"` IsDefault int `json:"isDefault"` Range1 string `json:"range1"` Range2 string `json:"range2"` Remark string `json:"remark"` UpdateTime time.Time `json:"updateTime"` ManualSlotIds []int64 `json:"manual_slot_ids"` GroupName string `json:"group_name"` }
type WorkflowChart ¶
type WorkflowChart struct { FirstActionId string `json:"first_action_id"` ActionMap map[string]*Action `json:"actions"` ParamMap map[string]string `json:"params"` }
func NewWorkflowChart ¶
func NewWorkflowChart(flowChartStr string) (*WorkflowChart, error)
func (*WorkflowChart) CreateWaitMap ¶
func (this *WorkflowChart) CreateWaitMap() map[string]*sync.WaitGroup
Click to show internal directories.
Click to hide internal directories.