add instance_activity/instance_peers command
This commit is contained in:
parent
84ffd85539
commit
0022a53649
3 changed files with 55 additions and 0 deletions
21
cmd/mstdn/cmd_instance_peers.go
Normal file
21
cmd/mstdn/cmd_instance_peers.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/mattn/go-mastodon"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func cmdInstancePeers(c *cli.Context) error {
|
||||
client := c.App.Metadata["client"].(*mastodon.Client)
|
||||
peers, err := client.GetInstancePeers(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, peer := range peers {
|
||||
fmt.Fprintln(c.App.Writer, peer)
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue