this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

goat: support #sync event

+19
+19
cmd/goat/firehose.go
··· 122 122 } 123 123 return nil 124 124 }, 125 + RepoSync: func(evt *comatproto.SyncSubscribeRepos_Sync) error { 126 + slog.Debug("sync event", "did", evt.Did, "seq", evt.Seq) 127 + if !gfc.AccountsOnly && !gfc.OpsMode { 128 + return gfc.handleSyncEvent(ctx, evt) 129 + } 130 + return nil 131 + }, 125 132 RepoIdentity: func(evt *comatproto.SyncSubscribeRepos_Identity) error { 126 133 slog.Debug("identity event", "did", evt.Did, "seq", evt.Seq) 127 134 if !gfc.OpsMode { ··· 163 170 func (gfc *GoatFirehoseConsumer) handleAccountEvent(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Account) error { 164 171 out := make(map[string]interface{}) 165 172 out["type"] = "account" 173 + out["payload"] = evt 174 + b, err := json.Marshal(out) 175 + if err != nil { 176 + return err 177 + } 178 + fmt.Println(string(b)) 179 + return nil 180 + } 181 + 182 + func (gfc *GoatFirehoseConsumer) handleSyncEvent(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Sync) error { 183 + out := make(map[string]interface{}) 184 + out["type"] = "sync" 166 185 out["payload"] = evt 167 186 b, err := json.Marshal(out) 168 187 if err != nil {