File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed 
go/callback/internal/config Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1- name : Go Build and  Test 
1+ name : Go Callback Handler  Test 
22
33on :
44  push :
4444
4545       - name : Run integration test 
4646        run : | 
47-           # Start the application in the background 
47+           # Start the callback handler  application in the background 
4848          nohup ./myapp > app.log 2>&1 & 
4949
5050          # Health check - wait for the server to be ready (max 30 seconds) 
5757              sleep 1 
5858          done 
5959
60-           # Prepare and send API  request 
60+           # Prepare and send a simulated external callback (POST  request)  
6161          SIGNATURE=$(echo -n '{"args":[]}' | openssl dgst -sha256 -hmac "my-test-secret" | sed 's/^.* //') 
6262          RESPONSE=$(curl -s -w "\n%{http_code}" -X POST http://localhost:8080/backup \ 
6363              -H "Content-Type: application/json" \ 
8181              exit 1 
8282          fi 
8383
84-           echo "Integration  test passed" 
84+           echo "Callback handler  test passed" 
8585
8686          # Cleanup 
8787          killall myapp || true  
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ type Config struct {
1111	Port            string 
1212	ScriptPath      string 
1313	CallbackSecret  string 
14+ 	CallbackURL     string  // 新增字段用于存储回调URL 
1415}
1516
1617// LoadConfig 从指定路径读取配置文件并返回配置对象 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments