(logger slog.Logger, ps dbpubsub.Pubsub, kind pubsub.ChatConfigEventKind, entityID uuid.UUID)
| 139 | } |
| 140 | |
| 141 | func publishChatConfigEvent(logger slog.Logger, ps dbpubsub.Pubsub, kind pubsub.ChatConfigEventKind, entityID uuid.UUID) { |
| 142 | payload, err := json.Marshal(pubsub.ChatConfigEvent{ |
| 143 | Kind: kind, |
| 144 | EntityID: entityID, |
| 145 | }) |
| 146 | if err != nil { |
| 147 | logger.Error(context.Background(), "failed to marshal chat config event", |
| 148 | slog.F("kind", kind), |
| 149 | slog.F("entity_id", entityID), |
| 150 | slog.Error(err), |
| 151 | ) |
| 152 | return |
| 153 | } |
| 154 | if err := ps.Publish(pubsub.ChatConfigEventChannel, payload); err != nil { |
| 155 | logger.Error(context.Background(), "failed to publish chat config event", |
| 156 | slog.F("kind", kind), |
| 157 | slog.F("entity_id", entityID), |
| 158 | slog.Error(err), |
| 159 | ) |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 164 | // |
no test coverage detected