mirror of
				https://github.com/traefik/traefik.git
				synced 2025-10-31 08:21:27 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			590 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			590 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package cli
 | |
| 
 | |
| // ResourceLoader is a configuration resource loader.
 | |
| type ResourceLoader interface {
 | |
| 	// Load populates cmd.Configuration, optionally using args to do so.
 | |
| 	Load(args []string, cmd *Command) (bool, error)
 | |
| }
 | |
| 
 | |
| type filenameGetter interface {
 | |
| 	GetFilename() string
 | |
| }
 | |
| 
 | |
| // GetConfigFile returns the configuration file corresponding to the first configuration file loader found in ResourceLoader, if any.
 | |
| func GetConfigFile(loaders []ResourceLoader) string {
 | |
| 	for _, loader := range loaders {
 | |
| 		if v, ok := loader.(filenameGetter); ok {
 | |
| 			return v.GetFilename()
 | |
| 		}
 | |
| 	}
 | |
| 	return ""
 | |
| }
 |