Throttler mock
This commit is contained in:
		
							parent
							
								
									cc75f8cbac
								
							
						
					
					
						commit
						67ce0913fb
					
				
							
								
								
									
										20
									
								
								impl/impl.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								impl/impl.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | ||||
| package impl | ||||
| 
 | ||||
| type ( | ||||
| 	Impl struct { | ||||
| 		Call func([]byte) ([]byte, error) | ||||
| 	} | ||||
| ) | ||||
| 
 | ||||
| func (i *Impl) Units() []string { | ||||
| 	return []string{} | ||||
| } | ||||
| 
 | ||||
| func New(name string) *Impl { | ||||
| 	switch name { | ||||
| 	case "units.throttler.Throttler": | ||||
| 		return Throttler() | ||||
| 	default: | ||||
| 		return nil | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										9
									
								
								impl/throttler.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								impl/throttler.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| package impl | ||||
| 
 | ||||
| func Throttler() *Impl { | ||||
| 	return &Impl{ | ||||
| 		Call: func(data []byte) (resp []byte, err error) { | ||||
| 			return data, nil | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user