How huandu/facebook works
This is a Go SDK for Facebook’s Graph API. The principal workflow is to create request parameters, issue a call through the default API facade or an App-backed Session, communicate with Facebook, and decode the response as a Result. The SDK also supports App authentication flows, batch requests and file uploads, and paging through results. The excerpts show the main API, session, parameter, and result responsibilities; some implementation details are unsampled, so those connections are omitted where evidence is unavailable.
Main entry points: session.go Session client · result.go Graph result · params.go Request parameters · paging_result.go Page navigation
Components 14
Client setup
- Default API
api.go - App credentials
app.go
Request handling
- Session client
session.go - Request parameters
params.go - Field conversion
conversion.go - Upload data
filedata.go - HTTP service
session.go
Response handling
- Graph result
result.go - API errors
error.go
API features
- Page navigation
paging_result.go - Batch requests
session.go - Batch response
batch_result.go
Other components
- Go application
- Facebook Graph API
Connections 17
- Go application → Default API: calls
api.go - Go application → App credentials: configures
README.md - App credentials → Session client: creates
app.go - Default API → Session client: delegates to
api.go - Go application → Session client: calls
README.md - Session client → Request parameters: prepares
session.go - Request parameters → Field conversion: converts names
params.go - Request parameters → Upload data: encodes uploads
params.go - Session client → HTTP service: sends requests
session.go - HTTP service → Facebook Graph API: HTTP requests
README.md - Session client → Graph result: parses response
session.go - Go application → Graph result: decodes fields
README.md - Go application → Page navigation: walks pages
README.md - Page navigation → Session client: requests next page
paging_result.go - Page navigation → Graph result: decodes page
paging_result.go - Go application → Batch requests: submits batch
- Graph result → Batch response: parses batch body
batch_result.go