publish_item

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoIcon = errors.New("icon not found")
)

Functions

func Average

func Average(arr []uint64, cardinality uint64) uint64

func AverageFloat

func AverageFloat(arr []float64, cardinality uint64) float64

func GenerateInstallPlist

func GenerateInstallPlist(info *IosAppInfo, downloadUrl string) string

func GenrateTmpImagePath

func GenrateTmpImagePath(id string) string

func Growth

func Growth(last, recent float64) float64

func MetricsTotal

func MetricsTotal(resp *query.MetricQueryResponse) (uint64, error)

func Round

func Round(x float64) uint64

func SaveImageToFile

func SaveImageToFile(icon image.Image, path string) error

func SevenDayAvg

func SevenDayAvg(resp *query.MetricQueryResponse) (uint64, float64, error)

func SevenDayUserRetension

func SevenDayUserRetension(firstResp, secondResp *query.MetricQueryResponse) (string, float64, error)

func Smaller

func Smaller(a, b float64) bool

func VersionChannelList

func VersionChannelList(groupKey, ak, ai string, end time.Time) ([]*apistructs.PublishItemStatisticsDetailResponse, error)

Types

type AndroidAppInfo

type AndroidAppInfo struct {
	PackageName string
	Version     string
	VersionCode int32
	Icon        image.Image
	DisplayName string
}

func GetAndoridInfo

func GetAndoridInfo(fileHeader *multipart.FileHeader) (*AndroidAppInfo, error)

type CFBundleIcons

type CFBundleIcons struct {
	CFBundlePrimaryIcon *CFBundlePrimaryIcon `plist:"CFBundlePrimaryIcon"`
}

type CFBundlePrimaryIcon

type CFBundlePrimaryIcon struct {
	CFBundleIconFiles []string `plist:"CFBundleIconFiles"`
	CFBundleIconName  string   `plist:"CFBundleIconName"`
}

type IOSPlist

type IOSPlist struct {
	CFBundleName         string         `plist:"CFBundleName"`
	CFBundleDisplayName  string         `plist:"CFBundleDisplayName"`
	CFBundleVersion      string         `plist:"CFBundleVersion"`
	CFBundleShortVersion string         `plist:"CFBundleShortVersionString"`
	CFBundleIdentifier   string         `plist:"CFBundleIdentifier"`
	CFBundleIcons        *CFBundleIcons `plist:"CFBundleIcons"`
}

type IosAppInfo

type IosAppInfo struct {
	Name     string
	BundleId string
	Version  string
	Build    string
	Icon     image.Image
	Size     int64
	IconName string
}

func GetIosInfo

func GetIosInfo(fileHeader *multipart.FileHeader) (*IosAppInfo, error)

type Option

type Option func(*PublishItem)

Option 定义 PublishItem 对象的配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db client

type PKGInfo

type PKGInfo struct {
	PackageName string
	Version     string
	BuildID     string
	DisplayName string
}

type PublishItem

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

PublishItem

func New

func New(options ...Option) *PublishItem

New 新建 PublishItem 实例,操作 PublishItem 资源

func (*PublishItem) AddBlacklist

AddBlacklist 添加黑名单

func (*PublishItem) AddErase

AddErase 添加数据擦除

func (*PublishItem) CrashRate

func (i *PublishItem) CrashRate(point uint64, start, end time.Time, av string, mk *apistructs.MonitorKeys) (*apistructs.CardinalityResultsInterface, error)

崩溃率

func (*PublishItem) CreateOffLineVersion

func (i *PublishItem) CreateOffLineVersion(param apistructs.CreateOffLinePublishItemVersionRequest) (string, error)

CreateOffLineVersion 创建离线包版本

func (*PublishItem) CreatePublishItem

CreatePublishItem 创建发布内容

func (*PublishItem) CumulativeUsers

func (i *PublishItem) CumulativeUsers(point uint64, start, end time.Time, mk *apistructs.MonitorKeys) (*apistructs.CardinalityResults, error)

func (*PublishItem) DeletePublishItem

func (i *PublishItem) DeletePublishItem(id int64) error

DeletePublishItem 删除发布内容

func (*PublishItem) DeletePublishItemVersion

func (i *PublishItem) DeletePublishItemVersion(id int64) error

DeletePublishItem 删除发布版本

func (*PublishItem) EffactUsersRate

func (i *PublishItem) EffactUsersRate(point uint64, start, end time.Time, av string, mk *apistructs.MonitorKeys) (*apistructs.CardinalityResultsInterface, error)

影响用户占比

func (*PublishItem) GetBlacklists

GetBlacklists 获取黑名单列表,分页

func (*PublishItem) GetCertificationlist

GetCertificationlist 获取验证列表

func (*PublishItem) GetEraselists

GetEraselists 获取数据擦除列表,分页

func (*PublishItem) GetErrList

GetErrList 获取错误报告,错误列表

