MCPcopy Create free account
hub / github.com/davecheney/pub / Run

Method Run

showactor.go:18–32  ·  view source on GitHub ↗
(ctx *Context)

Source from the content-addressed store, hash-verified

16}
17
18func (s *ShowActorCmd) Run(ctx *Context) error {
19 db, err := gorm.Open(ctx.Dialector, &ctx.Config)
20 if err != nil {
21 return err
22 }
23
24 actor, err := models.NewActors(db).FindByURI(s.Actor)
25 if err != nil {
26 return fmt.Errorf("failed to find actor %s: %w", s.Actor, err)
27 }
28
29 req, _ := http.NewRequest("GET", actor.URI, nil)
30 ser := mastodon.NewSerialiser(req)
31 return json.MarshalFull(os.Stdout, ser.Account(actor))
32}

Callers

nothing calls this directly

Calls 5

AccountMethod · 0.95
NewActorsFunction · 0.92
NewSerialiserFunction · 0.92
FindByURIMethod · 0.45
URIMethod · 0.45

Tested by

no test coverage detected