Add "named" actor interface
This commit is contained in:
		
							parent
							
								
									e0c8825949
								
							
						
					
					
						commit
						10ca4f4671
					
				
							
								
								
									
										8
									
								
								actor.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								actor.go
									
									
									
									
									
								
							@ -29,6 +29,14 @@ type Actor interface {
 | 
			
		||||
	Type() string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Named is any object with a name.
 | 
			
		||||
type Named() string {
 | 
			
		||||
	// Name returns the name. This doesn't need to be the same as Type. It
 | 
			
		||||
	// must return the same string every time. It is used to differentiate
 | 
			
		||||
	// actors of the same type in logs.
 | 
			
		||||
	Name() string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FlagAdder is any object that can add [Flag]s to a [FlagSet]. Actors which
 | 
			
		||||
// implement this interface will be called upon to add flags during and only
 | 
			
		||||
// during the flag parsing phase.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user