Go client for the Write.as API https://developers.write.as
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
956 B

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