Generic Go client for the Egnyte Public API. Policy-free: you name the fields, you interpret the values. Built for SCJ's identity-sync; suitable for general use. Read-only user directory access.
go get github.com/scjalliance/egnyte
c, err := egnyte.New(egnyte.Config{Domain: "acme", ClientID: id, ClientSecret: secret})
if err != nil { /* ... */ }
if err := c.Authenticate(ctx, username, password); err != nil { /* ... */ }
users, err := c.ListAllUsers(ctx) // paginates transparently
// one user:
u, err := c.GetUser(ctx, 12345)
Errors are typed — *egnyte.APIError carries the HTTP status and, when present,
the X-Mashery-Error-Code.