Go client for the Write.as API https://developers.write.as

user.go 951B

12345678910111213141516171819202122232425262728293031323334
  1. package writeas
  2. import "time"
  3. type (
  4. // AuthUser represents a just-authenticated user. It contains information
  5. // that'll only be returned once (now) per user session.
  6. AuthUser struct {
  7. AccessToken string `json:"access_token,omitempty"`
  8. Password string `json:"password,omitempty"`
  9. User *User `json:"user"`
  10. }
  11. // User represents a registered Write.as user.
  12. User struct {
  13. Username string `json:"username"`
  14. Email string `json:"email"`
  15. Created time.Time `json:"created"`
  16. // Optional properties
  17. Subscription *UserSubscription `json:"subscription"`
  18. }
  19. // UserSubscription contains information about a user's Write.as
  20. // subscription.
  21. UserSubscription struct {
  22. Name string `json:"name"`
  23. Begin time.Time `json:"begin"`
  24. End time.Time `json:"end"`
  25. AutoRenew bool `json:"auto_renew"`
  26. Active bool `json:"is_active"`
  27. Delinquent bool `json:"is_delinquent"`
  28. }
  29. )