Update: support configuration
This exposes settings for clients, so it's nice to be able to access it directly.
This commit is contained in:
parent
29bb16009b
commit
3203150fd3
2 changed files with 27 additions and 2 deletions
16
instance.go
16
instance.go
|
@ -17,6 +17,17 @@ type Instance struct {
|
|||
Stats *InstanceStats `json:"stats,omitempty"`
|
||||
Languages []string `json:"languages"`
|
||||
ContactAccount *Account `json:"contact_account"`
|
||||
Configuration *InstanceConfig `json:"configuration"`
|
||||
}
|
||||
|
||||
type InstanceConfigMap map[string]int
|
||||
|
||||
// InstanceConfig holds configuration accessible for clients.
|
||||
type InstanceConfig struct {
|
||||
Accounts *InstanceConfigMap `json:"accounts"`
|
||||
Statuses *InstanceConfigMap `json:"statuses"`
|
||||
MediaAttachments map[string]interface{} `json:"media_attachments"`
|
||||
Polls *InstanceConfigMap `json:"polls"`
|
||||
}
|
||||
|
||||
// InstanceStats holds information for mastodon instance stats.
|
||||
|
@ -36,6 +47,11 @@ func (c *Client) GetInstance(ctx context.Context) (*Instance, error) {
|
|||
return &instance, nil
|
||||
}
|
||||
|
||||
// GetConfig returns InstanceConfig.
|
||||
func (c *Instance) GetConfig() *InstanceConfig {
|
||||
return c.Configuration
|
||||
}
|
||||
|
||||
// WeeklyActivity holds information for mastodon weekly activity.
|
||||
type WeeklyActivity struct {
|
||||
Week Unixtime `json:"week"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue