Documentation
¶
Index ¶
- func AuthorTTB(author User) *bridge.TwitterUser
- func DeleteRecord(pds string, token string, id string, my_did string, collection string) error
- func GetURIComponents(uri string) (string, string, string)
- func GetUserAuthData(handle string) (*string, *string, error)
- func GetUserInfo(pds string, token string, screen_name string, nocache bool) (*bridge.TwitterUser, error)
- func GetUsersInfo(pds string, token string, items []string, ignoreCache bool) ([]*bridge.TwitterUser, error)
- func InitConfig(config *config.Config)
- func ResolveDIDFromHandle(handle string) (*string, error)
- func ResolvePDSFromDID(userDID string) (*string, error)
- func SendRequest(token *string, method string, url string, body io.Reader) (*http.Response, error)
- func SendRequestWithContentType(token *string, method string, url string, body io.Reader, content_type string) (*http.Response, error)
- func UpdateRecord(pds string, token string, collection string, repo string, rkey string, ...) error
- type AspectRatio
- type AuthRequest
- type AuthResponse
- type Blob
- type Commit
- type CreatePostRecord
- type CreateRecordPayload
- type CreateRecordResult
- type DIDDoc
- type DeleteRecordPayload
- type Embed
- type ExternalImage
- type FTime
- type Facet
- type Feature
- type Feed
- type FollowersTimeline
- type FollowsTimeline
- type Image
- type Index
- type ItemByWithDate
- type Likes
- type ListDetailed
- type ListInfo
- type ListItem
- type Lists
- type MoreImages
- type Notification
- type Notifications
- type OtherActorSuggestions
- type Post
- type PostInteractionRecord
- type PostReason
- type PostRecord
- type PostSearchResult
- type PostViewer
- type ProperSubjectInteractionRecord
- type RecordResponse
- type RecordValue
- type Ref
- type Relationships
- type RelationshipsRes
- type ReplySubject
- type RepostedBy
- type Session
- type Subject
- type Thread
- type ThreadRoot
- func GetPost(pds string, token string, uri string, depth int, parentHeight int) (*ThreadRoot, error)
- func LikePost(pds string, token string, id string, my_did string) (*ThreadRoot, error)
- func ReTweet(pds string, token string, id string, my_did string) (*ThreadRoot, *string, error)
- func UnlikePost(pds string, token string, id string, my_did string) (*ThreadRoot, error)
- func UpdateStatus(pds string, token string, my_did string, status string, in_reply_to *string, ...) (*ThreadRoot, error)
- type Timeline
- func GetActorLikes(pds string, token string, context string, actor string, limit int) (*Timeline, error)
- func GetHotPosts(pds string, token string, context string, feed string, limit int) (*Timeline, error)
- func GetListTimeline(pds string, token string, context string, listURI string, limit int) (*Timeline, error)
- func GetMediaTimeline(pds string, token string, context string, actor string, limit int) (*Timeline, error)
- func GetTimeline(pds string, token string, context string, feed string, limit int) (*Timeline, error)
- func GetUserTimeline(pds string, token string, context string, actor string, limit int) (*Timeline, error)
- type TrendingTopic
- type TrendingTopics
- type UpdateRecordPayload
- type User
- func FollowUser(pds string, token string, targetActor string, my_did string) (*User, error)
- func GetMySuggestedUsers(pds string, token string, limit int) ([]User, error)
- func GetOthersSuggestedUsers(pds string, token string, limit int, actor string) ([]User, error)
- func GetTopicSuggestedUsers(pds string, token string, limit int, category string) ([]User, error)
- func GetUserInfoRaw(pds string, token string, screen_name string) (*User, error)
- func GetUsersInfoRaw(pds string, token string, items []string, ignoreCache bool) ([]*User, error)
- func UnfollowUser(pds string, token string, targetActor string, my_did string) (*User, error)
- func UserSearch(pds string, token string, query string) ([]User, error)
- func UserSearchAhead(pds string, token string, query string, limit int) ([]User, error)
- type UserChat
- type UserSearchResult
- type Verification
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorTTB ¶
func AuthorTTB(author User) *bridge.TwitterUser
https://web.archive.org/web/20121029153120/https://dev.twitter.com/docs/platform-objects/users
func DeleteRecord ¶
func GetURIComponents ¶
Gets the URI components
@param uri: The URI to ge split @return: collection, repo, rkey
func GetUserAuthData ¶
This function is to get: the user DID and the user's PDS this should **ONLY** be used during authentication.
@results: userDID, userPDS, error
func GetUserInfo ¶
func GetUsersInfo ¶
func InitConfig ¶
func ResolveDIDFromHandle ¶
func ResolvePDSFromDID ¶
func SendRequest ¶
Types ¶
type AspectRatio ¶
type AuthRequest ¶
type AuthResponse ¶
type AuthResponse struct {
AccessJwt string `json:"accessJwt"`
RefreshJwt string `json:"refreshJwt"`
DID string `json:"did"`
}
func Authenticate ¶
func Authenticate(username, password string) (*AuthResponse, *string, error)
func RefreshToken ¶
func RefreshToken(pds string, refreshToken string) (*AuthResponse, error)
type Blob ¶
type CreatePostRecord ¶
type CreateRecordPayload ¶
type CreateRecordPayload struct {
Collection string `json:"collection"`
Repo string `json:"repo"`
Record interface{} `json:"record"`
}
Reposting/Retweeting
type CreateRecordResult ¶
type DeleteRecordPayload ¶
type Embed ¶
type Embed struct {
Type string `json:"$type"`
Images []Image `json:"images,omitempty"`
External *ExternalImage `json:"external,omitempty"`
Media *MoreImages `json:"media,omitempty"`
*Video `json:",omitempty"`
}
type ExternalImage ¶
doesn't contain everything, but who cares
type FTime ¶
func (*FTime) UnmarshalJSON ¶
type Feed ¶
type Feed struct {
Post Post `json:"post"`
Reply struct {
Root Post `json:"root"`
Parent Post `json:"parent"`
} `json:"reply"`
Reason *PostReason `json:"reason"`
FeedContext string `json:"feedContext"`
}
type FollowersTimeline ¶
type FollowersTimeline struct {
Subject User `json:"subject"`
Followers []User `json:"followers"`
Cursor string `json:"cursor"`
}
func GetFollowers ¶
type FollowsTimeline ¶
type FollowsTimeline struct {
Subject User `json:"subject"`
Followers []User `json:"follows"`
Cursor string `json:"cursor"`
}
func GetFollows ¶
type Image ¶
type Image struct {
Alt string `json:"alt"`
AspectRatio AspectRatio `json:"aspectRatio"`
Image Blob `json:"image"`
}
type ItemByWithDate ¶
type Likes ¶
type Likes struct {
Subject
Cursor string `json:"cursor"`
Likes []ItemByWithDate `json:"likes"`
}
type ListDetailed ¶
type ListInfo ¶
type ListInfo struct {
URI string `json:"uri"`
CID string `json:"cid"`
Creator User `json:"creator"`
Name string `json:"name"`
Description string `json:"description"`
DescriptionFacets []Facet `json:"descriptionFacets"`
Avatar string `json:"avatar"`
ListItemCount int `json:"listItemCount"`
IndexedAt time.Time `json:"indexedAt"`
Viewer PostViewer `json:"viewer"`
}
type MoreImages ¶
type MoreImages struct {
Images []Image `json:"images,omitempty"`
}
type Notification ¶
type Notification struct {
URI string `json:"uri"`
CID string `json:"cid"`
Author User `json:"author"`
Reason string `json:"reason"`
ReasonSubject string `json:"reasonSubject"`
Record PostInteractionRecord `json:"record"` // i think this is the correct object?
IsRead bool `json:"isRead"`
IndexedAt time.Time `json:"indexedAt"`
}
type Notifications ¶
type Notifications struct {
Notifications []Notification `json:"notifications"`
Cursor string `json:"cursor"`
Priority bool `json:"priority"`
SeenAt time.Time `json:"seenAt"`
}
func GetMentions ¶
func GetNotifications ¶
type OtherActorSuggestions ¶
type OtherActorSuggestions struct {
Actors []User `json:"suggestions"`
}
type Post ¶
type Post struct {
Subject
Author User `json:"author"`
Record PostRecord `json:"record"`
// Embed Embed `json:"embed"`
ReplyCount int `json:"replyCount"`
RepostCount int `json:"repostCount"`
LikeCount int `json:"likeCount"`
QuoteCount int `json:"quoteCount"`
IndexedAt time.Time `json:"indexedAt"`
Viewer PostViewer `json:"viewer"`
}
type PostInteractionRecord ¶
type PostReason ¶
type PostReason struct {
Type string `json:"$type"`
By User `json:"by"`
IndexedAt time.Time `json:"indexedAt"`
}
Specifically for reposts
type PostRecord ¶
type PostSearchResult ¶
type PostViewer ¶
type PostViewer struct {
Repost *string `json:"repost"`
Like *string `json:"like"` // Can someone please tell me why this is a string.
Muted bool `json:"muted"`
BlockedBy bool `json:"blockedBy"`
ThreadMute bool `json:"threadMute"`
ReplyDisabled bool `json:"replyDisabled"`
EmbeddingDisabled bool `json:"embeddingDisabled"`
Pinned bool `json:"pinned"`
}
type RecordResponse ¶
type RecordResponse struct {
URI string `json:"uri"`
CID string `json:"cid"`
Value RecordValue `json:"value"`
}
func GetRecordWithUri ¶
func GetRecordWithUri(pds string, uri string) (*RecordResponse, error)
type RecordValue ¶
type RecordValue struct {
Reply *ReplySubject `json:"reply,omitempty"`
CreatedAt FTime `json:"createdAt,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Avatar Blob `json:"avatar,omitempty"`
}
type Relationships ¶
type RelationshipsRes ¶
type RelationshipsRes struct {
Actor string `json:"actor"`
Relationships []Relationships `json:"relationships"`
}
func GetRelationships ¶
func GetRelationships(pds string, token string, source string, others []string) (*RelationshipsRes, error)
https://docs.bsky.app/docs/api/app-bsky-graph-get-relationships
type ReplySubject ¶
func GetReplyRefs ¶
func GetReplyRefs(pds string, token string, parentURI string) (*ReplySubject, error)
type RepostedBy ¶
type RepostedBy struct {
Subject
Cursor string `json:"cursor"`
RepostedBy []User `json:"repostedBy"`
}
func GetRetweetAuthors ¶
type Session ¶
type ThreadRoot ¶
type ThreadRoot struct {
Thread Thread `json:"thread"`
}
This is solely for the purpose of unmarshalling the response from the API
func UnlikePost ¶
func UpdateStatus ¶
func UpdateStatus(pds string, token string, my_did string, status string, in_reply_to *string, mentions []bridge.FacetParsing, urls []bridge.FacetParsing, tags []bridge.FacetParsing, imageBlob *Blob, imageRes []int) (*ThreadRoot, error)
This handles both normal & replys
type Timeline ¶
func GetActorLikes ¶
func GetActorLikes(pds string, token string, context string, actor string, limit int) (*Timeline, error)
https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-likes Bluesky for SOME REASON limits viewing the likes to your own user. WHy? What is the point of having an "actor" field if you can only use 1 actor?"ADD THIS TO LOOKUP TABLE" I'm still gonna implement it, we can hope it will be expanded in the future.
func GetHotPosts ¶
func GetListTimeline ¶
func GetMediaTimeline ¶
func GetTimeline ¶
func GetUserTimeline ¶
func GetUserTimeline(pds string, token string, context string, actor string, limit int) (*Timeline, error)
https://docs.bsky.app/docs/api/app-bsky-feed-get-author-feed
type TrendingTopic ¶
type TrendingTopics ¶
type TrendingTopics struct {
Topics []TrendingTopic `json:"topics"`
Suggested []TrendingTopic `json:"suggested"`
}
type UpdateRecordPayload ¶
type UpdateRecordPayload struct {
CreateRecordPayload
RKey string `json:"rkey"`
SwapRecord string `json:"swapRecord"`
}
type User ¶
type User struct {
DID string `json:"did"`
Handle string `json:"handle"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Avatar string `json:"avatar"`
Banner string `json:"banner"`
FollowersCount int `json:"followersCount"`
FollowsCount int `json:"followsCount"`
PostsCount int `json:"postsCount"`
IndexedAt time.Time `json:"indexedAt"`
CreatedAt FTime `json:"createdAt"`
Associated struct {
Lists int `json:"lists"`
FeedGens int `json:"feedgens"`
StarterPacks int `json:"starterPacks"`
Labeler bool `json:"labeler"`
CreatedAt FTime `json:"created_at"`
Chat UserChat `json:"chat"`
} `json:"associated"`
Viewer struct {
Muted bool `json:"muted"`
// MutedByList
BlockedBy bool `json:"blockedBy"`
Blocking *string `json:"blocking,omitempty"`
// BlockingByList
Following *string `json:"following,omitempty"`
FollowedBy *string `json:"followedBy,omitempty"`
} `json:"viewer"`
Verification Verification `json:"verification"`
}
https://docs.bsky.app/docs/api/app-bsky-actor-get-profile
func FollowUser ¶
func GetMySuggestedUsers ¶
func GetOthersSuggestedUsers ¶
func GetTopicSuggestedUsers ¶
func GetUserInfoRaw ¶
func GetUsersInfoRaw ¶
TODO: Combine this with GetUsersInfo... somehow
func UnfollowUser ¶
type UserSearchResult ¶
type UserSearchResult struct {
Actors []User `json:"actors"`
}
type Verification ¶
type Video ¶
type Video struct {
Alt string `json:"alt"`
AspectRatio AspectRatio `json:"aspectRatio"`
Video *Blob `json:"video"`
}