Documentation ¶
Overview ¶
Package service implements instagram account operations and business logic.
Package service implements instagram account operations and business logic.
Index ¶
- Variables
- type Params
- type Service
- func (svc *Service) Follow(ctx context.Context, user models.User) error
- func (svc *Service) FollowUsers(ctx context.Context, usernames []string) (int, 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) GetUselessFollowers(ctx context.Context) ([]models.User, error)
- func (svc *Service) RemoveFollowersByUsername(ctx context.Context, usernames []string) (int, error)
- func (svc *Service) Stop(ctx context.Context) error
- func (svc *Service) UnFollow(ctx context.Context, user models.User) error
- func (svc *Service) UnFollowAllNotMutualExceptWhitelisted(ctx context.Context) (int, error)
- func (svc *Service) UnfollowUsers(ctx context.Context, usernames []string) (int, error)
- func (svc *Service) UploadMedia(ctx context.Context, file io.Reader, mt media.Type) 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") // ErrNoUsernamesPassed returns when usernames list is empty. ErrNoUsernamesPassed = errors.New("no usernames passed") // ErrUserInWhitelist means that user skipped. ErrUserInWhitelist = errors.New("user in whitelist") // ErrUserNotFound returned when user not found. ErrUserNotFound = errors.New("user not found") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents service for operating instagram account.
func New ¶
New creates new instance of Service instance and returns closure func that will stop service.
Usage: svc, err := New(context.Background(), config.Config{}, Params{}) if err != nil{ // handle error } defer svc.Stop().
func (*Service) FollowUsers ¶ added in v1.6.0
FollowUsers follows users by the name passed.
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) GetUselessFollowers ¶ added in v1.5.0
GetUselessFollowers 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) RemoveFollowersByUsername ¶ added in v0.12.0
RemoveFollowersByUsername removes all provided users by blocking and unblocking them to bypass Instagram limits.
func (*Service) UnFollowAllNotMutualExceptWhitelisted ¶
UnFollowAllNotMutualExceptWhitelisted clean followings from users that not following back except of whitelisted users.
func (*Service) UnfollowUsers ¶ added in v1.4.0
UnfollowUsers unfollows users by the name passed.