Documentation
¶
Index ¶
- type APIError
- type Account
- type AdAccount
- type Album
- type Client
- func (c *Client) Album(albumID string) (*Album, error)
- func (c *Client) Albums(userID string) ([]Album, error)
- func (c *Client) CreateAlbum(userID string, a *Album, p Privacy) error
- func (c *Client) Execute(method, path string, params map[string]interface{}, r interface{}, u ...Upload) error
- func (c *Client) IsTemp(err error) bool
- func (c *Client) UploadVideo(u *UploadSession) error
- func (c *Client) UserProfile(userID string) (*UserProfile, error)
- type Image
- type Privacy
- type Upload
- type UploadSession
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Message string `json:"message"`
Type string `json:"type"`
Code int `json:"code"`
ErrorSubcode int `json:"error_subcode"`
IsTransient bool `json:"is_transient"`
ErrorUserTitle string `json:"error_user_title"`
ErrorUserMsg string `json:"error_user_msg"`
FBTraceID string `json:"fbtrace_id"`
}
APIError is a facebook API error
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
AccessToken string `json:"access_token"`
Picture string `json:"picture"`
}
Account is a user/page account
func (*Account) UnmarshalJSON ¶
UnmarshalJSON override
type AdAccount ¶
AdAccount is the user Ad Account
func (*AdAccount) UnmarshalJSON ¶
UnmarshalJSON override
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Facebook API client
func (*Client) CreateAlbum ¶
CreateAlbum creates a new Album
func (*Client) Execute ¶
func (c *Client) Execute(method, path string, params map[string]interface{}, r interface{}, u ...Upload) error
Execute is the general method to call the API with the selected method/path. Response is unmarshalled inside r (that must be a pointer)
func (*Client) UploadVideo ¶
func (c *Client) UploadVideo(u *UploadSession) error
UploadVideo creates a new upload session
func (*Client) UserProfile ¶
func (c *Client) UserProfile(userID string) (*UserProfile, error)
UserProfile returns a UserProfile
type Upload ¶
type Upload struct {
Name string
FileName string
Data io.ReadSeeker
From, To int64
}
Upload is a chunked upload request
type UploadSession ¶
type UploadSession struct {
AdAccount string `json:"-"`
Path string `json:"-"`
Size int64 `json:"-"`
Success *bool `json:"success"`
Title string `json:"title"`
Descr string `json:"description"`
UploadSessionID string `json:"upload_session_id"`
VideoID string `json:"video_id"`
StartOffset int64 `json:"start_offset"`
EndOffset int64 `json:"end_offset"`
}
UploadSession is the start of a Download
func (*UploadSession) Progress ¶
func (u *UploadSession) Progress() float64
Progress returns a value between 0 and 1
func (*UploadSession) UnmarshalJSON ¶
func (u *UploadSession) UnmarshalJSON(b []byte) error
UnmarshalJSON override
type UserProfile ¶
type UserProfile struct {
ID string `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Picture string `json:"picture"`
Accounts []Account `json:"accounts"`
AdAccounts []AdAccount `json:"adaccounts"`
}
UserProfile is Facebook user profile
func (*UserProfile) UnmarshalJSON ¶
func (u *UserProfile) UnmarshalJSON(b []byte) error
UnmarshalJSON override
Click to show internal directories.
Click to hide internal directories.