Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(appID string, appSecret string, oauthCallback string)
- func New(ctx context.Context, creds social.Credentials) (providers.ProviderSession, error)
- func NewOAuth() social.OAuth
- type FbAccount
- type FbPost
- type FbResponse
- type FbResponseAccounts
- type Mapper
- type OAuth
- type Paging
- type Provider
- func (p *Provider) GetFeed(query providers.Query) (social.Posts, *providers.Cursor, error)
- func (p *Provider) GetFollowers(query providers.Query) ([]*social.User, *providers.Cursor, error)
- func (p *Provider) GetFriends(query providers.Query) ([]*social.User, *providers.Cursor, error)
- func (p *Provider) GetPosts(query providers.Query) (social.Posts, *providers.Cursor, error)
- func (p *Provider) GetUser(query providers.Query) (*social.User, error)
- func (p *Provider) ID() string
- func (p *Provider) Post(ctx context.Context, msg string, shareLink string) (*social.Post, error)
- func (p *Provider) Search(query providers.Query) (social.Posts, *providers.Cursor, error)
- type UserProfile
Constants ¶
View Source
const (
ProviderID = `facebook`
)
Variables ¶
View Source
var ( AppID string AppSecret string OAuthCallback string // Facebook API version // See: https://developers.facebook.com/docs/apps/changelog for updates FacebookApiVersion = "v2.11" )
Functions ¶
func New ¶
func New(ctx context.Context, creds social.Credentials) (providers.ProviderSession, error)
Types ¶
type FbPost ¶
type FbPost struct { ID string `json:"id" facebook:"id"` From struct { ID string `json:"id" facebook:"id"` Name string `json:"name" facebook:"name"` Likes int `json:"likes" facebook:"likes"` } `json:"from" facebook:"from"` To struct { ID string `json:"id" facebook:"id"` Name string `json:"name" facebook:"name"` } `json:"to" facebook:"to"` Story string `json:"story" facebook:"story"` Name string `json:"name" facebook:"name"` Message string `json:"message" facebook:"message"` Description string `json:"description" facebook:"description"` Count int `json:"count"` } `json:"shares" facebook:"shares"` CreatedTime string `json:"created_time" facebook:"created_time"` UpdatedTime string `json:"updated_time" facebook:"updated_time"` Type string `json:"type" facebook:"type"` StatusType string `json:"status_type" facebook:"status_type"` Picture string `json:"full_picture" facebook:"full_picture"` Link string `json:"link" facebook:"link"` Source string `json:"source" facebook:"source"` Icon string `json:"icon" facebook:"icon"` Attachments struct { Data []struct { Description string `json:"description" facebook:"description"` Title string `json:"title" facebook:"title"` Type string `json:"type" facebook:"type"` URL string `json:"url" facebook:"url"` Media struct { Image struct { Width int `json:"width" facebook:"width"` Height int `json:"height" facebook:"height"` Src string `json:"src" facebook:"src"` } `json:"image" facebook:"image"` } `json:"media" facebook:"media"` SubAttachments struct { Data []struct { Description string `json:"description" facebook:"description"` Title string `json:"title" facebook:"title"` Type string `json:"type" facebook:"type"` URL string `json:"url" facebook:"url"` Media struct { Image struct { Width int `json:"width" facebook:"width"` Height int `json:"height" facebook:"height"` Src string `json:"src" facebook:"src"` } `json:"image" facebook:"image"` } `json:"media" facebook:"media"` } `json:"data" facebook:"data"` } `json:"subattachments" facebook:"subattachments"` } `json:"data" facebook:"data"` } `json:"attachments" facebook:"attachments"` }
type FbResponse ¶
type FbResponse struct { Data []FbPost `json:"data"` Paging Paging `json:"paging"` FbError fb.Error `json:"error"` UserProfile }
type FbResponseAccounts ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) GetFollowers ¶
func (*Provider) GetFriends ¶
type UserProfile ¶
type UserProfile struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Name string `json:"name"` ID string `json:"id"` Locale string `json:"locale"` Link string `json:"link"` Picture struct { Data struct { URL string `json:"url"` } `json:"data"` } `json:"picture"` Location struct { ID string `json:"id"` Name string `json:"name"` } `json:"location"` Timezone float32 `json:"timezone"` Friends struct { Summary struct { TotalCount int `json:"total_count"` } `json:"summary"` } `json:"friends"` Email string `json:"email"` }
Click to show internal directories.
Click to hide internal directories.