x

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

NewClient returns a new X client

func (*Client) GetMyUser

func (c *Client) GetMyUser(ctx context.Context, accessToken string) (*User, error)

GetMyUser gets the X user associated with the provided access token

type PublicMetrics

type PublicMetrics struct {
	FollowersCount int `json:"followers_count"`
	FollowingCount int `json:"following_count"`
	TweetCount     int `json:"tweet_count"`
	LikeCount      int `json:"like_count"`
}

PublicMetrics represents the structure for public metrics in the X API response

type User

type User struct {
	ID              string        `json:"id"`
	Username        string        `json:"username"`
	Name            string        `json:"name"`
	Description     string        `json:"description"`
	ProfileImageUrl string        `json:"profile_image_url"`
	VerifiedType    string        `json:"verified_type"`
	PublicMetrics   PublicMetrics `json:"public_metrics"`
}

User represents the structure for a user in the X API response

func (*User) ToProto

func (u *User) ToProto() *profilepb.XProfile

Jump to

Keyboard shortcuts

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