Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FacebookClient ¶
type FacebookClient struct {
// contains filtered or unexported fields
}
the package defines a struct FacebookClient that holds the facebook-go-sdk client and it also defines two methods GetAccessToken
FacebookClient is a struct that holds the facebook client
func NewFacebookClient ¶
func NewFacebookClient(appID, appSecret string) (*FacebookClient, error)
NewFacebookClient creates and returns a new FacebookClient
func (*FacebookClient) ChangePostPrivacy ¶
func (f *FacebookClient) ChangePostPrivacy(postID string, privacy string) error
ChangePostPrivacy changes the privacy of a post on Facebook
This function takes a postID and a privacy as parameters, it uses the f.client.Post(postID, url.Values{"privacy": {privacy}}) function to change the privacy of the post on Facebook. It returns error if it fails otherwise it will return nil The privacy parameter can take values such as EVERYONE, FRIENDS or CUSTOM and you can find more options of privacy on the Facebook documentation
func (*FacebookClient) DeletePost ¶
func (f *FacebookClient) DeletePost(postID string) error
DeletePost deletes a post on Facebook
This function takes a postID as a parameter, it uses the f.client.Delete(postID) function to delete the post on Facebook. It returns error if it fails otherwise it will return nil
func (*FacebookClient) GetAccessToken ¶
func (f *FacebookClient) GetAccessToken() error
GetAccessToken gets an access token
func (*FacebookClient) PostMessage ¶
func (f *FacebookClient) PostMessage(message string) error
PostMessage posts a message on facebook