kopia lustrzana https://github.com/reiver/greatape
				
				
				
			
		
			
				
	
	
		
			52 wiersze
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
			
		
		
	
	
			52 wiersze
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
| package operations
 | |
| 
 | |
| import (
 | |
| 	. "github.com/xeronith/diamante/contracts/operation"
 | |
| 	. "github.com/xeronith/diamante/contracts/service"
 | |
| 	. "github.com/xeronith/diamante/contracts/system"
 | |
| 	. "github.com/xeronith/diamante/operation"
 | |
| 	. "rail.town/infrastructure/components/api/protobuf"
 | |
| 	. "rail.town/infrastructure/components/api/services"
 | |
| 	. "rail.town/infrastructure/components/contracts"
 | |
| )
 | |
| 
 | |
| type authorizeInteractionOperation struct {
 | |
| 	Operation
 | |
| 
 | |
| 	run func(IContext, *AuthorizeInteractionRequest) (*AuthorizeInteractionResult, error)
 | |
| }
 | |
| 
 | |
| func AuthorizeInteractionOperation() IOperation {
 | |
| 	return &authorizeInteractionOperation{
 | |
| 		run: AuthorizeInteractionService,
 | |
| 	}
 | |
| }
 | |
| 
 | |
| func (operation *authorizeInteractionOperation) Id() (ID, ID) {
 | |
| 	return AUTHORIZE_INTERACTION_REQUEST, AUTHORIZE_INTERACTION_RESULT
 | |
| }
 | |
| 
 | |
| func (operation *authorizeInteractionOperation) InputContainer() Pointer {
 | |
| 	return new(AuthorizeInteractionRequest)
 | |
| }
 | |
| 
 | |
| func (operation *authorizeInteractionOperation) OutputContainer() Pointer {
 | |
| 	return new(AuthorizeInteractionResult)
 | |
| }
 | |
| 
 | |
| func (operation *authorizeInteractionOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
 | |
| 	return operation.run(context, payload.(*AuthorizeInteractionRequest))
 | |
| }
 | |
| 
 | |
| /*
 | |
| func (operation *authorizeInteractionOperation) ExecutionTimeLimits() (Duration, Duration, Duration) {
 | |
| 	var (
 | |
| 		TIME_LIMIT_WARNING  Duration = 20_000_000
 | |
| 		TIME_LIMIT_ALERT    Duration = 35_000_000
 | |
| 		TIME_LIMIT_CRITICAL Duration = 50_000_000
 | |
| 	)
 | |
| 
 | |
| 	return TIME_LIMIT_WARNING, TIME_LIMIT_ALERT, TIME_LIMIT_CRITICAL
 | |
| }
 | |
| */
 |