func NewYAMLLoader(file string) (*YAMLLoader, error) {
    loader := &YAMLLoader{
        path: file,
    }
    _, err := loader.Load()
    if err != nil {
        return nil, err
    }
    return loader, nil
}
NewYAMLLoader is used to initialize a YAMLLoader
package loader
import (
    "io/ioutil"
    "github.com/storyicon/grbac/pkg/meta"
    "gopkg.in/yaml.v3"
)
type YAMLLoader struct {
    path string
}