Documentation ¶
Index ¶
- Variables
- type AggrCacheDest
- type CacheWrap
- type FCacheAggregateRelation
- type FCacheKeyPro
- type FCacheRawByAggr
- type ICacheDecoder
- type ICacheObjDest
- type Service
- func (s *Service) Add(c context.Context, opt *model.AddOption) (err error)
- func (s *Service) AddBizCFG(c context.Context, b *business.BizCFG) (lastid int64, err error)
- func (s *Service) AddBusiness(c context.Context, b *business.Business) (id int64, err error)
- func (s *Service) AddConfig(c context.Context, config *task.Config, confJSON interface{}) (err error)
- func (s *Service) AddDirection(c context.Context, uid int64, d *net.DirEditParam) (id int64, err error, msg string)
- func (s *Service) AddFlow(c context.Context, uid int64, f *net.FlowEditParam) (id int64, err error, msg string)
- func (s *Service) AddNet(c context.Context, n *net.Net) (id int64, err error, msg string)
- func (s *Service) AddToken(c context.Context, t *net.Token) (id int64, err error, msg string)
- func (s *Service) AddTransition(c context.Context, uid int64, f *net.TransitionEditParam) (id int64, err error, msg string)
- func (s *Service) AttributeCFG(c context.Context, bizid int64) (attrcfg map[string]uint, err error)
- func (s *Service) Auth(c context.Context, uid int64) (a *model.Auth, err error)
- func (s *Service) BatchSubmit(c context.Context, opt *model.BatchOption) (tip *model.Tip, err error)
- func (s *Service) Business(c context.Context, b *business.Business) (res *business.Business, err error)
- func (s *Service) BusinessList(c context.Context, businessID []int64, onlyEnable bool) (res []*business.Business, err error)
- func (s *Service) Cache() map[string]interface{}
- func (s *Service) Cancel(c context.Context, businessID int64, oids []string, uid int64, username string) (err error)
- func (s *Service) CancelByOper(c context.Context, businessID int64, oids []string, uid int64, username string) (err error)
- func (s *Service) CheckResource(c context.Context, opt *model.AddOption) (rid int64, err error)
- func (s *Service) Close()
- func (s *Service) Debug() string
- func (s *Service) Delay(c context.Context, opt *taskmod.DelayOptions) (err error)
- func (s *Service) DeleteConfig(c context.Context, id int64) (err error)
- func (s *Service) FetchJumpFlowInfo(c context.Context, flowID int64) (res *net.JumpInfo, err error)
- func (s *Service) FlushRole(c context.Context, BizID, flowID int64, uids []int64) (err error)
- func (s *Service) GetDirectionList(c context.Context, pm *net.ListDirectionParam) (result *net.ListDirectionRes, err error)
- func (s *Service) GetFlowByNet(c context.Context, netID int64) (result map[int64]string, err error)
- func (s *Service) GetFlowList(c context.Context, pm *net.ListNetElementParam) (result *net.ListFlowRes, err error)
- func (s *Service) GetMiddlewareCache(bizid int64) []*middleware.Aggregate
- func (s *Service) GetNetByBusiness(c context.Context, businessID int64) (res map[int64]string, err error)
- func (s *Service) GetNetList(c context.Context, pm *net.ListNetParam) (result *net.ListNetRes, err error)
- func (s *Service) GetRole(c context.Context, opt *common.BaseOptions) (uname string, role int8, err error)
- func (s *Service) GetRoleBiz(c context.Context, uid int64, role string, noAdmin bool) (businessID []int64, err error)
- func (s *Service) GetTaskBizFlows(c context.Context, uid int64) (businessID []int64, flows []int64, err error)
- func (s *Service) GetTokenList(c context.Context, pm *net.ListTokenParam) (result *net.ListTokenRes, err error)
- func (s *Service) GetTranByNet(c context.Context, netID int64) (result map[int64]string, err error)
- func (s *Service) GetTransitionList(c context.Context, pm *net.ListNetElementParam) (result *net.ListTransitionRes, err error)
- func (s *Service) Gray(opt *model.AddOption) (next bool)
- func (s *Service) InfoResource(c context.Context, opt *common.BaseOptions) (info *model.AuditInfo, err error)
- func (s *Service) InfoTask(c context.Context, opt *common.BaseOptions, taskid int64) (info *model.AuditInfo, err error)
- func (s *Service) IsAdmin(uid int64) bool
- func (s *Service) IsOn(c context.Context, opt *common.BaseOptions) bool
- func (s *Service) JumpFlow(c context.Context, opt *model.SubmitOptions) (err error)
- func (s *Service) KickOut(c context.Context, opt *common.BaseOptions, kickuid int64) (err error)
- func (s *Service) ListBizCFGs(c context.Context, bizid int64) (res []*business.BizCFG, err error)
- func (s *Service) ListBizFlow(c context.Context, tp int8, bizID []int64, flowID []int64) (list []*business.BizItem, err error)
- func (s *Service) ListByResource(c context.Context, arg *model.SearchParams) (columns []*model.Column, list []*model.ListRscItem, op []*net.TranOperation, ...)
- func (s *Service) ListByTask(c context.Context, opt *taskmod.ListOptions) (list []*model.ListTaskItem, err error)
- func (s *Service) ListTasks(c context.Context, opt *taskmod.ListOptions) (tasks []*taskmod.Task, count int64, err error)
- func (s *Service) MaxWeight(c context.Context, opt *common.BaseOptions) (max int64, err error)
- func (s *Service) MemberStats(c context.Context, bizid, flowid int64, uids []int64) (res map[int64][]interface{}, err error)
- func (s *Service) MonitorBuzResult(c context.Context, bid int64) (res []*monitor.RuleResultData, err error)
- func (s *Service) MonitorResultOids(c context.Context, rid int64) (res map[int64]int, err error)
- func (s *Service) NetSVG(c context.Context, netid int64) (nv *svg.NetView, err error)
- func (s *Service) Next(c context.Context, opt *taskmod.NextOptions) (infos []*model.AuditInfo, err error)
- func (s *Service) NextTask(c context.Context, opt *taskmod.NextOptions) (tasks []*taskmod.Task, count int64, err error)
- func (s *Service) Off(c context.Context, opt *common.BaseOptions) (err error)
- func (s *Service) On(c context.Context, opt *common.BaseOptions) (err error)
- func (s *Service) Ping(c context.Context) (err error)
- func (s *Service) QueryConfigs(c context.Context, queryParams *task.QueryParams) (ls []*task.Config, count int64, err error)
- func (s *Service) Release(c context.Context, opt *common.BaseOptions, delay bool) (rows int64, err error)
- func (s *Service) ReportTaskSubmit(c context.Context, pm *model.OptReportSubmit) (res *model.ReportSubmitRes, err error)
- func (s *Service) ReportTaskflow(c context.Context, opt *model.OptReport) (res map[string][]*model.ReportFlowItem, ...)
- func (s *Service) ReserveCFG(c context.Context, bizid int64) (rsvcfg map[string]interface{}, err error)
- func (s *Service) ResourceRes(c context.Context, args *resource.Args) (res *resource.Res, err error)
- func (s *Service) SearchAuditLog(c context.Context, pm *model.SearchAuditLogParam) (res []*model.SearchAuditLog, p common.Pager, err error)
- func (s *Service) SearchAuditLogCSV(c context.Context, pm *model.SearchAuditLogParam) (csv [][]string, err error)
- func (s *Service) SetBusinessState(c context.Context, b *business.Business) (err error)
- func (s *Service) SetStateConfig(c context.Context, id int64, state int8) (err error)
- func (s *Service) ShowDirection(c context.Context, id int64) (r *net.ShowDirectionResult, err error)
- func (s *Service) ShowFlow(c context.Context, id int64) (r *net.ShowFlowResult, err error)
- func (s *Service) ShowNet(c context.Context, id int64) (r *net.Net, err error)
- func (s *Service) ShowToken(c context.Context, id int64) (n *net.Token, err error)
- func (s *Service) ShowTransition(c context.Context, id int64) (r *net.ShowTransitionResult, err error)
- func (s *Service) Submit(c context.Context, opt *model.SubmitOptions) (err error)
- func (s *Service) SwitchDirection(c context.Context, id int64, needDisable bool) (err error, msg string)
- func (s *Service) SwitchFlow(c context.Context, id int64, needDisable bool) (err error)
- func (s *Service) SwitchNet(c context.Context, id int64, needDisable bool) (err error)
- func (s *Service) SwitchTransition(c context.Context, id int64, needDisable bool) (err error)
- func (s *Service) Task(c context.Context, tid int64) (task *taskmod.Task, err error)
- func (s *Service) TaskStat(c context.Context, opt *common.BaseOptions) (stat *taskmod.Stat, err error)
- func (s *Service) TokenByName(c context.Context, businessID int64, name string) (result map[string]string, err error)
- func (s *Service) TokenGroupByType(c context.Context, netID int64) (result map[string][]*net.Token, err error)
- func (s *Service) TrackResource(c context.Context, pm *model.TrackParam) (res *model.TrackInfo, p common.Pager, err error)
- func (s *Service) TxAddResource(ormTx *gorm.DB, b *resource.Resource, r *resource.Result) (rid int64, err error)
- func (s *Service) TxDelResource(c context.Context, ormTx *gorm.DB, bizid int64, rids []int64) (delState int, err error)
- func (s *Service) TxSubmitTask(c context.Context, ormTx *gorm.DB, opt *common.BaseOptions, state int8) (ostate int8, otaskid, ouid int64, err error)
- func (s *Service) TxUpdateResource(tx *gorm.DB, rid int64, res map[string]interface{}, rscRes *resource.Result) (err error)
- func (s *Service) UnDoStat(c context.Context, opt *common.BaseOptions) (stat *taskmod.UnDOStat, err error)
- func (s *Service) Update(c context.Context, opt *model.UpdateOption) (err error)
- func (s *Service) UpdateBizCFG(c context.Context, b *business.BizCFG) (err error)
- func (s *Service) UpdateBusiness(c context.Context, b *business.Business) (err error)
- func (s *Service) UpdateConfig(c context.Context, config *task.Config) (err error)
- func (s *Service) UpdateDirection(c context.Context, uid int64, d *net.DirEditParam) (err error, msg string)
- func (s *Service) UpdateFlow(c context.Context, uid int64, f *net.FlowEditParam) (err error, msg string)
- func (s *Service) UpdateNet(c context.Context, uid int64, n *net.NetEditParam) (err error, msg string)
- func (s *Service) UpdateTransition(c context.Context, uid int64, f *net.TransitionEditParam) (err error, msg string)
- func (s *Service) Upload(c context.Context, fileName string, fileType string, timing int64, body []byte) (location string, err error)
- func (s *Service) Watcher(c context.Context, bizid, flowid int64, role int8) (watchers []*task.WatchItem, err error)
- func (s *Service) WeightLog(c context.Context, taskid int64, pn, ps int) (ls []*model.WeightLog, count int, err error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrTaskMiss = errors.New("task miss")
)
ERROR
Functions ¶
This section is empty.
Types ¶
type AggrCacheDest ¶
type AggrCacheDest struct { Dest map[int64][]int64 GetKey FCacheKeyPro AggrRelaRaw FCacheAggregateRelation }
AggrCacheDest 聚合缓存
func (*AggrCacheDest) AppendRelationRaw ¶
func (a *AggrCacheDest) AppendRelationRaw(c context.Context, miss []int64, kopt []interface{}, opt ...interface{}) (missCache map[string]string, err error)
AppendRelationRaw 根据聚合字段值,从db获取聚合字段与对象id的关联
func (*AggrCacheDest) AppendString ¶
func (a *AggrCacheDest) AppendString(id int64, v string) (ok bool, err error)
AppendString 实现ICacheDecoder接口
type CacheWrap ¶
type CacheWrap struct { ObjDest ICacheObjDest //对象集合 AggrObjRaw FCacheRawByAggr //根据聚合字段获取对象集合from db AggregateDest *AggrCacheDest //对象的某个聚合字段与对象id的集合 }
CacheWrap 以net对象为例子,可以根据business_id字段聚合
type FCacheAggregateRelation ¶
type FCacheAggregateRelation func(c context.Context, miss []int64, kopt []interface{}, opt ...interface{}) (rela map[int64][]int64, err error)
FCacheAggregateRelation db获取聚合字段和对象id的关联
type FCacheKeyPro ¶
FCacheKeyPro 根据id获取key
type FCacheRawByAggr ¶
type FCacheRawByAggr func(c context.Context, miss []int64, objDest ICacheObjDest, kopt []interface{}, opt ...interface{}) (objCache map[string]string, aggrRelation map[int64][]int64, err error)
FCacheRawByAggr db根据聚合值,获取对象集合和关联
type ICacheDecoder ¶
type ICacheDecoder interface { //--get from cache, to decode & append to dest, && check null AppendString(id int64, v string) (ok bool, err error) }
ICacheDecoder 解析字符串
type ICacheObjDest ¶
type ICacheObjDest interface { //GetKey 获取对象缓存的key GetKey(id int64, opt ...interface{}) (k []string) //AppendString--v is from cache, to decode & append to dest, && check null AppendString(id int64, v string) (ok bool, err error) //AppendRaw--get from db, to encode & append to dest & to convert to string AppendRaw(c context.Context, s *Service, miss []int64, kopt []interface{}, opt ...interface{}) (missCache map[string]string, err error) }
ICacheObjDest 对象缓存接口
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct
func (*Service) AddBusiness ¶
AddBusiness .
func (*Service) AddConfig ¶
func (s *Service) AddConfig(c context.Context, config *task.Config, confJSON interface{}) (err error)
AddConfig .
func (*Service) AddDirection ¶
func (s *Service) AddDirection(c context.Context, uid int64, d *net.DirEditParam) (id int64, err error, msg string)
AddDirection .
func (*Service) AddFlow ¶
func (s *Service) AddFlow(c context.Context, uid int64, f *net.FlowEditParam) (id int64, err error, msg string)
AddFlow .
func (*Service) AddTransition ¶
func (s *Service) AddTransition(c context.Context, uid int64, f *net.TransitionEditParam) (id int64, err error, msg string)
AddTransition .
func (*Service) AttributeCFG ¶
AttributeCFG 属性位配置
func (*Service) BatchSubmit ¶
func (s *Service) BatchSubmit(c context.Context, opt *model.BatchOption) (tip *model.Tip, err error)
BatchSubmit 批量提交, 超过10个的做异步
func (*Service) Business ¶
func (s *Service) Business(c context.Context, b *business.Business) (res *business.Business, err error)
Business .
func (*Service) BusinessList ¶
func (s *Service) BusinessList(c context.Context, businessID []int64, onlyEnable bool) (res []*business.Business, err error)
BusinessList .
func (*Service) Cancel ¶
func (s *Service) Cancel(c context.Context, businessID int64, oids []string, uid int64, username string) (err error)
Cancel 取消相关资源的所有流程
func (*Service) CancelByOper ¶
func (s *Service) CancelByOper(c context.Context, businessID int64, oids []string, uid int64, username string) (err error)
CancelByOper 手动删除任务
func (*Service) CheckResource ¶
CheckResource .
func (*Service) DeleteConfig ¶
DeleteConfig .
func (*Service) FetchJumpFlowInfo ¶
FetchJumpFlowInfo .. * 跳流程详情页, 跳流程是单独db层面的更新 * 参数:flowid(可选) * 获取网下所有flow和变迁的所有操作项
func (*Service) GetDirectionList ¶
func (s *Service) GetDirectionList(c context.Context, pm *net.ListDirectionParam) (result *net.ListDirectionRes, err error)
GetDirectionList .
func (*Service) GetFlowByNet ¶
GetFlowByNet .
func (*Service) GetFlowList ¶
func (s *Service) GetFlowList(c context.Context, pm *net.ListNetElementParam) (result *net.ListFlowRes, err error)
GetFlowList .
func (*Service) GetMiddlewareCache ¶
func (s *Service) GetMiddlewareCache(bizid int64) []*middleware.Aggregate
GetMiddlewareCache get cache by bizid
func (*Service) GetNetByBusiness ¶
func (s *Service) GetNetByBusiness(c context.Context, businessID int64) (res map[int64]string, err error)
GetNetByBusiness .
func (*Service) GetNetList ¶
func (s *Service) GetNetList(c context.Context, pm *net.ListNetParam) (result *net.ListNetRes, err error)
GetNetList .
func (*Service) GetRole ¶
func (s *Service) GetRole(c context.Context, opt *common.BaseOptions) (uname string, role int8, err error)
GetRole .
func (*Service) GetRoleBiz ¶
func (s *Service) GetRoleBiz(c context.Context, uid int64, role string, noAdmin bool) (businessID []int64, err error)
GetRoleBiz uid能查看哪些业务
func (*Service) GetTaskBizFlows ¶
func (s *Service) GetTaskBizFlows(c context.Context, uid int64) (businessID []int64, flows []int64, err error)
GetTaskBizFlows uid能查看哪些任务节点
func (*Service) GetTokenList ¶
func (s *Service) GetTokenList(c context.Context, pm *net.ListTokenParam) (result *net.ListTokenRes, err error)
GetTokenList .
func (*Service) GetTranByNet ¶
GetTranByNet .
func (*Service) GetTransitionList ¶
func (s *Service) GetTransitionList(c context.Context, pm *net.ListNetElementParam) (result *net.ListTransitionRes, err error)
GetTransitionList .
func (*Service) InfoResource ¶
func (s *Service) InfoResource(c context.Context, opt *common.BaseOptions) (info *model.AuditInfo, err error)
InfoResource .
func (*Service) InfoTask ¶
func (s *Service) InfoTask(c context.Context, opt *common.BaseOptions, taskid int64) (info *model.AuditInfo, err error)
InfoTask .
func (*Service) ListBizCFGs ¶
ListBizCFGs .
func (*Service) ListBizFlow ¶
func (s *Service) ListBizFlow(c context.Context, tp int8, bizID []int64, flowID []int64) (list []*business.BizItem, err error)
ListBizFlow .
func (*Service) ListByResource ¶
func (s *Service) ListByResource(c context.Context, arg *model.SearchParams) (columns []*model.Column, list []*model.ListRscItem, op []*net.TranOperation, err error)
ListByResource 资源列表
func (*Service) ListByTask ¶
func (s *Service) ListByTask(c context.Context, opt *taskmod.ListOptions) (list []*model.ListTaskItem, err error)
ListByTask 任务列表
func (*Service) ListTasks ¶
func (s *Service) ListTasks(c context.Context, opt *taskmod.ListOptions) (tasks []*taskmod.Task, count int64, err error)
ListTasks 实时列表,停滞列表,延迟列表
func (*Service) MemberStats ¶
func (s *Service) MemberStats(c context.Context, bizid, flowid int64, uids []int64) (res map[int64][]interface{}, err error)
MemberStats . 统计个人24h 处理量 处理率 通过率 平均耗时
func (*Service) MonitorBuzResult ¶
func (s *Service) MonitorBuzResult(c context.Context, bid int64) (res []*monitor.RuleResultData, err error)
MonitorBuzResult 获取业务的监控结果
func (*Service) MonitorResultOids ¶
MonitorResultOids 获取
func (*Service) Next ¶
func (s *Service) Next(c context.Context, opt *taskmod.NextOptions) (infos []*model.AuditInfo, err error)
Next reveive next auditing task
func (*Service) NextTask ¶
func (s *Service) NextTask(c context.Context, opt *taskmod.NextOptions) (tasks []*taskmod.Task, count int64, err error)
NextTask 下一个任务
func (*Service) QueryConfigs ¶
func (s *Service) QueryConfigs(c context.Context, queryParams *task.QueryParams) (ls []*task.Config, count int64, err error)
QueryConfigs .
func (*Service) Release ¶
func (s *Service) Release(c context.Context, opt *common.BaseOptions, delay bool) (rows int64, err error)
Release 释放任务
func (*Service) ReportTaskSubmit ¶
func (s *Service) ReportTaskSubmit(c context.Context, pm *model.OptReportSubmit) (res *model.ReportSubmitRes, err error)
ReportTaskSubmit 业务节点下的任务提交统计信息, 按天分页
func (*Service) ReportTaskflow ¶
func (s *Service) ReportTaskflow(c context.Context, opt *model.OptReport) (res map[string][]*model.ReportFlowItem, form map[string][24]*model.ReportFlowItem, err error)
ReportTaskflow .
func (*Service) ReserveCFG ¶
func (s *Service) ReserveCFG(c context.Context, bizid int64) (rsvcfg map[string]interface{}, err error)
ReserveCFG 保留字配置
func (*Service) ResourceRes ¶
func (s *Service) ResourceRes(c context.Context, args *resource.Args) (res *resource.Res, err error)
ResourceRes .
func (*Service) SearchAuditLog ¶
func (s *Service) SearchAuditLog(c context.Context, pm *model.SearchAuditLogParam) (res []*model.SearchAuditLog, p common.Pager, err error)
SearchAuditLog 查询审核日志
func (*Service) SearchAuditLogCSV ¶
func (s *Service) SearchAuditLogCSV(c context.Context, pm *model.SearchAuditLogParam) (csv [][]string, err error)
SearchAuditLogCSV 操作日志结果csv
func (*Service) SetBusinessState ¶
SetBusinessState .
func (*Service) SetStateConfig ¶
SetStateConfig .
func (*Service) ShowDirection ¶
func (s *Service) ShowDirection(c context.Context, id int64) (r *net.ShowDirectionResult, err error)
ShowDirection .
func (*Service) ShowTransition ¶
func (s *Service) ShowTransition(c context.Context, id int64) (r *net.ShowTransitionResult, err error)
ShowTransition .
func (*Service) SwitchDirection ¶
func (s *Service) SwitchDirection(c context.Context, id int64, needDisable bool) (err error, msg string)
SwitchDirection .
func (*Service) SwitchFlow ¶
SwitchFlow .
func (*Service) SwitchTransition ¶
SwitchTransition .
func (*Service) TaskStat ¶
func (s *Service) TaskStat(c context.Context, opt *common.BaseOptions) (stat *taskmod.Stat, err error)
TaskStat task stat
func (*Service) TokenByName ¶
func (s *Service) TokenByName(c context.Context, businessID int64, name string) (result map[string]string, err error)
TokenByName .
func (*Service) TokenGroupByType ¶
func (s *Service) TokenGroupByType(c context.Context, netID int64) (result map[string][]*net.Token, err error)
TokenGroupByType .
func (*Service) TrackResource ¶
func (s *Service) TrackResource(c context.Context, pm *model.TrackParam) (res *model.TrackInfo, p common.Pager, err error)
TrackResource 资源信息追踪, 获取资源add/update日志,并分页,以此为基准,获取对应时间端内的资源audit日志;若add/update日志只有不超过1页,则获取全部audit日志;超过1页,最后一页会返回剩余的全部audit日志
func (*Service) TxAddResource ¶
func (s *Service) TxAddResource(ormTx *gorm.DB, b *resource.Resource, r *resource.Result) (rid int64, err error)
TxAddResource .
func (*Service) TxDelResource ¶
func (s *Service) TxDelResource(c context.Context, ormTx *gorm.DB, bizid int64, rids []int64) (delState int, err error)
TxDelResource .
func (*Service) TxSubmitTask ¶
func (s *Service) TxSubmitTask(c context.Context, ormTx *gorm.DB, opt *common.BaseOptions, state int8) (ostate int8, otaskid, ouid int64, err error)
TxSubmitTask 提交任务
func (*Service) TxUpdateResource ¶
func (s *Service) TxUpdateResource(tx *gorm.DB, rid int64, res map[string]interface{}, rscRes *resource.Result) (err error)
TxUpdateResource .
func (*Service) UnDoStat ¶
func (s *Service) UnDoStat(c context.Context, opt *common.BaseOptions) (stat *taskmod.UnDOStat, err error)
UnDoStat undo stat
func (*Service) UpdateBizCFG ¶
UpdateBizCFG .
func (*Service) UpdateBusiness ¶
UpdateBusiness .
func (*Service) UpdateConfig ¶
UpdateConfig .
func (*Service) UpdateDirection ¶
func (s *Service) UpdateDirection(c context.Context, uid int64, d *net.DirEditParam) (err error, msg string)
UpdateDirection .
func (*Service) UpdateFlow ¶
func (s *Service) UpdateFlow(c context.Context, uid int64, f *net.FlowEditParam) (err error, msg string)
UpdateFlow .
func (*Service) UpdateNet ¶
func (s *Service) UpdateNet(c context.Context, uid int64, n *net.NetEditParam) (err error, msg string)
UpdateNet .
func (*Service) UpdateTransition ¶
func (s *Service) UpdateTransition(c context.Context, uid int64, f *net.TransitionEditParam) (err error, msg string)
UpdateTransition .
func (*Service) Upload ¶
func (s *Service) Upload(c context.Context, fileName string, fileType string, timing int64, body []byte) (location string, err error)
Upload to bfs