(path string)
| 183 | } |
| 184 | |
| 185 | func readFromFile(path string) (*Config, error) { |
| 186 | b, err := os.ReadFile(path) |
| 187 | if err != nil { |
| 188 | return nil, err |
| 189 | } |
| 190 | config, err := loadBytes(b) |
| 191 | if err != nil { |
| 192 | return nil, err |
| 193 | } |
| 194 | config.Root.AbsRootPath, err = filepath.Abs(path) |
| 195 | return config, err |
| 196 | } |
| 197 | |
| 198 | func LoadConfigFromURL(ctx context.Context, url string) (*Config, error) { |
| 199 | req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) |