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.

38 lines
1004 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. BaseURL string `json:"baseUrl,omitempty"`
  10. AccessToken string `json:"access_token,omitempty"`
  11. Password string `json:"password,omitempty"`
  12. User *User `json:"user"`
  13. }
  14. // User represents a registered Write.as user.
  15. User struct {
  16. Username string `json:"username"`
  17. Email string `json:"email"`
  18. Created time.Time `json:"created"`
  19. // Optional properties
  20. Subscription *UserSubscription `json:"subscription"`
  21. }
  22. // UserSubscription contains information about a user's Write.as
  23. // subscription.
  24. UserSubscription struct {
  25. Name string `json:"name"`
  26. Begin time.Time `json:"begin"`
  27. End time.Time `json:"end"`
  28. AutoRenew bool `json:"auto_renew"`
  29. Active bool `json:"is_active"`
  30. Delinquent bool `json:"is_delinquent"`
  31. }
  32. )