ucp
Build and Publish / BuildAndDeployArm64 (push) Failing after 6s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled

This commit is contained in:
2026-06-24 16:27:22 +02:00
parent e1eb342edf
commit 94b1f9c4ec
7 changed files with 334 additions and 23 deletions
+12 -4
View File
@@ -6,20 +6,27 @@ import (
"fmt"
"log"
"net/http"
"os"
"time"
"git.k6n.net/mats/go-cart-actor/pkg/cart"
)
type CartClient struct {
httpClient *http.Client
baseUrl string
httpClient *http.Client
baseUrl string
agentProfile string // UCP-Agent profile URI
}
func NewCartClient(baseUrl string) *CartClient {
profile := os.Getenv("UCP_AGENT_PROFILE")
if profile == "" {
profile = "https://checkout.k6n.net/.well-known/ucp"
}
return &CartClient{
httpClient: &http.Client{Timeout: 10 * time.Second},
baseUrl: baseUrl,
httpClient: &http.Client{Timeout: 10 * time.Second},
baseUrl: baseUrl,
agentProfile: profile,
}
}
@@ -52,6 +59,7 @@ func (s *CartClient) getCartGrain(ctx context.Context, cartId cart.CartId) (*car
if err != nil {
return nil, err
}
req.Header.Set("UCP-Agent", `profile="`+s.agentProfile+`"`)
resp, err := s.httpClient.Do(req)
if err != nil {
return nil, err