types.go
author Mikael Berthe <mikael@lilotux.net>
Sun, 28 May 2017 10:33:27 +0200
changeset 192 87eda713b614
parent 190 0684ddad598c
child 196 21519d54dd4c
permissions -rw-r--r--
Version 1.6.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     1
/*
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     2
Copyright 2017 Ollivier Robert
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     3
Copyright 2017 Mikael Berthe
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     4
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     5
Licensed under the MIT license.  Please see the LICENSE file is this directory.
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     6
*/
c450bb73f59a Update credits
Mikael Berthe <mikael@lilotux.net>
parents: 123
diff changeset
     7
138
23d3a518d0ad Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents: 136
diff changeset
     8
package madon
7
0fbbac6d8e8c We have an skeleton now.
Ollivier Robert <roberto@keltia.net>
parents:
diff changeset
     9
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    10
import (
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    11
	"time"
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    12
)
16
9d64e00d3ea6 Begin to fill in types.
Ollivier Robert <roberto@keltia.net>
parents: 10
diff changeset
    13
138
23d3a518d0ad Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents: 136
diff changeset
    14
// Client contains data for a madon client application
74
ba06092b91a6 Rename "Gondole" as "Client" to avoid "gondole.Gondole".
Ollivier Robert <roberto@keltia.net>
parents: 70
diff changeset
    15
type Client struct {
131
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    16
	Name        string // Name of the client
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    17
	ID          string // Application ID
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    18
	Secret      string // Application secret
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    19
	APIBase     string // API prefix URL
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    20
	InstanceURL string // Instance base URL
85
abf0f5e40281 Initial login support
Mikael Berthe <mikael@lilotux.net>
parents: 83
diff changeset
    21
131
68ef6504637e Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents: 130
diff changeset
    22
	UserToken *UserToken // User token
10
bb83de52ba5f Adding types.
Ollivier Robert <roberto@keltia.net>
parents: 7
diff changeset
    23
}
bb83de52ba5f Adding types.
Ollivier Robert <roberto@keltia.net>
parents: 7
diff changeset
    24
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    25
/*
138
23d3a518d0ad Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents: 136
diff changeset
    26
Entities - Everything manipulated/returned by the API
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    27
*/
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    28
187
e1b1f4a168b7 Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents: 186
diff changeset
    29
// DomainName is a domain name string, as returned by the domain_blocks API
e1b1f4a168b7 Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents: 186
diff changeset
    30
type DomainName string
e1b1f4a168b7 Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents: 186
diff changeset
    31
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    32
// Account represents a Mastodon account entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    33
type Account struct {
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
    34
	ID             int64     `json:"id"`
136
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    35
	Username       string    `json:"username"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    36
	Acct           string    `json:"acct"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    37
	DisplayName    string    `json:"display_name"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    38
	Note           string    `json:"note"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    39
	URL            string    `json:"url"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    40
	Avatar         string    `json:"avatar"`
182
d360e5a41070 Update types
Mikael Berthe <mikael@lilotux.net>
parents: 181
diff changeset
    41
	AvatarStatic   string    `json:"avatar_static"`
d360e5a41070 Update types
Mikael Berthe <mikael@lilotux.net>
parents: 181
diff changeset
    42
	HeaderStatic   string    `json:"header_static"`
136
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    43
	Locked         bool      `json:"locked"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
    44
	CreatedAt      time.Time `json:"created_at"`
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
    45
	FollowersCount int64     `json:"followers_count"`
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
    46
	FollowingCount int64     `json:"following_count"`
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
    47
	StatusesCount  int64     `json:"statuses_count"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    48
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    49
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    50
// Application represents a Mastodon application entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    51
type Application struct {
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    52
	Name    string `json:"name"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    53
	Website string `json:"website"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    54
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    55
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    56
// Attachment represents a Mastodon attachement entity
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    57
type Attachment struct {
190
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    58
	ID         int64   `json:"id"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    59
	Type       string  `json:"type"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    60
	URL        string  `json:"url"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    61
	RemoteURL  *string `json:"remote_url"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    62
	PreviewURL string  `json:"preview_url"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    63
	TextURL    *string `json:"text_url"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    64
	Meta       *struct {
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    65
		Original struct {
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    66
			Size   string  `json:"size"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    67
			Aspect float64 `json:"aspect"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    68
			Width  int     `json:"width"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    69
			Height int     `json:"height"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    70
		} `json:"original"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    71
		Small struct {
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    72
			Size   string  `json:"size"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    73
			Aspect float64 `json:"aspect"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    74
			Width  int     `json:"width"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    75
			Height int     `json:"height"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    76
		} `json:"small"`
0684ddad598c Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents: 187
diff changeset
    77
	} `json:"meta"`
10
bb83de52ba5f Adding types.
Ollivier Robert <roberto@keltia.net>
parents: 7
diff changeset
    78
}
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    79
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    80
// Card represents a Mastodon card entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
    81
