client

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package client provides client for social networks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Username(ctx context.Context) string
	GetUserByName(ctx context.Context, username string) (models.User, error)
	Followers(ctx context.Context) ([]models.User, error)
	UserFollowers(ctx context.Context, user models.User) ([]models.User, error)
	Followings(ctx context.Context) ([]models.User, error)
	UserFollowings(ctx context.Context, user models.User) ([]models.User, error)
	Follow(ctx context.Context, user models.User) error
	Unfollow(ctx context.Context, user models.User) error
	Block(ctx context.Context, user models.User) error
	Unblock(ctx context.Context, user models.User) error
	IsUseless(ctx context.Context, user models.User, threshold int) (bool, error)
	UploadMedia(ctx context.Context, file io.Reader, mt media.Type) error
	Logout(ctx context.Context) error
}

Client is a common social client interface.

func New

func New(ctx context.Context, p Params) (Client, error)

New creates Client. Also returns logout func.

type Params added in v1.10.0

type Params struct {
	SessionPath string
	Sleep       time.Duration
	Username    string
}

Params holds Client constructor parameters.

Directories

Path Synopsis
Package errors defines common client errors.
Package errors defines common client errors.
Package instagram provides interactions with Instagram social account.
Package instagram provides interactions with Instagram social account.

Jump to

Keyboard shortcuts

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