| 
									
										
										
										
											2024-02-04 18:19:19 -06:00
										 |  |  | package config | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-09 09:44:35 -06:00
										 |  |  | import mapst "github.com/mitchellh/mapstructure" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 18:19:19 -06:00
										 |  |  | type Config struct { | 
					
						
							|  |  |  | 	Input   Input | 
					
						
							| 
									
										
										
										
											2024-02-09 09:44:35 -06:00
										 |  |  | 	Outputs Outputs `toml:"output"` | 
					
						
							| 
									
										
										
										
											2024-02-04 18:19:19 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Input struct { | 
					
						
							|  |  |  | 	Path    string | 
					
						
							|  |  |  | 	Recurse bool | 
					
						
							|  |  |  | 	Ext     string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-09 09:44:35 -06:00
										 |  |  | type Outputs map[string]Output | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 18:19:19 -06:00
										 |  |  | type Output struct { | 
					
						
							|  |  |  | 	Enabled bool | 
					
						
							|  |  |  | 	Config  map[string]any | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-02-09 09:44:35 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | func (oo Outputs) Stdout() (s Stdout, enabled bool) { | 
					
						
							|  |  |  | 	o, ok := oo["stdout"] | 
					
						
							|  |  |  | 	if !ok { | 
					
						
							|  |  |  | 		return s, false | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	enabled = o.Enabled | 
					
						
							|  |  |  | 	mapst.Decode(o.Config, &s) | 
					
						
							|  |  |  | 	return | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Stdout struct { | 
					
						
							|  |  |  | 	Json bool | 
					
						
							|  |  |  | } |