types.go
changeset 239 ca5639b4768e
parent 236 5b87cc73ed97
equal deleted inserted replaced
238:1c0042e76902 239:ca5639b4768e
     9 
     9 
    10 import (
    10 import (
    11 	"time"
    11 	"time"
    12 )
    12 )
    13 
    13 
    14 // ActivityTime is a custom type for the time returned by instance/activity
    14 // MastodonDate is a custom type for the timestamps returned by some API calls
    15 type ActivityTime struct {
    15 type MastodonDate struct {
    16 	time.Time
    16 	time.Time
    17 }
    17 }
    18 
    18 
    19 // Client contains data for a madon client application
    19 // Client contains data for a madon client application
    20 type Client struct {
    20 type Client struct {
   232 // Tag represents a Mastodon tag entity
   232 // Tag represents a Mastodon tag entity
   233 type Tag struct {
   233 type Tag struct {
   234 	Name    string `json:"name"`
   234 	Name    string `json:"name"`
   235 	URL     string `json:"url"`
   235 	URL     string `json:"url"`
   236 	History []struct {
   236 	History []struct {
   237 		Day      int64 `json:"day"`
   237 		Day      MastodonDate `json:"day"`
   238 		Uses     int64 `json:"uses"`
   238 		Uses     int64        `json:"uses,string"`
   239 		Accounts int64 `json:"accounts"`
   239 		Accounts int64        `json:"accounts,string"`
   240 	} `json:"history"`
   240 	} `json:"history"`
   241 }
   241 }
   242 
   242 
   243 // WeekActivity represents a Mastodon instance activity "week" entity
   243 // WeekActivity represents a Mastodon instance activity "week" entity
   244 type WeekActivity struct {
   244 type WeekActivity struct {
   245 	Week          ActivityTime `json:"week"`
   245 	Week          MastodonDate `json:"week"`
   246 	Statuses      int64        `json:"statuses,string"`
   246 	Statuses      int64        `json:"statuses,string"`
   247 	Logins        int64        `json:"logins,string"`
   247 	Logins        int64        `json:"logins,string"`
   248 	Registrations int64        `json:"registrations,string"`
   248 	Registrations int64        `json:"registrations,string"`
   249 }
   249 }
   250 
   250