facebook

package
v0.0.0-...-33997ed Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIServerVersion = "v2.10"

APIServerVersion facebook API version

View Source
var AppID string

AppID facebook app id

View Source
var AppRedirectURL string

AppRedirectURL redirect URL

View Source
var AppSecret string

AppSecret facebook app secret

Functions

func GetLoginURL

func GetLoginURL(scopes []string) string

GetLoginURL gets fb login url

Types

type ErrorResponse

type ErrorResponse struct {
	Error struct {
		Message string `json:"message"`
		Type    string `json:"type"`
		Code    int    `json:"code"`
	}
}

ErrorResponse fb error response

type IdentityResponse

type IdentityResponse struct {
	ErrorResponse
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
}

IdentityResponse fb identity response

type UserResponse

type UserResponse struct {
	ErrorResponse
	Email                string `json:"email"`
	Name                 string `json:"name"`
	ID                   string `json:"id"`
	AccessToken          string
	AccessTokenExpiresIn time.Time
}

UserResponse fb user info response

func GetUserInfo

func GetUserInfo(ctx context.Context, token string, fields []string) (*UserResponse, error)

GetUserInfo gets user info

func LoginUserWithResponseQuery

func LoginUserWithResponseQuery(ctx context.Context, query url.Values) (*UserResponse, error)

LoginUserWithResponseQuery logins user with code

Jump to

Keyboard shortcuts

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