NamsooCho / Crawler_2

연습 프로젝트 입니다.
MIT License
0 stars 1 forks source link

대략적인 자료구조 #3

Open NamsooCho opened 4 years ago

NamsooCho commented 4 years ago

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한다. }

NamsooCho commented 4 years ago

이런식으로 일단 대략적으로 잡아 주세요

ywen407 commented 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 { //? }