type Card struct {
186
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    82
	URL          string  `json:"url"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    83
	Title        string  `json:"title"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    84
	Description  string  `json:"description"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    85
	Image        string  `json:"image"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    86
	Type         *string `json:"type"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    87
	AuthorName   *string `json:"author_name"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    88
	AuthorURL    *string `json:"author_url"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    89
	ProviderName *string `json:"provider_name"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    90
	ProviderURL  *string `json:"provider_url"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    91
	HTML         *string `json:"html"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    92
	Width        *int    `json:"width"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
    93
	Height       *int    `json:"height"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    94
}
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    95
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    96
// Context represents a Mastodon context entity
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    97
type Context struct {
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
    98
	Ancestors   []Status `json:"ancestors"`
175
2541f5050df3 Fix Descendants spelling
Mikael Berthe <mikael@lilotux.net>
parents: 172
diff changeset
    99
	Descendants []Status `json:"descendants"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   100
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   101
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   102
// Error represents a Mastodon error entity
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   103
type Error struct {
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   104
	Text string `json:"error"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   105
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   106
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   107
// Instance represents a Mastodon instance entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   108
type Instance struct {
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   109
	URI         string `json:"uri"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   110
	Title       string `json:"title"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   111
	Description string `json:"description"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   112
	Email       string `json:"email"`
147
b682706e2f31 Add version filed (Mastodon 1.3+) to the Instance type
Mikael Berthe <mikael@lilotux.net>
parents: 138
diff changeset
   113
	Version     string `json:"version"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   114
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   115
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   116
// Mention represents a Mastodon mention entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   117
type Mention struct {
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   118
	ID       int64  `json:"id"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   119
	URL      string `json:"url"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   120
	Username string `json:"username"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   121
	Acct     string `json:"acct"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   122
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   123
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   124
// Notification represents a Mastodon notification entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   125
type Notification struct {
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   126
	ID        int64     `json:"id"`
136
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
   127
	Type      string    `json:"type"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
   128
	CreatedAt time.Time `json:"created_at"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
   129
	Account   *Account  `json:"account"`
1af0a6199a93 Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents: 133
diff changeset
   130
	Status    *Status   `json:"status"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   131
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   132
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   133
// Relationship represents a Mastodon relationship entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   134
type Relationship struct {
186
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   135
	ID             int64 `json:"id"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   136
	Following      bool  `json:"following"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   137
	FollowedBy     bool  `json:"followed_by"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   138
	Blocking       bool  `json:"blocking"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   139
	Muting         bool  `json:"muting"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   140
	Requested      bool  `json:"requested"`
eb9e257ba50c Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents: 185
diff changeset
   141
	DomainBlocking bool  `jsin:"domain_blocking"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   142
}
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   143
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   144
// Report represents a Mastodon report entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   145
type Report struct {
172
1f8ea3aa20e7 Fix case mistakes in JSON tags
Mikael Berthe <mikael@lilotux.net>
parents: 159
diff changeset
   146
	ID          int64  `json:"id"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   147
	ActionTaken string `json:"action_taken"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   148
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   149
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   150
// Results represents a Mastodon results entity
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   151
type Results struct {
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   152
	Accounts []Account `json:"accounts"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   153
	Statuses []Status  `json:"statuses"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   154
	Hashtags []string  `json:"hashtags"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   155
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   156
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   157
// Status represents a Mastodon status entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   158
type Status struct {
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   159
	ID                 int64        `json:"id"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   160
	URI                string       `json:"uri"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   161
	URL                string       `json:"url"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   162
	Account            *Account     `json:"account"`
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   163
	InReplyToID        int64        `json:"in_reply_to_id"`
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   164
	InReplyToAccountID int64        `json:"in_reply_to_account_id"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   165
	Reblog             *Status      `json:"reblog"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   166
	Content            string       `json:"content"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   167
	CreatedAt          time.Time    `json:"created_at"`
159
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   168
	ReblogsCount       int64        `json:"reblogs_count"`
408aa794d9bb s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents: 147
diff changeset
   169
	FavouritesCount    int64        `json:"favourites_count"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   170
	Reblogged          bool         `json:"reblogged"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   171
	Favourited         bool         `json:"favourited"`
185
faa72b9877c5 Update types (add Muted to Status entity)
Mikael Berthe <mikael@lilotux.net>
parents: 182
diff changeset
   172
	Muted              bool         `json:"muted"`
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   173
	Sensitive          bool         `json:"sensitive"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   174
	SpoilerText        string       `json:"spoiler_text"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   175
	Visibility         string       `json:"visibility"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   176
	MediaAttachments   []Attachment `json:"media_attachments"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   177
	Mentions           []Mention    `json:"mentions"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   178
	Tags               []Tag        `json:"tags"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   179
	Application        Application  `json:"application"`
181
1217aa2a132b Add status language field
Mikael Berthe <mikael@lilotux.net>
parents: 175
diff changeset
   180
	Language           string       `json:"language"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   181
}
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   182
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   183
// Tag represents a Mastodon tag entity
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   184
type Tag struct {
70
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   185
	Name string `json:"name"`
fbc089e7249d Add json tags.
Ollivier Robert <roberto@keltia.net>
parents: 66
diff changeset
   186
	URL  string `json:"url"`
17
9f17ef336aad Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents: 16
diff changeset
   187
}