LoadOracles loads raw protobuf oracles from the data files found in a given path.
(dataPath string)
| 13 | // LoadOracles loads raw protobuf oracles from |
| 14 | // the data files found in a given path. |
| 15 | func LoadOracles(dataPath string) (*Oracles, error) { |
| 16 | o := &Oracles{ |
| 17 | Index: WithDriver(dataPath, OracleDriver{}), |
| 18 | } |
| 19 | |
| 20 | if err := o.Load(); err != nil { |
| 21 | return nil, err |
| 22 | } |
| 23 | |
| 24 | return o, nil |
| 25 | } |
| 26 | |
| 27 | // Find returns a *pb.Oracle object given its identifier, |
| 28 | // or nil if not found. |