noteguard

the nostr relay spam guardian
git clone git://jb55.com/noteguard
Log | Files | Refs | README | LICENSE

note_filter.rs (506B)


      1 use crate::{InputMessage, OutputMessage};
      2 use serde::{Deserialize, Serialize};
      3 
      4 #[derive(Deserialize, Serialize, Clone)]
      5 pub struct Note {
      6     pub id: String,
      7     pub pubkey: String,
      8     pub content: String,
      9     pub created_at: i64,
     10     pub kind: i64,
     11     pub tags: Vec<Vec<String>>,
     12     pub sig: String,
     13 }
     14 
     15 pub trait NoteFilter {
     16     fn filter_note(&mut self, msg: &InputMessage) -> OutputMessage;
     17 
     18     /// A key corresponding to an entry in the noteguard.toml file.
     19     fn name(&self) -> &'static str;
     20 }