Documentation ¶
Overview ¶
Package service implements instagram account operations and business logic.
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(ctx context.Context, user models.User) error
- func (svc *Service) GetBusinessAccountsOrBotsFromFollowers(ctx context.Context) ([]models.User, error)
- func (svc *Service) GetDiffFollowers(ctx context.Context) ([]models.UsersBatch, error)
- func (svc *Service) GetDiffFollowings(ctx context.Context) ([]models.UsersBatch, error)
- func (svc *Service) GetFollowers(ctx context.Context) ([]models.User, error)
- func (svc *Service) GetFollowings(ctx context.Context) ([]models.User, error)
- func (svc *Service) GetHistoryDiffFollowers(ctx context.Context) (models.DiffHistory, error)
- func (svc *Service) GetHistoryDiffFollowings(ctx context.Context) (models.DiffHistory, error)
- func (svc *Service) GetNotMutualFollowers(ctx context.Context) ([]models.User, error)
- func (svc *Service) RemoveFollowersByUsername(ctx context.Context, usernames []string) (int, error)
- func (svc *Service) UnFollow(ctx context.Context, user models.User) error
- func (svc *Service) UnFollowAllNotMutualExceptWhitelisted(ctx context.Context) (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") // ErrNoUsers means that no users found. ErrNoUsers = errors.New("no users") // ErrEmptyInput returned in case when user input is empty. ErrEmptyInput = errors.New("should not be empty") )
Functions ¶
func New ¶
func New(ctx context.Context, cfg config.Config, cfgPath string, isDebug, isIncognito bool) (*Service, StopFunc, error)
New creates new instance of Service instance and returns closure func that will stop service.
Usage: svc, stop, err := New(config.Config{}) if err != nil{ // handle error } defer stop().
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents service for operating instagram account.
func (*Service) GetBusinessAccountsOrBotsFromFollowers ¶
func (svc *Service) GetBusinessAccountsOrBotsFromFollowers(ctx context.Context) ([]models.User, error)
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 ¶
GetDiffFollowers returns batches with lost and new followers.
func (*Service) GetDiffFollowings ¶ added in v1.1.0
GetDiffFollowings returns batches with lost and new followings.
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) GetHistoryDiffFollowers ¶ added in v1.1.0
GetHistoryDiffFollowers returns diff history of followers for an account.
func (*Service) GetHistoryDiffFollowings ¶ added in v1.1.0
GetHistoryDiffFollowings returns diff history of followings for an account.
func (*Service) GetNotMutualFollowers ¶
GetNotMutualFollowers returns list of users that not following back.
func (*Service) RemoveFollowersByUsername ¶ added in v0.12.0
RemoveFollowersByUsername removes all provided users by blocking and unblocking them to bypass Instagram limits.