func (*PublishItem) GetErrTrend

GetErrTrend 获取错误报告,错误趋势

func (*PublishItem) GetH5PackageName

func (i *PublishItem) GetH5PackageName(itemID int64) ([]string, error)

GetH5PackageName 获取H5的包名列表

func (*PublishItem) GetMonitorkeys

func (*PublishItem) GetPublicPublishItemLaststVersion

GetPublicPublishItemLaststVersion 获取线上最新版本的包

func (*PublishItem) GetPublicPublishItemVersion

func (i *PublishItem) GetPublicPublishItemVersion(itemID int64, mobileType, packageName string) (*apistructs.QueryPublishItemVersionData, error)

GetPublicPublishItemVersion 获取线上已发布的版本

func (*PublishItem) GetPublishItem

func (i *PublishItem) GetPublishItem(id int64) (*apistructs.PublishItem, error)

GetPublishItem 获取发布内容详情

func (*PublishItem) GetPublishItemByAKAI

func (i *PublishItem) GetPublishItemByAKAI(AK, AI string) (*dbclient.PublishItem, error)

func (*PublishItem) GetPublishItemDistribution

func (i *PublishItem) GetPublishItemDistribution(id int64, mobileType apistructs.ResourceType, packageName string,
	w http.ResponseWriter, r *http.Request) (*apistructs.PublishItemDistributionData, error)

GetPublishItem

func (*PublishItem) GetSecurityStatus

GetSecurityStatus 获取客户安全信息状态

func (*PublishItem) GetStatisticsChannelInfo

func (i *PublishItem) GetStatisticsChannelInfo(end time.Time, mk *apistructs.MonitorKeys) ([]*apistructs.PublishItemStatisticsDetailResponse, error)

GetStatisticsChannelInfo 获取渠道详情,明细数据

func (*PublishItem) GetStatisticsTrend

GetStatisticsTrend 获取统计大盘,整体趋势

func (*PublishItem) GetStatisticsVersionInfo

func (i *PublishItem) GetStatisticsVersionInfo(end time.Time, mk *apistructs.MonitorKeys) ([]*apistructs.PublishItemStatisticsDetailResponse, error)

GetStatisticsVersionInfo 获取版本详情,明细数据

func (*PublishItem) GrayDistribution

func (i *PublishItem) GrayDistribution(w http.ResponseWriter, r *http.Request, publisherItem dbclient.PublishItem,
	distribution *apistructs.PublishItemDistributionData, mobileType apistructs.ResourceType, packageName string) error

GrayDistribution 根据用户身份进行和灰度设置进行灰度分发

func (*PublishItem) Migration320

func (i *PublishItem) Migration320()

Migration320 3.20 灰度逻辑迁移,3.21删除

func (*PublishItem) PublicPublishItemVersion

func (i *PublishItem) PublicPublishItemVersion(req apistructs.UpdatePublishItemVersionStatesRequset,
	local *i18n.LocaleResource) error

PublicPublishItemVersion 上架或下架版本

func (*PublishItem) PublishItemVersion

PublishItemVersion 创建发布版本

func (*PublishItem) QueryPublishItemVersions

QueryPublishItemVersions 查询发布版本

func (*PublishItem) QueryPublishItems

QueryPublishItems 查询发布内容

func (*PublishItem) RemoveBlacklist

func (i *PublishItem) RemoveBlacklist(blacklistID, publishItemID uint64) (error, *dbclient.PublishItemBlackList, *dbclient.PublishItem)

RemoveBlacklist 移除黑名单

func (*PublishItem) SetPublishItemVersionDefault

func (i *PublishItem) SetPublishItemVersionDefault(itemVersionID, itemID int64) error

SetPublishItemVersionDefault 设置发布版本默认状态

func (*PublishItem) SetPublishItemVersionPublic

func (i *PublishItem) SetPublishItemVersionPublic(id, itemID int64) error

SetPublishItemVersionPublic 设置发布版本为公开

func (*PublishItem) SetPublishItemVersionUnPublic

func (i *PublishItem) SetPublishItemVersionUnPublic(id, itemID int64) error

SetPublishItemVersionUnPublic 设置发布版本为公开

func (*PublishItem) UpdateErase

func (i *PublishItem) UpdateErase(request *apistructs.PublishItemEraseRequest) error

UpdateErase 更新数据擦除

func (*PublishItem) UpdatePublishItem

func (i *PublishItem) UpdatePublishItem(req *apistructs.UpdatePublishItemRequest) error

UpdatePublishItem 更新发布内容

func (*PublishItem) UploadFileFromFile

func (i *PublishItem) UploadFileFromFile(filePath string) (*apistructs.File, error)

func (*PublishItem) UploadFileFromReader

func (i *PublishItem) UploadFileFromReader(fileHeader *multipart.FileHeader) (*apistructs.File, error)

Jump to

Keyboard shortcuts

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