Documentation ¶
Index ¶
- Variables
- type FacebookClient
- func (fc *FacebookClient) AuthURL(redirectURI, scope string) string
- func (fc *FacebookClient) Call(httpMethod, endpoint string, params url.Values) ([]byte, error)
- func (fc *FacebookClient) CurrentUser() (*User, error)
- func (fc *FacebookClient) GetUser(id string) (*User, error)
- func (fc *FacebookClient) PostCall(endpoint, header string, body []byte) ([]byte, error)
- func (fc *FacebookClient) PostLink(link Link) error
- func (fc *FacebookClient) PostPhoto(photo Photo) error
- func (fc *FacebookClient) PostStatus(message string) error
- func (fc *FacebookClient) RequestAccessToken(code, redirectURI string) error
- func (fc *FacebookClient) User(id string) (*User, error)
- type Link
- type ObjectRef
- type Photo
- type TempToken
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrOAuth = errors.New("OAuth authorization failure")
)
View Source
var (
UserNotConnectedError = errors.New("User Not Connected")
)
Functions ¶
This section is empty.
Types ¶
type FacebookClient ¶
type FacebookClient struct { APIKey string AppSecret string AccessToken string Transport http.RoundTripper }
func NewFacebookClient ¶
func NewFacebookClient(key, secret string) *FacebookClient
func (*FacebookClient) AuthURL ¶
func (fc *FacebookClient) AuthURL(redirectURI, scope string) string
func (*FacebookClient) Call ¶
Performs API call based on httpMethod returns the response body as string and error/nil
func (*FacebookClient) CurrentUser ¶
func (fc *FacebookClient) CurrentUser() (*User, error)
func (*FacebookClient) PostCall ¶
func (fc *FacebookClient) PostCall(endpoint, header string, body []byte) ([]byte, error)
Performs POST-based API call with a prepared body. Returns the response body as string and error/nil
func (*FacebookClient) PostLink ¶
func (fc *FacebookClient) PostLink(link Link) error
func (*FacebookClient) PostPhoto ¶
func (fc *FacebookClient) PostPhoto(photo Photo) error
func (*FacebookClient) PostStatus ¶
func (fc *FacebookClient) PostStatus(message string) error
func (*FacebookClient) RequestAccessToken ¶
func (fc *FacebookClient) RequestAccessToken(code, redirectURI string) error
type Link ¶
type Link struct { Text string // Additional text added to the post Image string // URL for the Image to be used Url string // URL to be shared }
Link represents a link to be posted
type ObjectRef ¶
This type is used by various facebook objects to represent a user ID. The reason for having both Id and Name is to avoid ambiguity in cases where a user name is a valid Id
type Photo ¶
type Photo struct { Source []byte // the photo data to be uploaded FileName string // name of the photo file to be uploaded (e.g. "photo.png") Message string // some descriptive text }
Photo represents a photo resource to be shared
type User ¶
type User struct { Id string Name string First_name string Middle_name string Last_name string Gender string Locale string Languages []ObjectRef Link string Username string Third_party_id string Timezone int64 Update_time string Verified bool Bio string Birthday string // MM/DD/YYYY //Education ODO Email string Hometown string Interested_in []string Location ObjectRef Political string Favorite_athletes []ObjectRef Quotes string Relationship_status string Religion string Significant_other ObjectRef // Video_upload_limits Website string Client *FacebookClient }
User object. See http://developers.facebook.com/docs/reference/api/user/
func NewUser ¶
func NewUser(Id string, fc *FacebookClient) *User
Useful if all you want is to have an Id to perform actions This prevents having to query a user object from FB.
func (*User) PostStatus ¶
Click to show internal directories.
Click to hide internal directories.