diff options
author | 2022-06-23 16:54:54 +0200 | |
---|---|---|
committer | 2022-06-23 16:54:54 +0200 | |
commit | 5f00d4980bdc55bce8d23e38392b345d525dbf4a (patch) | |
tree | 5300f3bbe38d7fcbf5ba07eda2c8c2142c573040 /testrig/testmodels.go | |
parent | [bugfix] Don't remove jpeg orientation metadata (#663) (diff) | |
download | gotosocial-5f00d4980bdc55bce8d23e38392b345d525dbf4a.tar.xz |
[feature] Implement `/api/v1/instance/peers` endpoint (#660)
* add missing license headers
* start adding instance peers get
* rename domainblock.go
* embed domain in domainblock so it can be reused
* update swagger docs
* add test instances to db
* update tests
* add/update instancepeersget
* update domain model
* add getinstancepeers to db
* instance-expose-peers, instance-expose-suspended
* add auth checks for both current filters
* attach endpoint to router
* include public comment
* obfuscate domain if required
* go mod tidy
* update swagger docs
* remove unnecessary comment
* return 'flat' peerlist if no query params provided
Diffstat (limited to 'testrig/testmodels.go')
-rw-r--r-- | testrig/testmodels.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testrig/testmodels.go b/testrig/testmodels.go index e734ff255..bca894266 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -936,10 +936,31 @@ func NewTestEmojis() map[string]*gtsmodel.Emoji { } } +func NewTestInstances() map[string]*gtsmodel.Instance { + return map[string]*gtsmodel.Instance{ + "fossbros-anonymous.io": { + ID: "01G5H6YMJQKR86QZKXXQ2S95FZ", + CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"), + UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"), + Domain: "fossbros-anonymous.io", + URI: "http://fossbros-anonymous.io", + }, + "example.org": { + ID: "01G5H71G52DJKVBYKXPNPNDN1G", + CreatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + UpdatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + Domain: "example.org", + URI: "http://example.org", + }, + } +} + func NewTestDomainBlocks() map[string]*gtsmodel.DomainBlock { return map[string]*gtsmodel.DomainBlock{ "replyguys.com": { ID: "01FF22EQM7X8E3RX1XGPN7S87D", + CreatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + UpdatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), Domain: "replyguys.com", CreatedByAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", PrivateComment: "i blocked this domain because they keep replying with pushy + unwarranted linux advice", |