| 
									
										
										
										
											2025-03-10 14:52:50 -05:00
										 |  |  | package nomino | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Config struct { | 
					
						
							|  |  |  | 	original  string | 
					
						
							|  |  |  | 	prefix    string | 
					
						
							|  |  |  | 	suffix    string | 
					
						
							|  |  |  | 	extension string | 
					
						
							| 
									
										
										
										
											2025-03-11 16:42:39 -05:00
										 |  |  | 	separator string | 
					
						
							| 
									
										
										
										
											2025-03-10 14:52:50 -05:00
										 |  |  | 	generator Generator | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-15 15:35:40 -05:00
										 |  |  | // NewConfig returns a new Config with the specified Options. | 
					
						
							| 
									
										
										
										
											2025-03-10 14:52:50 -05:00
										 |  |  | func NewConfig(options ...Option) Config { | 
					
						
							|  |  |  | 	conf := Config{ | 
					
						
							|  |  |  | 		extension: ".txt", | 
					
						
							| 
									
										
										
										
											2025-03-11 16:42:39 -05:00
										 |  |  | 		separator: "_", | 
					
						
							| 
									
										
										
										
											2025-03-16 12:38:36 -05:00
										 |  |  | 		generator: UUID(nil), | 
					
						
							| 
									
										
										
										
											2025-03-10 14:52:50 -05:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	for _, opt := range options { | 
					
						
							|  |  |  | 		opt(&conf) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return conf | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-03-18 09:22:30 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | // AddOptions creates a new Config with options added. | 
					
						
							|  |  |  | func (c Config) AddOptions(options ...Option) Config { | 
					
						
							|  |  |  | 	for _, opt := range options { | 
					
						
							|  |  |  | 		opt(&c) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return c | 
					
						
							|  |  |  | } |