Documentation
¶
Overview ¶
Package geni is a Go client for the Geni.com genealogy API.
geni.Client is a thin façade: it constructs one shared HTTP transport and exposes a per-resource client for each of Geni's resources via an accessor method (Profile, Union, Document, Photo, Video, PhotoAlbum, Project, Surname, Revision, Stats, User, Search, Tree). Each accessor returns a *Client from the matching sub-package — e.g. Client.Profile() returns a *profile.Client.
Callers that only need one resource can import that sub-package directly and construct its client from a *transport.Client; the façade is an ergonomic aggregate, not a required entry point.
Index ¶
- Variables
- func BaseURL(useSandboxEnv bool) string
- type Client
- func (c *Client) Document() *document.Client
- func (c *Client) Photo() *photo.Client
- func (c *Client) PhotoAlbum() *photoalbum.Client
- func (c *Client) Profile() *profile.Client
- func (c *Client) Project() *project.Client
- func (c *Client) Revision() *revision.Client
- func (c *Client) Search() *search.Client
- func (c *Client) Stats() *stats.Client
- func (c *Client) Surname() *surname.Client
- func (c *Client) Tree() *tree.Client
- func (c *Client) Union() *union.Client
- func (c *Client) User() *user.Client
- func (c *Client) Video() *video.Client
Constants ¶
This section is empty.
Variables ¶
var ErrAccessDenied = transport.ErrAccessDenied
ErrAccessDenied is returned for 403 responses from the Geni API. Re-exported from the transport package.
var ErrResourceNotFound = transport.ErrResourceNotFound
ErrResourceNotFound is returned for 404 responses from the Geni API. Re-exported from the transport package so callers can errors.Is against geni.ErrResourceNotFound without importing transport.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Geni API façade. It owns one shared transport and one client per resource; reach a resource through its accessor (e.g. Client.Profile).
func NewClient ¶
func NewClient(tokenSource oauth2.TokenSource, useSandboxEnv bool) *Client
NewClient constructs a Client. useSandboxEnv selects between sandbox.geni.com (true) and www.geni.com (false).
func (*Client) Document ¶ added in v1.0.0
Document returns the client for the Document resource — including the profile-scoped ForProfile / AddToProfile listings and the project-scoped AddToProject.
func (*Client) Photo ¶ added in v1.0.0
Photo returns the client for the Photo resource — including the profile-scoped ForProfile / AddToProfile / AddMugshotToProfile operations.
func (*Client) PhotoAlbum ¶ added in v1.0.0
func (c *Client) PhotoAlbum() *photoalbum.Client
PhotoAlbum returns the client for the PhotoAlbum resource.
func (*Client) Profile ¶ added in v1.0.0
Profile returns the client for the Profile resource — CRUD, relationship adds (partner / child / sibling / parent), merge, follow / unfollow, basics-update, and event-date wiping.
func (*Client) Stats ¶ added in v1.0.0
Stats returns the client for the platform-wide statistics endpoint.
func (*Client) Tree ¶ added in v1.0.0
Tree returns the client for Geni's family-graph endpoints — immediate-family, ancestors, path-to, and compare.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
geni
command
Command geni is a command-line client for the Geni.com genealogy API.
|
Command geni is a command-line client for the Geni.com genealogy API. |
|
Package comment carries the Comment resource's wire types.
|
Package comment carries the Comment resource's wire types. |
|
Package document carries the Document resource's wire types.
|
Package document carries the Document resource's wire types. |
|
examples
|
|
|
getprofile
command
Command getprofile is a minimal smoke example that constructs a go-geni Client against the sandbox and fetches a single profile.
|
Command getprofile is a minimal smoke example that constructs a go-geni Client against the sandbox and fetches a single profile. |
|
listmanaged
command
Command listmanaged streams every Geni profile managed by the authenticated user as one JSON object per line on stdout.
|
Command listmanaged streams every Geni profile managed by the authenticated user as one JSON object per line on stdout. |
|
refreshtoken
command
Command refreshtoken runs the same OAuth implicit-flow handshake as the terraform-provider-genealogy uses, then writes the resulting token to ~/.genealogy/geni_token.json (prod) or geni_sandbox_token.json (sandbox).
|
Command refreshtoken runs the same OAuth implicit-flow handshake as the terraform-provider-genealogy uses, then writes the resulting token to ~/.genealogy/geni_token.json (prod) or geni_sandbox_token.json (sandbox). |
|
webdocumenttext
command
Command webdocumenttext is a smoke example for the AJAX Web client's document-text endpoints.
|
Command webdocumenttext is a smoke example for the AJAX Web client's document-text endpoints. |
|
webrevisions
command
Command webrevisions is a smoke example for the AJAX Web client's revision endpoint.
|
Command webrevisions is a smoke example for the AJAX Web client's revision endpoint. |
|
Package photo carries the Photo resource's wire types.
|
Package photo carries the Photo resource's wire types. |
|
Package photoalbum carries the PhotoAlbum resource's wire types.
|
Package photoalbum carries the PhotoAlbum resource's wire types. |
|
Package profile carries the Profile resource's wire types.
|
Package profile carries the Profile resource's wire types. |
|
Package project carries the Project resource's wire types.
|
Package project carries the Project resource's wire types. |
|
Package revision wraps Geni's Revision resource — a single edit in a profile or tree's history.
|
Package revision wraps Geni's Revision resource — a single edit in a profile or tree's history. |
|
Package search wraps Geni's /profile/search endpoint — name-based profile discovery.
|
Package search wraps Geni's /profile/search endpoint — name-based profile discovery. |
|
Package stats wraps Geni's /stats endpoint — the platform-wide statistics list.
|
Package stats wraps Geni's /stats endpoint — the platform-wide statistics list. |
|
Package surname wraps Geni's Surname resource — a tag for a family name.
|
Package surname wraps Geni's Surname resource — a tag for a family name. |
|
Package transport owns the cross-cutting HTTP layer for go-geni: access-token injection, rate limiting (with dynamic re-tuning from X-API-Rate-* response headers), retry on transient errors / 429 / 401, error sentinels for 403 (ErrAccessDenied) and 404 (ErrResourceNotFound), and bulk-read coalescing via the Coalescer interface (see BulkCoalescer for the generic implementation).
|
Package transport owns the cross-cutting HTTP layer for go-geni: access-token injection, rate limiting (with dynamic re-tuning from X-API-Rate-* response headers), retry on transient errors / 429 / 401, error sentinels for 403 (ErrAccessDenied) and 404 (ErrResourceNotFound), and bulk-read coalescing via the Coalescer interface (see BulkCoalescer for the generic implementation). |
|
Package tree wraps Geni's family-graph endpoints — immediate-family, ancestors, and path-to.
|
Package tree wraps Geni's family-graph endpoints — immediate-family, ancestors, and path-to. |
|
Package union carries the Union resource's wire types.
|
Package union carries the Union resource's wire types. |
|
Package user wraps Geni's User resource and all /user/* endpoints — the authenticated user's account plus their followed listings, uploaded media, and metadata.
|
Package user wraps Geni's User resource and all /user/* endpoints — the authenticated user's account plus their followed listings, uploaded media, and metadata. |
|
Package video carries the Video resource's wire types.
|
Package video carries the Video resource's wire types. |
|
Package web is a Go client for Geni.com's internal AJAX endpoints — the same calls the geni.com website makes from a logged-in browser.
|
Package web is a Go client for Geni.com's internal AJAX endpoints — the same calls the geni.com website makes from a logged-in browser. |
|
browsercookies
Package browsercookies is an OPT-IN helper for bootstrapping Options.Cookies from a logged-in browser session on the host machine.
|
Package browsercookies is an OPT-IN helper for bootstrapping Options.Cookies from a logged-in browser session on the host machine. |
|
conflicts
Package conflicts exposes the website-only "data conflicts" feature — the unresolved field disagreements Geni leaves behind after a profile merge (conflicting names, dates, residence).
|
Package conflicts exposes the website-only "data conflicts" feature — the unresolved field disagreements Geni leaves behind after a profile merge (conflicting names, dates, residence). |
|
document
Package document exposes the website-only document text-body endpoints.
|
Package document exposes the website-only document text-body endpoints. |
|
internal/htmlparse
Package htmlparse contains small HTML extraction helpers used by the AJAX Web client.
|
Package htmlparse contains small HTML extraction helpers used by the AJAX Web client. |
|
matches
Package matches exposes the website-only Merge Center list.
|
Package matches exposes the website-only Merge Center list. |
|
revision
Package revision exposes the website-only revision-history endpoint.
|
Package revision exposes the website-only revision-history endpoint. |
|
unions
Package unions exposes the website-only "remove relationships" action.
|
Package unions exposes the website-only "remove relationships" action. |