facebook

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FacebookAPIMeURL = "https://graph.facebook.com/v2.9/me?locale=en_US&fields=name,email,verified,first_name,middle_name,last_name"
)

Variables

This section is empty.

Functions

func DefaultifyConfig

func DefaultifyConfig(cfg *oauth2.Config) *oauth2.Config

Types

type ClientUtil

type ClientUtil struct {
	Client *http.Client
	User   FacebookUserinfo `json:"user,omitempty"`
}

ClientUtil is a client library to retrieve user info from the Facebook API.

func NewClientUtil

func NewClientUtil(client *http.Client) ClientUtil

func (*ClientUtil) GetSCIMUser

func (apiutil *ClientUtil) GetSCIMUser() (scim.User, error)

func (*ClientUtil) GetUserinfo

func (apiutil *ClientUtil) GetUserinfo() (FacebookUserinfo, error)

GetUserinfo retrieves the userinfo from the https://graph.facebook.com/v2.9/{user-id} endpoint.

func (*ClientUtil) SetClient

func (apiutil *ClientUtil) SetClient(client *http.Client)

type FacebookUserinfo

type FacebookUserinfo struct {
	ID         string `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Email      string `json:"email,omitempty"`
	Verified   bool   `json:"verified,omitempty"`
	FirstName  string `json:"first_name,omitempty"`
	MiddleName string `json:"middle_name,omitempty"`
	LastName   string `json:"last_name,omitempty"`
}

Jump to

Keyboard shortcuts

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