@@ -606,6 +606,8 @@ func (m *RobotsMatcher) init(userAgents []string, path string) {
606
606
m .userAgents = userAgents
607
607
}
608
608
609
+ // AgentsAllowed parses the given robots.txt content, matching it against
610
+ // the given userAgents and URI, and returns true if access is allowed.
609
611
func (m * RobotsMatcher ) AgentsAllowed (robotsBody string , userAgents []string , uri string ) bool {
610
612
// Line :487
611
613
// The url is not normalized (escaped, percent encoded) here because the user
@@ -616,15 +618,21 @@ func (m *RobotsMatcher) AgentsAllowed(robotsBody string, userAgents []string, ur
616
618
return ! m .disallowed ()
617
619
}
618
620
621
+ // AgentsAllowed parses the given robots.txt content, matching it against
622
+ // the given userAgents and URI, and returns true if access is allowed.
619
623
func AgentsAllowed (robotsBody string , userAgents []string , uri string ) bool {
620
624
return NewRobotsMatcher ().AgentsAllowed (robotsBody , userAgents , uri )
621
625
}
622
626
627
+ // AgentAllowed parses the given robots.txt content, matching it against
628
+ // the given userAgent and URI, and returns true if access is allowed.
623
629
func (m * RobotsMatcher ) AgentAllowed (robotsBody string , userAgent string , uri string ) bool {
624
630
// Line :498
625
631
return m .AgentsAllowed (robotsBody , []string {userAgent }, uri )
626
632
}
627
633
634
+ // AgentAllowed parses the given robots.txt content, matching it against
635
+ // the given userAgent and URI, and returns true if access is allowed.
628
636
func AgentAllowed (robotsBody string , userAgent string , uri string ) bool {
629
637
return NewRobotsMatcher ().AgentAllowed (robotsBody , userAgent , uri )
630
638
}
0 commit comments