mail based rss feed aggregator
2
fork

Configure Feed

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

woof.field -> woof.str | woof.int_field -> woof.int | woof.bool_field -> woof.bool

ollie bec31b2c 0dbfd094

+211 -214
+2 -2
src/eater.gleam
··· 117 117 }) 118 118 119 119 woof.set_global_context([ 120 - woof.field("app", "eater"), 121 - woof.field("version", "0.0.1"), 120 + woof.str("app", "eater"), 121 + woof.str("version", "0.0.1"), 122 122 ]) 123 123 } 124 124
+43 -43
src/eater/backend.gleam
··· 143 143 database.add_feed(backend.database, feed) 144 144 |> result.map_error(fn(error) { 145 145 log(woof.Error, "Failed to add feed to database", [ 146 - woof.field("feed-url", feed.link |> uri.to_string()), 147 - woof.field("feed-id", feed.id |> uuid.to_string()), 148 - woof.field("details", string.inspect(error)), 146 + woof.str("feed-url", feed.link |> uri.to_string()), 147 + woof.str("feed-id", feed.id |> uuid.to_string()), 148 + woof.str("details", string.inspect(error)), 149 149 ]) 150 150 Database(FailedToAddFeed) 151 151 }), ··· 156 156 database.add_subscription(backend.database, user, feed) 157 157 |> result.map_error(fn(error) { 158 158 log(woof.Error, "Failed to add subscription to database", [ 159 - woof.field("user-email", user.email), 160 - woof.field("user-id", user.id |> uuid.to_string()), 161 - woof.field("feed-url", feed.link |> uri.to_string()), 162 - woof.field("feed-id", feed.id |> uuid.to_string()), 163 - woof.field("details", string.inspect(error)), 159 + woof.str("user-email", user.email), 160 + woof.str("user-id", user.id |> uuid.to_string()), 161 + woof.str("feed-url", feed.link |> uri.to_string()), 162 + woof.str("feed-id", feed.id |> uuid.to_string()), 163 + woof.str("details", string.inspect(error)), 164 164 ]) 165 165 166 166 Database(FailedToAddSubscription) ··· 187 187 database.delete_subscription(backend.database, user, feed) 188 188 |> result.map_error(fn(error) { 189 189 log(woof.Error, "Failed to add user to database", [ 190 - woof.field("user-email", user.email), 191 - woof.field("user-id", user.id |> uuid.to_string()), 192 - woof.field("details", string.inspect(error)), 190 + woof.str("user-email", user.email), 191 + woof.str("user-id", user.id |> uuid.to_string()), 192 + woof.str("details", string.inspect(error)), 193 193 ]) 194 194 }), 195 195 ) ··· 281 281 database.add_user(user, backend.database) 282 282 |> result.map_error(fn(error) { 283 283 log(woof.Error, "Failed to add user to database", [ 284 - woof.field("user-email", user.email), 285 - woof.field("user-id", user.id |> uuid.to_string()), 286 - woof.field("details", string.inspect(error)), 284 + woof.str("user-email", user.email), 285 + woof.str("user-id", user.id |> uuid.to_string()), 286 + woof.str("details", string.inspect(error)), 287 287 ]) 288 288 }) 289 289 } ··· 294 294 database.all_users(backend.database) 295 295 |> result.map_error(fn(error) { 296 296 log(woof.Error, "Failed to get users from database", [ 297 - woof.field("details", string.inspect(error)), 297 + woof.str("details", string.inspect(error)), 298 298 ]) 299 299 }) 300 300 } ··· 308 308 database.feeds_for_user(backend.database, user) 309 309 |> result.map_error(fn(error) { 310 310 log(woof.Error, "Failed to get feeds for user", [ 311 - woof.field("user-email", user.email), 312 - woof.field("user-id", user.id |> uuid.to_string()), 313 - woof.field("details", string.inspect(error)), 311 + woof.str("user-email", user.email), 312 + woof.str("user-id", user.id |> uuid.to_string()), 313 + woof.str("details", string.inspect(error)), 314 314 ]) 315 315 }) 316 316 } ··· 362 362 fn describe_message(message: Message) -> List(#(String, _)) { 363 363 case message { 364 364 NewSubscription(user, feed) -> [ 365 - woof.field("message", "NewSubscription"), 366 - woof.field("user-id", user.id |> uuid.to_string()), 367 - woof.field("user-email", user.email), 368 - woof.field("feed-id", feed.id |> uuid.to_string()), 369 - woof.field("feed-url", feed.link |> uri.to_string()), 365 + woof.str("message", "NewSubscription"), 366 + woof.str("user-id", user.id |> uuid.to_string()), 367 + woof.str("user-email", user.email), 368 + woof.str("feed-id", feed.id |> uuid.to_string()), 369 + woof.str("feed-url", feed.link |> uri.to_string()), 370 370 ] 371 371 RemoveSubscription(user, feed) -> [ 372 - woof.field("message", "RemoveSubscription"), 373 - woof.field("user-id", user.id |> uuid.to_string()), 374 - woof.field("user-email", user.email), 375 - woof.field("feed-id", feed.id |> uuid.to_string()), 376 - woof.field("feed-url", feed.link |> uri.to_string()), 372 + woof.str("message", "RemoveSubscription"), 373 + woof.str("user-id", user.id |> uuid.to_string()), 374 + woof.str("user-email", user.email), 375 + woof.str("feed-id", feed.id |> uuid.to_string()), 376 + woof.str("feed-url", feed.link |> uri.to_string()), 377 377 ] 378 378 Status(send_to: _) -> [ 379 - woof.field("message", "Status"), 379 + woof.str("message", "Status"), 380 380 ] 381 381 ResetFeed(feed) -> [ 382 - woof.field("message", "ResetFeed"), 383 - woof.field("feed-id", feed.id |> uuid.to_string()), 384 - woof.field("feed-url", feed.link |> uri.to_string()), 382 + woof.str("message", "ResetFeed"), 383 + woof.str("feed-id", feed.id |> uuid.to_string()), 384 + woof.str("feed-url", feed.link |> uri.to_string()), 385 385 ] 386 386 Refetch(feed) -> [ 387 - woof.field("message", "Refetch"), 388 - woof.field("feed-id", feed.id |> uuid.to_string()), 389 - woof.field("feed-url", feed.link |> uri.to_string()), 387 + woof.str("message", "Refetch"), 388 + woof.str("feed-id", feed.id |> uuid.to_string()), 389 + woof.str("feed-url", feed.link |> uri.to_string()), 390 390 ] 391 391 RestartUser(user) -> [ 392 - woof.field("message", "RestartUser"), 393 - woof.field("user-id", user.id |> uuid.to_string()), 394 - woof.field("user-email", user.email), 392 + woof.str("message", "RestartUser"), 393 + woof.str("user-id", user.id |> uuid.to_string()), 394 + woof.str("user-email", user.email), 395 395 ] 396 396 } 397 397 } ··· 506 506 state.logger, 507 507 "Failed get subscriber count from database", 508 508 [ 509 - woof.field("feed", feed.link |> uri.to_string()), 509 + woof.str("feed", feed.link |> uri.to_string()), 510 510 ], 511 511 ), 512 512 ) ··· 526 526 woof.Error, 527 527 "Failed to delete feed from database", 528 528 [ 529 - woof.field("feed-url", feed.link |> uri.to_string()), 530 - woof.field("feed-id", feed.id |> uuid.to_string()), 531 - woof.field("details", string.inspect(error)), 529 + woof.str("feed-url", feed.link |> uri.to_string()), 530 + woof.str("feed-id", feed.id |> uuid.to_string()), 531 + woof.str("details", string.inspect(error)), 532 532 ], 533 533 ) 534 534 actor.stop_abnormal("Failed to delete feed from database") ··· 552 552 ) -> fn(a) -> actor.Next(b, c) { 553 553 fn(error) { 554 554 woof.log(logger, woof.Error, message, [ 555 - woof.field("details", string.inspect(error)), 555 + woof.str("details", string.inspect(error)), 556 556 ..fields 557 557 ]) 558 558 actor.stop_abnormal(message)
+35 -35
src/eater/fetcher.gleam
··· 151 151 152 152 actor.new_with_initialiser(100, fn(self) { 153 153 log(woof.Info, "Starting", [ 154 - woof.field("pid", string.inspect(process.self())), 154 + woof.str("pid", string.inspect(process.self())), 155 155 ]) 156 156 157 157 process.send_after(self, 1000, StartAll) ··· 204 204 ) 205 205 206 206 log(woof.Info, "Fetcher has registered itself", [ 207 - woof.field("feed", feed.link |> uri.to_string()), 208 - woof.field("pid", started.pid |> string.inspect()), 207 + woof.str("feed", feed.link |> uri.to_string()), 208 + woof.str("pid", started.pid |> string.inspect()), 209 209 ]) 210 210 211 211 actor.continue(state) ··· 213 213 214 214 FetcherStarted(Error(start_error), feed) -> { 215 215 log(woof.Error, "Failed to start fetcher", [ 216 - woof.field("feed", feed.link |> uri.to_string()), 217 - woof.field("details", string.inspect(start_error)), 216 + woof.str("feed", feed.link |> uri.to_string()), 217 + woof.str("details", string.inspect(start_error)), 218 218 ]) 219 219 220 220 actor.stop_abnormal( ··· 335 335 let started = 336 336 actor.new_with_initialiser(100, fn(self) { 337 337 log(woof.Info, "Starting", [ 338 - woof.field("feed", feed.link |> uri.to_string()), 339 - woof.field("pid", string.inspect(process.self())), 338 + woof.str("feed", feed.link |> uri.to_string()), 339 + woof.str("pid", string.inspect(process.self())), 340 340 ]) 341 341 342 342 let fetch_timer = case ··· 350 350 |> timestamp.difference(timestamp.system_time()) 351 351 352 352 log(woof.Info, "Next check is at", [ 353 - woof.field( 353 + woof.str( 354 354 "timestamp", 355 355 feed.next_check |> timestamp.to_rfc3339(calendar.local_offset()), 356 356 ), ··· 395 395 // gets periodically raised to check our feed 396 396 CheckFeed -> { 397 397 log(woof.Info, "Checking feed", [ 398 - woof.field("feed", state.feed.link |> uri.to_string()), 398 + woof.str("feed", state.feed.link |> uri.to_string()), 399 399 ]) 400 400 401 401 // if we've failed to fetch the feed too many times ··· 432 432 ) 433 433 434 434 log(woof.Info, "Next check is at", [ 435 - woof.field( 435 + woof.str( 436 436 "timestamp", 437 437 feed.next_check 438 438 |> timestamp.to_rfc3339(calendar.local_offset()), ··· 448 448 case pubsub.subscriber_count_feed(state.feed, state.registry) { 449 449 [] -> { 450 450 log(woof.Warning, "Skipping", [ 451 - woof.field("feed-url", state.feed.link |> uri.to_string()), 452 - woof.field("feed-id", state.feed.id |> uuid.to_string()), 453 - woof.field("reason", "No sender is subscribed"), 451 + woof.str("feed-url", state.feed.link |> uri.to_string()), 452 + woof.str("feed-id", state.feed.id |> uuid.to_string()), 453 + woof.str("reason", "No sender is subscribed"), 454 454 ]) 455 455 reset_timer_and_continue(state) 456 456 } ··· 473 473 /// 474 474 fn failed_too_often(state: State) -> actor.Next(State, Message) { 475 475 log(woof.Warning, "Feed failed too often, fetching is being paused", [ 476 - woof.field("feed-url", state.feed.link |> uri.to_string()), 477 - woof.field("feed-id", state.feed.id |> uuid.to_string()), 478 - woof.int_field("feed-failures", state.feed.repeated_failures), 476 + woof.str("feed-url", state.feed.link |> uri.to_string()), 477 + woof.str("feed-id", state.feed.id |> uuid.to_string()), 478 + woof.int("feed-failures", state.feed.repeated_failures), 479 479 ]) 480 480 481 481 // tell the senders so they can message subscribed users about it ··· 495 495 Error(error) -> { 496 496 // log that something went wrong while fetching 497 497 log(woof.Warning, "Failed to fetch feed", [ 498 - woof.field("feed-url", state.feed.link |> uri.to_string()), 499 - woof.field("feed-id", state.feed.id |> uuid.to_string()), 498 + woof.str("feed-url", state.feed.link |> uri.to_string()), 499 + woof.str("feed-id", state.feed.id |> uuid.to_string()), 500 500 ..describe_fetch_error(error) 501 501 ]) 502 502 ··· 545 545 fn describe_fetch_error(fetch_error: FetchError) { 546 546 case fetch_error { 547 547 InvalidUri -> [ 548 - woof.field("error-variant", "InvalidUri"), 549 - woof.field( 548 + woof.str("error-variant", "InvalidUri"), 549 + woof.str( 550 550 "description", 551 551 "The supplied uri could not be converted into a request", 552 552 ), 553 553 ] 554 554 PathNotXml -> [ 555 - woof.field("error-variant", "InvalidUri"), 556 - woof.field("description", "The supplied uri does not end with .xml"), 555 + woof.str("error-variant", "InvalidUri"), 556 + woof.str("description", "The supplied uri does not end with .xml"), 557 557 ] 558 558 RequestFailed(httpc_error) -> [ 559 - woof.field("error-variant", "RequestFailed"), 560 - woof.field("description", "The request failed"), 561 - woof.field("httpc-error", case httpc_error { 559 + woof.str("error-variant", "RequestFailed"), 560 + woof.str("description", "The request failed"), 561 + woof.str("httpc-error", case httpc_error { 562 562 httpc.InvalidUtf8Response -> "Invalid UTF8" 563 563 httpc.FailedToConnect(_, _) -> "Failed to connect" 564 564 httpc.ResponseTimeout -> "Timeout" 565 565 }), 566 566 ] 567 567 NonXmlResponse -> [ 568 - woof.field("error-variant", "NonXmlResponse"), 569 - woof.field("description", "The response was not text/xml"), 568 + woof.str("error-variant", "NonXmlResponse"), 569 + woof.str("description", "The response was not text/xml"), 570 570 ] 571 571 FailedToParseRssFeed(error) -> [ 572 - woof.field("error-variant", "FailedToParseRssFeed"), 573 - woof.field("description", "The returned xml could not be parsed"), 572 + woof.str("error-variant", "FailedToParseRssFeed"), 573 + woof.str("description", "The returned xml could not be parsed"), 574 574 ..case error { 575 575 xml.InvalidXml(error) -> [ 576 - woof.field("xml-error", "Invalid xml: " <> error), 576 + woof.str("xml-error", "Invalid xml: " <> error), 577 577 ] 578 578 xml.UnableToDecode(decode_errors) -> 579 579 list.index_fold(decode_errors, [], fn(acc, error, index) { 580 580 let field_start = fn() { "decode-error-" <> int.to_string(index) } 581 581 582 582 [ 583 - woof.field(field_start() <> "expected", error.expected), 584 - woof.field(field_start() <> "found", error.found), 585 - woof.field(field_start() <> "path", string.join(error.path, ".")), 583 + woof.str(field_start() <> "expected", error.expected), 584 + woof.str(field_start() <> "found", error.found), 585 + woof.str(field_start() <> "path", string.join(error.path, ".")), 586 586 ..acc 587 587 ] 588 588 }) 589 589 } 590 590 ] 591 591 Non200Response(response) -> [ 592 - woof.field("error-variant", "Non200Response"), 593 - woof.int_field("status-code", response.status), 592 + woof.str("error-variant", "Non200Response"), 593 + woof.int("status-code", response.status), 594 594 ] 595 595 } 596 596 }
+5 -5
src/eater/pubsub.gleam
··· 88 88 list.map(members, process.send(_, FeedUpdate(update:))) 89 89 90 90 log(woof.Info, "Feed published update", [ 91 - woof.field("feed", feed.link |> uri.to_string()), 92 - woof.field("update", update.new.link), 91 + woof.str("feed", feed.link |> uri.to_string()), 92 + woof.str("update", update.new.link), 93 93 ]) 94 94 } 95 95 ··· 107 107 list.map(members, process.send(_, FailedToFetchTooManyTimes(feed))) 108 108 109 109 log(woof.Warning, "Feed pausing has been published", [ 110 - woof.field("feed-id", feed.id |> uuid.to_string()), 111 - woof.field("feed-url", feed.link |> uri.to_string()), 112 - woof.int_field("feed-failure-count", feed.repeated_failures), 110 + woof.str("feed-id", feed.id |> uuid.to_string()), 111 + woof.str("feed-url", feed.link |> uri.to_string()), 112 + woof.int("feed-failure-count", feed.repeated_failures), 113 113 ]) 114 114 } 115 115
+36 -36
src/eater/sender.gleam
··· 224 224 ) 225 225 226 226 log(woof.Info, "Sender has registered itself", [ 227 - woof.field("user", user.email), 228 - woof.field("pid", string.inspect(started.pid)), 227 + woof.str("user", user.email), 228 + woof.str("pid", string.inspect(started.pid)), 229 229 ]) 230 230 231 231 actor.continue(state) ··· 233 233 234 234 SenderStarted(Error(start_error), user) -> { 235 235 log(woof.Error, "Failed to start sender", [ 236 - woof.field("user", user.email), 237 - woof.field("details", string.inspect(start_error)), 236 + woof.str("user", user.email), 237 + woof.str("details", string.inspect(start_error)), 238 238 ]) 239 239 240 240 actor.stop_abnormal( ··· 362 362 let actor_started = 363 363 actor.new_with_initialiser(100, fn(self) { 364 364 log(woof.Info, "Starting", [ 365 - woof.field("user", user.email), 366 - woof.field("pid", string.inspect(process.self())), 365 + woof.str("user", user.email), 366 + woof.str("pid", string.inspect(process.self())), 367 367 ]) 368 368 369 369 // tell self to get this users feeds from the database ··· 445 445 } 446 446 Error(AlreadySent) -> { 447 447 log(woof.Info, "Skipping", [ 448 - woof.field("update", update.new.link), 449 - woof.field("user", state.user.email), 450 - woof.field("reason", "Already sent"), 448 + woof.str("update", update.new.link), 449 + woof.str("user", state.user.email), 450 + woof.str("reason", "Already sent"), 451 451 ]) 452 452 actor.continue(state) 453 453 } 454 454 Error(error) -> { 455 455 log(woof.Warning, "Feed update failed", [ 456 - woof.field("update", update.new.link), 457 - woof.field("user", state.user.email), 458 - woof.field("details", string.inspect(error)), 456 + woof.str("update", update.new.link), 457 + woof.str("user", state.user.email), 458 + woof.str("details", string.inspect(error)), 459 459 ]) 460 460 461 461 // retry again in a bit ··· 490 490 Error(AlreadySent) -> actor.continue(state) 491 491 Error(error) -> { 492 492 log(woof.Warning, "Sending failed again", [ 493 - woof.field("user", state.user.email), 494 - woof.field("update", update.new.link), 495 - woof.int_field("attempt", attempt), 496 - woof.field("details", string.inspect(error)), 493 + woof.str("user", state.user.email), 494 + woof.str("update", update.new.link), 495 + woof.int("attempt", attempt), 496 + woof.str("details", string.inspect(error)), 497 497 ]) 498 498 499 499 // retry again in a bit ··· 513 513 } 514 514 Retry(message: pubsub.FeedUpdate(update:), attempt:) -> { 515 515 log(woof.Warning, "Dropping feed update", [ 516 - woof.field("user", state.user.email), 517 - woof.field("update", update.new.link), 518 - woof.int_field("attempt", attempt), 519 - woof.field("reason", "Failed too many times"), 516 + woof.str("user", state.user.email), 517 + woof.str("update", update.new.link), 518 + woof.int("attempt", attempt), 519 + woof.str("reason", "Failed too many times"), 520 520 ]) 521 521 actor.continue(state) 522 522 } ··· 526 526 Ok(_) -> actor.continue(state) 527 527 Error(error) -> { 528 528 log(woof.Error, "Failed to send feed pausing email", [ 529 - woof.field("user", state.user.email), 530 - woof.field("feed-url", feed.link |> uri.to_string()), 531 - woof.field("feed-id", feed.id |> uuid.to_string()), 532 - woof.field("details", string.inspect(error)), 529 + woof.str("user", state.user.email), 530 + woof.str("feed-url", feed.link |> uri.to_string()), 531 + woof.str("feed-id", feed.id |> uuid.to_string()), 532 + woof.str("details", string.inspect(error)), 533 533 ]) 534 534 535 535 // try again in a minute ··· 551 551 woof.Error, 552 552 "Failed to send feed deletion email a second time. Wont retry again.", 553 553 [ 554 - woof.field("user", state.user.email), 555 - woof.field("feed-url", feed.link |> uri.to_string()), 556 - woof.field("feed-id", feed.id |> uuid.to_string()), 557 - woof.field("details", string.inspect(error)), 554 + woof.str("user", state.user.email), 555 + woof.str("feed-url", feed.link |> uri.to_string()), 556 + woof.str("feed-id", feed.id |> uuid.to_string()), 557 + woof.str("details", string.inspect(error)), 558 558 ], 559 559 ) 560 560 ··· 570 570 /// 571 571 fn initial_selector(state: State) { 572 572 log(woof.Info, "Initializing selector", [ 573 - woof.field("user-email", state.user.email), 574 - woof.field("user-id", state.user.id |> uuid.to_string()), 573 + woof.str("user-email", state.user.email), 574 + woof.str("user-id", state.user.id |> uuid.to_string()), 575 575 ..list.index_fold(state.feeds, [], fn(acc, feed, index) { 576 576 let field_name = fn(suffix) { 577 577 "feed-" <> suffix <> "-" <> int.to_string(index) 578 578 } 579 579 580 580 [ 581 - woof.field(field_name("url"), feed.link |> uri.to_string()), 582 - woof.field(field_name("id"), feed.id |> uuid.to_string()), 581 + woof.str(field_name("url"), feed.link |> uri.to_string()), 582 + woof.str(field_name("id"), feed.id |> uuid.to_string()), 583 583 ..acc 584 584 ] 585 585 }) ··· 678 678 ) 679 679 680 680 log(woof.Info, "Sent update to user", [ 681 - woof.field("update", update.new.link), 682 - woof.field("user", state.user.email), 681 + woof.str("update", update.new.link), 682 + woof.str("user", state.user.email), 683 683 ]) 684 684 685 685 use _ <- result.try( ··· 688 688 ) 689 689 690 690 log(woof.Info, "Sent status persisted", [ 691 - woof.field("user", state.user.email), 692 - woof.field("update", update.new.link), 691 + woof.str("user", state.user.email), 692 + woof.str("update", update.new.link), 693 693 ]) 694 694 695 695 Ok(Nil)
+90 -93
src/eater/ui/main_ui.gleam
··· 144 144 fn describe_model(model: Model) -> List(#(String, _)) { 145 145 case model { 146 146 SignUpForm(_data, form) -> [ 147 - woof.field("model", "SignUpForm"), 148 - woof.field("form-email", form.field_value(form, "email")), 147 + woof.str("model", "SignUpForm"), 148 + woof.str("form-email", form.field_value(form, "email")), 149 149 ] 150 150 ConfirmOneTimePassword( 151 151 context: _, ··· 154 154 password_to_confirm: _, 155 155 attempts_left:, 156 156 ) -> [ 157 - woof.field("model", "SignUpFormConfirmOtp"), 158 - woof.field("form-user-email", user.email), 159 - woof.int_field("attempts_left", attempts_left), 157 + woof.str("model", "SignUpFormConfirmOtp"), 158 + woof.str("form-user-email", user.email), 159 + woof.int("attempts_left", attempts_left), 160 160 ] 161 161 LoginForm(context: _, form:) -> [ 162 - woof.field("model", "LoginForm"), 163 - woof.field("form-email", form.field_value(form, "email")), 162 + woof.str("model", "LoginForm"), 163 + woof.str("form-email", form.field_value(form, "email")), 164 164 ] 165 165 User( 166 166 context: _, 167 167 data: UserData(self:, subscriptions:, add_subscription_form: _), 168 168 ) -> [ 169 - woof.field("model", "User"), 170 - woof.field("user-email", self.email), 171 - woof.int_field("subscription-count", subscriptions |> list.length()), 169 + woof.str("model", "User"), 170 + woof.str("user-email", self.email), 171 + woof.int("subscription-count", subscriptions |> list.length()), 172 172 ] 173 173 Admin(..) -> [ 174 - woof.field("model", "Admin"), 175 - woof.field("user-email", model.data.self.email), 176 - woof.int_field( 177 - "subscription-count", 178 - model.data.subscriptions |> list.length(), 179 - ), 174 + woof.str("model", "Admin"), 175 + woof.str("user-email", model.data.self.email), 176 + woof.int("subscription-count", model.data.subscriptions |> list.length()), 180 177 ] 181 178 } 182 179 } ··· 216 213 fn describe_message(message: Message) -> List(#(String, _)) { 217 214 case message { 218 215 UserSubmittedLoginForm(Ok(login)) -> [ 219 - woof.field("message", "UserSubmittedEmail"), 220 - woof.field("status", "ok"), 221 - woof.field("email", login.email), 216 + woof.str("message", "UserSubmittedEmail"), 217 + woof.str("status", "ok"), 218 + woof.str("email", login.email), 222 219 ] 223 220 UserSubmittedLoginForm(Error(_)) -> [ 224 - woof.field("message", "UserSubmittedEmail"), 225 - woof.field("status", "error"), 221 + woof.str("message", "UserSubmittedEmail"), 222 + woof.str("status", "error"), 226 223 ] 227 224 BackendReturnedUser(Ok(user), _) -> [ 228 - woof.field("message", "BackendReturnedUser"), 229 - woof.field("status", "ok"), 230 - woof.field("user-email", user.email), 231 - woof.field("user-id", user.id |> uuid.to_string()), 225 + woof.str("message", "BackendReturnedUser"), 226 + woof.str("status", "ok"), 227 + woof.str("user-email", user.email), 228 + woof.str("user-id", user.id |> uuid.to_string()), 232 229 ] 233 230 BackendReturnedUser(Error(_), _) -> [ 234 - woof.field("message", "BackendReturnedUser"), 235 - woof.field("status", "error"), 231 + woof.str("message", "BackendReturnedUser"), 232 + woof.str("status", "error"), 236 233 ] 237 234 BackendCreatedNewUser(Ok(user)) -> [ 238 - woof.field("message", "BackendCreatedNewUser"), 239 - woof.field("status", "ok"), 240 - woof.field("email", user.email), 241 - woof.field("id", user.id |> uuid.to_string()), 235 + woof.str("message", "BackendCreatedNewUser"), 236 + woof.str("status", "ok"), 237 + woof.str("email", user.email), 238 + woof.str("id", user.id |> uuid.to_string()), 242 239 ] 243 240 BackendCreatedNewUser(Error(_)) -> [ 244 - woof.field("message", "BackendCreatedNewUser"), 245 - woof.field("status", "error"), 241 + woof.str("message", "BackendCreatedNewUser"), 242 + woof.str("status", "error"), 246 243 ] 247 244 UserSubmittedSignUpForm(Ok(user)) -> [ 248 - woof.field("message", "UserSubmittedSignUpForm"), 249 - woof.field("status", "ok"), 250 - woof.field("user-email", user.email), 245 + woof.str("message", "UserSubmittedSignUpForm"), 246 + woof.str("status", "ok"), 247 + woof.str("user-email", user.email), 251 248 ] 252 249 UserSubmittedSignUpForm(Error(_)) -> [ 253 - woof.field("message", "UserSubmittedSignUpForm"), 254 - woof.field("status", "error"), 250 + woof.str("message", "UserSubmittedSignUpForm"), 251 + woof.str("status", "error"), 255 252 ] 256 253 ServerGeneratedPassword(password, user) -> [ 257 - woof.field("message", "ServerGeneratedPassword"), 258 - woof.field("user-email", user.email), 259 - woof.field("one-time-password", password), 254 + woof.str("message", "ServerGeneratedPassword"), 255 + woof.str("user-email", user.email), 256 + woof.str("one-time-password", password), 260 257 ] 261 258 UserSubmittedOneTimePassword(Ok(password)) -> [ 262 - woof.field("message", "UserSubmittedPassword"), 263 - woof.field("status", "ok"), 264 - woof.field("one-time-password", password), 259 + woof.str("message", "UserSubmittedPassword"), 260 + woof.str("status", "ok"), 261 + woof.str("one-time-password", password), 265 262 ] 266 263 UserSubmittedOneTimePassword(Error(_)) -> [ 267 - woof.field("message", "UserSubmittedPassword"), 268 - woof.field("status", "error"), 264 + woof.str("message", "UserSubmittedPassword"), 265 + woof.str("status", "error"), 269 266 ] 270 267 ServerSentPassword(Ok(_), password_to_confirm: _, user: _) -> [ 271 - woof.field("message", "ServerSentPassword"), 272 - woof.field("status", "ok"), 268 + woof.str("message", "ServerSentPassword"), 269 + woof.str("status", "ok"), 273 270 ] 274 271 ServerSentPassword(Error(smtp_error), password_to_confirm: _, user: _) -> [ 275 - woof.field("message", "ServerSentPassword"), 276 - woof.field("status", "error"), 277 - woof.field("details", string.inspect(smtp_error)), 272 + woof.str("message", "ServerSentPassword"), 273 + woof.str("status", "error"), 274 + woof.str("details", string.inspect(smtp_error)), 278 275 ] 279 276 ServerVerifiedLogin(valid:, user:) -> [ 280 - woof.field("message", "ServerVerifiedLogin"), 281 - woof.field("user-email", user.email), 282 - woof.bool_field("valid", valid), 277 + woof.str("message", "ServerVerifiedLogin"), 278 + woof.str("user-email", user.email), 279 + woof.bool("valid", valid), 283 280 ] 284 281 UserClickedGotoSignUp -> [ 285 - woof.field("message", "UserClickedGotoSignUp"), 282 + woof.str("message", "UserClickedGotoSignUp"), 286 283 ] 287 284 UserClickedGotoLogIn -> [ 288 - woof.field("message", "UserClickedGotoLogIn"), 285 + woof.str("message", "UserClickedGotoLogIn"), 289 286 ] 290 287 TimerDismissedToast -> [ 291 - woof.field("message", "TimerDismissedToast"), 288 + woof.str("message", "TimerDismissedToast"), 292 289 ] 293 290 BackendReturnedAllUsers(Ok(_)) -> [ 294 - woof.field("message", "BackendReturnedAllUsers"), 295 - woof.field("status", "ok"), 291 + woof.str("message", "BackendReturnedAllUsers"), 292 + woof.str("status", "ok"), 296 293 ] 297 294 BackendReturnedAllUsers(Error(db_error)) -> [ 298 - woof.field("message", "BackendReturnedAllUsers"), 299 - woof.field("status", "error"), 300 - woof.field("details", string.inspect(db_error)), 295 + woof.str("message", "BackendReturnedAllUsers"), 296 + woof.str("status", "error"), 297 + woof.str("details", string.inspect(db_error)), 301 298 ] 302 299 BackendReturnedSubscriptions(Ok(subs)) -> [ 303 - woof.field("message", "BackendReturnedSubscriptions"), 304 - woof.field("status", "ok"), 305 - woof.int_field("subscriptions-returned", list.length(subs)), 300 + woof.str("message", "BackendReturnedSubscriptions"), 301 + woof.str("status", "ok"), 302 + woof.int("subscriptions-returned", list.length(subs)), 306 303 ] 307 304 BackendReturnedSubscriptions(Error(db_error)) -> [ 308 - woof.field("message", "DatabaseReturnedSubscriptions"), 309 - woof.field("status", "error"), 310 - woof.field("details", string.inspect(db_error)), 305 + woof.str("message", "DatabaseReturnedSubscriptions"), 306 + woof.str("status", "error"), 307 + woof.str("details", string.inspect(db_error)), 311 308 ] 312 309 UserClickedUnsubscribe(location) -> [ 313 - woof.field("message", "UserClickedUnsubscribe"), 314 - woof.field("feed", location.link |> uri.to_string()), 310 + woof.str("message", "UserClickedUnsubscribe"), 311 + woof.str("feed", location.link |> uri.to_string()), 315 312 ] 316 313 UnsubscribedInBackend(Ok(feed)) -> [ 317 - woof.field("message", "UnsubscribedInBackend"), 318 - woof.field("status", "ok"), 319 - woof.field("feed-url", feed.link |> uri.to_string()), 320 - woof.field("feed-id", feed.id |> uuid.to_string()), 314 + woof.str("message", "UnsubscribedInBackend"), 315 + woof.str("status", "ok"), 316 + woof.str("feed-url", feed.link |> uri.to_string()), 317 + woof.str("feed-id", feed.id |> uuid.to_string()), 321 318 ] 322 319 UnsubscribedInBackend(Error(_)) -> [ 323 - woof.field("message", "UnsubscribedInBackend"), 324 - woof.field("status", "error"), 320 + woof.str("message", "UnsubscribedInBackend"), 321 + woof.str("status", "error"), 325 322 ] 326 323 SubscribedInBackend(Ok(feed)) -> [ 327 - woof.field("message", "SubscribedInBackend"), 328 - woof.field("status", "ok"), 329 - woof.field("feed", feed.link |> uri.to_string()), 330 - woof.field("feed-id", feed.id |> uuid.to_string()), 324 + woof.str("message", "SubscribedInBackend"), 325 + woof.str("status", "ok"), 326 + woof.str("feed", feed.link |> uri.to_string()), 327 + woof.str("feed-id", feed.id |> uuid.to_string()), 331 328 ] 332 329 SubscribedInBackend(Error(_)) -> [ 333 - woof.field("message", "SubscribedInBackend"), 334 - woof.field("status", "error"), 330 + woof.str("message", "SubscribedInBackend"), 331 + woof.str("status", "error"), 335 332 ] 336 333 UserSubmittedSubscription(Ok(link)) -> [ 337 - woof.field("message", "UserSubmittedSubscription"), 338 - woof.field("status", "ok"), 339 - woof.field("feed", link |> uri.to_string()), 334 + woof.str("message", "UserSubmittedSubscription"), 335 + woof.str("status", "ok"), 336 + woof.str("feed", link |> uri.to_string()), 340 337 ] 341 338 UserSubmittedSubscription(Error(_)) -> [ 342 - woof.field("message", "UserSubmittedSubscription"), 343 - woof.field("status", "error"), 339 + woof.str("message", "UserSubmittedSubscription"), 340 + woof.str("status", "error"), 344 341 ] 345 342 BackendReturnedFeed(Ok(feed)) -> [ 346 - woof.field("message", "BackendReturnedFeed"), 347 - woof.field("status", "ok"), 348 - woof.field("feed-url", feed.link |> uri.to_string()), 349 - woof.field("feed-id", feed.id |> uuid.to_string()), 343 + woof.str("message", "BackendReturnedFeed"), 344 + woof.str("status", "ok"), 345 + woof.str("feed-url", feed.link |> uri.to_string()), 346 + woof.str("feed-id", feed.id |> uuid.to_string()), 350 347 ] 351 348 BackendReturnedFeed(Error(_)) -> [ 352 - woof.field("message", "BackendReturnedFeed"), 353 - woof.field("status", "error"), 349 + woof.str("message", "BackendReturnedFeed"), 350 + woof.str("status", "error"), 354 351 ] 355 352 } 356 353 }