// LoadPolicyFromFS loads all policy rules from http.FileSystem.
// It registers all the loaded policy rules into a specified model.
// This function is used by the Adapter but feel free to use it as is.
LoadPolicyFromFS loads all policy rules from http.FileSystem.
It registers all the loaded policy rules into a specified model.
This function is used by the Adapter but feel free to use it as is.
// LoadPolicyFromFS loads all policy rules from http . FileSystem . // It registers all the loaded policy rules into a specified model . // This function is used by the Adapter but feel free to use it as is .
func LoadPolicyFromFS(fs http.FileSystem, path string, model model.Model) error {
	f, err := fs.Open(path)
	if err != nil {
		return err
	}
	defer f.Close()
	scanner := bufio.NewScanner(f)
	for scanner.Scan() {
		line := scanner.Text()
		loader(trimmer(line), model)
	}
	return scanner.Err()
}
func LoadPolicyFromFS ( fs http . FileSystem , path string , model model . Model ) error { f , err := fs . Open ( path ) if err != nil { return err } defer f . Close ( ) scanner := bufio . NewScanner ( f ) for scanner . Scan ( ) { line := scanner . Text ( ) loader ( trimmer ( line ) , model ) } return scanner . Err ( ) }
LoadPolicyFromFS loads all policy rules from http.FileSystem.
LoadPolicyFromFS loads all policy rules from http . FileSystem .