Documentation
¶
Overview ¶
Package service implements instagram account operations and business logic.
Package service implements instagram account operations and business logic.
Index ¶
- Variables
- func New(ctx context.Context, cfg config.Config, cfgPath string) (*Service, StopFunc, error)
- type Service
- func (svc *Service) Follow(user models.User) error
- func (svc *Service) GetBusinessAccountsOrBotsFromFollowers() ([]models.User, error)
- func (svc *Service) GetDiffFollowers() ([]models.UsersBatch, error)
- func (svc *Service) GetFollowers() ([]models.User, error)
- func (svc *Service) GetFollowings() ([]models.User, error)
- func (svc *Service) GetNotMutualFollowers() ([]models.User, error)
- func (svc *Service) UnFollow(user models.User) error
- func (svc *Service) UnFollowAllNotMutualExceptWhitelisted() (int, error)
- type StopFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLimitExceed returned when limit for action exceeded. ErrLimitExceed = errors.New("limit exceeded") // ErrCorrupted returned when instagram returned error response more than one time during loop processing. ErrCorrupted = errors.New("unable to continue - instagram responses with errors") )
var ErrNoUsers = errors.New("no users")
ErrNoUsers means that no users found.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents service for operating instagram account.
func (*Service) GetBusinessAccountsOrBotsFromFollowers ¶
GetBusinessAccountsOrBotsFromFollowers ranges all followers and tried to detect bots or business accounts. These accounts could be blocked as they are not useful for statistic.
func (*Service) GetDiffFollowers ¶
func (svc *Service) GetDiffFollowers() ([]models.UsersBatch, error)
GetDiffFollowers returns batches with lost and new followers.
func (*Service) GetFollowers ¶
GetFollowers returns list of followers for logged in user.
func (*Service) GetFollowings ¶
GetFollowings returns list of followings for logged in user.
func (*Service) GetNotMutualFollowers ¶
GetNotMutualFollowers returns list of users that not following back.
func (*Service) UnFollowAllNotMutualExceptWhitelisted ¶
UnFollowAllNotMutualExceptWhitelisted clean followings from users that not following back except of whitelisted users.