Open NamsooCho opened 4 years ago
이런식으로 일단 대략적으로 잡아 주세요
struct Frontier {
total_to_visit : Queue<Uri> //Agent로 처리할 URL(Seed url, new url) 큐
}
struct Agent {
to_visit: Queue<Uri or IpAddr?>//Agent가 크롤링할 큐
visited: Queue<Uri or IpAddr?>,//수집한 큐
to_send: Queue<Uri>.//새로운 도메인 Url, 프론티어로 보낼 URl 큐
contents_table: HashMap<String,String or u128?> //데이터 checksum
}
struct Monitor {
//?
}
enum Protocol { HTTP, HTTPS, FTP, }
struct UrlParser { protocol: Protocol, ip_addr_v4: String, // String으로 하는게 좋은건지....??? path: String, port: u16 }
struct DnsCache { history: HashMap<String, IpAddrV4> // string 으로된 주소를 IP 주소로 캐싱 }
struct LookUpLIst { url_list: HashMap<String, bool> // url string 을 키로 하여 이미 읽은 주소인지 여부를 저장한다. 만약 이미 읽은 주소이면 skip하고 , 안 읽었으면 읽고 읽었다고 set한다. }