Documentation ¶
Index ¶
- Variables
- func DeleteProducts(sapi *api.TokopediaApi, datas []*model.SellerProductItem) error
- func IterateProduct(sellerapi *api.TokopediaApi, filter *IterateFilter, ...) error
- func NewReport() chan *DeleteReportItem
- func SaveDeleteConfig(fname string, cfg *DeleteConfig) error
- func SaveReport(fname string, reports []*DeleteReportItem) error
- type AkunDeleteItem
- type DeleteConfig
- type DeleteReportItem
- type DeleteRunner
- type FilterHandler
- type IterateFilter
- type SoldConfig
- type ViewConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeleteLimitExcedeed = errors.New("delete limit excedeed")
Functions ¶
func DeleteProducts ¶ added in v1.1.61
func DeleteProducts(sapi *api.TokopediaApi, datas []*model.SellerProductItem) error
func IterateProduct ¶
func IterateProduct( sellerapi *api.TokopediaApi, filter *IterateFilter, handleItem func(page int, product *model.SellerProductItem, delete func() int) error, ) error
func NewReport ¶ added in v1.1.61
func NewReport() chan *DeleteReportItem
func SaveDeleteConfig ¶
func SaveDeleteConfig(fname string, cfg *DeleteConfig) error
func SaveReport ¶ added in v1.1.61
func SaveReport(fname string, reports []*DeleteReportItem) error
Types ¶
type AkunDeleteItem ¶
type DeleteConfig ¶
type DeleteConfig struct { LimitConcurent int `json:"limit_concurent"` LimitProduct int `json:"limit_product"` Title []string `json:"title"` StatusProduct model.ProductStatus `json:"product_status"` CategoryID string `json:"category_id"` StartTime int64 `json:"start_time"` EndTime int64 `json:"end_time"` TStartTime time.Time `json:"-"` TEndTime time.Time `json:"-"` Akuns []*AkunDeleteItem `json:"akuns"` SoldFilter *SoldConfig `json:"sold_filter,omitempty"` ViewFilter *ViewConfig `json:"view_filter,omitempty"` }
func NewDeleteConfig ¶
func NewDeleteConfig(fname string) (*DeleteConfig, error)
func (*DeleteConfig) GenerateFilter ¶
func (cfg *DeleteConfig) GenerateFilter() func(product *model.SellerProductItem) (bool, string)
func (*DeleteConfig) GenerateFilterTime ¶
func (cfg *DeleteConfig) GenerateFilterTime() FilterHandler
func (*DeleteConfig) GenerateFilterTitle ¶
func (cfg *DeleteConfig) GenerateFilterTitle() FilterHandler
func (*DeleteConfig) UnmarshalJSON ¶
func (cfg *DeleteConfig) UnmarshalJSON(data []byte) error
type DeleteReportItem ¶ added in v1.1.61
type DeleteRunner ¶
type DeleteRunner struct { Config *DeleteConfig // contains filtered or unexported fields }
func NewDeleteRunner ¶
func NewDeleteRunner(cfg *DeleteConfig) *DeleteRunner
func (*DeleteRunner) Run ¶
func (runner *DeleteRunner) Run(fname string)
func (*DeleteRunner) RunDeleteAkun ¶
func (runner *DeleteRunner) RunDeleteAkun(akun *AkunDeleteItem, reports chan *DeleteReportItem) error
type FilterHandler ¶
type FilterHandler func(product *model.SellerProductItem) bool
type IterateFilter ¶ added in v1.1.61
type IterateFilter struct { CategoryID string Page int PageSize int Status model.ProductStatus }
func (*IterateFilter) GetFilters ¶ added in v1.1.61
func (f *IterateFilter) GetFilters() []model.Filter
type SoldConfig ¶
func (*SoldConfig) GenerateFilter ¶
func (soldf *SoldConfig) GenerateFilter() FilterHandler
type ViewConfig ¶
func (*ViewConfig) GenerateFilter ¶
func (view *ViewConfig) GenerateFilter() FilterHandler
Click to show internal directories.
Click to hide internal directories.