facebook

package
v0.0.0-...-3518944 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2017 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Authorization = "https://www.facebook.com/dialog/oauth"
	Exchange      = "https://graph.facebook.com/oauth/access_token"
)

Variables

This section is empty.

Functions

func Authorize

func Authorize(app *App, permissions []string) (*oauth2.Token, error)

func Code

func Code(r *http.Request) string

Types

type App

type App struct {
	*oauth2.Client
}

func (*App) AccountToken

func (app *App) AccountToken(token *oauth2.Token, accountId string) (*oauth2.Token, error)

func (*App) Clone

func (a *App) Clone(ctx httpclient.Context) *App

func (*App) Comments

func (a *App) Comments(url string) ([]*Comment, error)

func (*App) Extend

func (app *App) Extend(token *oauth2.Token) (*oauth2.Token, error)

func (*App) Get

func (app *App) Get(path string, data url.Values, accessToken string, out interface{}) error

func (*App) Parse

func (a *App) Parse(s string) error

func (*App) ParseSignedRequest

func (app *App) ParseSignedRequest(req string) (map[string]interface{}, error)

func (*App) Post

func (app *App) Post(path string, data url.Values, accessToken string, out interface{}) error

type Comment

type Comment struct {
	Id        string
	From      string
	FromId    string
	Message   string
	Created   time.Time
	LikeCount int
	Comments  []*Comment /* replies */
}

type Error

type Error struct {
	Type    string
	Message string
}

func (Error) Error

func (e Error) Error() string

type ErrorContainer

type ErrorContainer struct {
	Error Error
}

type Person

type Person struct {
	Id          string   `json:"id"`
	FirstName   string   `json:"first_name"`
	Gender      string   `json:"gender"`
	LastName    string   `json:"last_name"`
	Link        string   `json:"link"`
	Locale      string   `json:"locale"`
	MiddleName  string   `json:"middle_name"`
	Name        string   `json:"name"`
	Timezone    float64  `json:"timezone"`
	Username    string   `json:"username"`
	Email       string   `json:"email"`
	UpdatedTime string   `json:"updated_time"`
	Verified    bool     `json:"verified"`
	Picture     *Picture `json:"picture"`
}

type Picture

type Picture struct {
	Data *PictureData `json:"data"`
}

type PictureData

type PictureData struct {
	IsSilhouette bool   `json:"is_silhouette"`
	URL          string `json:"url"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL