Documentation ¶
Index ¶
- Constants
- type Attachment
- type Client
- func (c *Client) CreateSlideshow(ctx context.Context, id string, params *VideoParams) (string, error)
- func (c *Client) Get(ctx context.Context, path string, query url.Values, v interface{}) error
- func (c *Client) GetMe(ctx context.Context) (*Me, error)
- func (c *Client) GetVideo(ctx context.Context, path string, query url.Values, v interface{}) error
- func (c *Client) Post(ctx context.Context, path string, query url.Values, content interface{}, ...) error
- func (c *Client) PostVideo(ctx context.Context, path string, query url.Values, content interface{}, ...) error
- func (c *Client) PublishPost(ctx context.Context, id string, params *PagePostParams) (*PagePostResponse, error)
- func (c *Client) ScrapeURL(ctx context.Context, urlstr string) (*URLObject, error)
- func (c *Client) SetVersion(v string)
- type Me
- type MultipartParams
- type PagePostParams
- type PagePostResponse
- type SlideshowSpec
- type URLObject
- type VideoParams
Constants ¶
View Source
const LoggerKey = "speedland.net.services.facebook"
LoggerKey is a key for this package
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a API client for facebook graph API.
func (*Client) CreateSlideshow ¶
func (c *Client) CreateSlideshow(ctx context.Context, id string, params *VideoParams) (string, error)
CreateSlideshow creates a slideshow video on the page specified by page id.
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, path string, query url.Values, content interface{}, v interface{}) error
Post to call POST request on the given path with json body specified by `content` argument.
func (*Client) PostVideo ¶
func (c *Client) PostVideo(ctx context.Context, path string, query url.Values, content interface{}, v interface{}) error
PostVideo to call POST request on the given path with json body specified by `content` argument.
func (*Client) PublishPost ¶
func (c *Client) PublishPost(ctx context.Context, id string, params *PagePostParams) (*PagePostResponse, error)
PublishPost publishes a page post on the page specified by page id.
func (*Client) SetVersion ¶
SetVersion specifies the version used for the client.
type MultipartParams ¶
MultipartParams is a struct to upload multipart/form data to the endpoint
type PagePostParams ¶
type PagePostParams struct { Message string `json:"message,omitempty"` Link string `json:"link,omitempty"` ActionLinks []struct { Name string `json:"name,omitempty"` Link string `json:"link,omitempty"` } `json:"action_links,omitempty"` Place string `json:"place,omitempty"` Tags string `json:"string,omitempty"` ObjectAttachment string `json:"object_attachment,omitempty"` Published *bool `json:"published,omitempty"` ScheduledPublishTime int `json:"scheduled_publish_time,omitempty"` BackdatedTime int `json:"backdated_time,omitempty"` BackdatedTimeGranularity string `json:"backdated_time_granularity,omitempty"` ChildAttachments []*Attachment `json:"child_attachments,omitempty"` }
type PagePostResponse ¶
type SlideshowSpec ¶
type URLObject ¶
type URLObject struct { ID string `json:"id"` URL string `json:"url"` Type string `json:"type"` Title string `json:"title"` UpdatedTime *xtime.Timestamp `json:"updated_time"` Image []struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"image,omitempty"` Pages []struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` } `json:"pages,omitempty"` Application struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` } `json:"application,omitempty"` }
URLObject is a object returned by scraping URL
type VideoParams ¶
type VideoParams struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` FileURL string `json:"file_url,omitempty"` Published *bool `json:"published,omitempty"` ScheduledPublishTime *xtime.Timestamp `json:"scheduled_publish_time,omitempty"` SponsorID string `json:"sponsor_id,omitempty"` SlideshowSpec *SlideshowSpec `json:"slideshow_spec,omitempty"` }
func NewSlideshowParams ¶
func NewSlideshowParams(imagesURLs []string) *VideoParams
Click to show internal directories.
Click to hide internal directories.