Skip to content

Commit

Permalink
feat: adding carry client
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Oct 11, 2024
1 parent e222ad2 commit 4776218
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 676 deletions.
15 changes: 11 additions & 4 deletions acs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ package acs
import (
"net/http"

"github.com/zeiss/carry"
"github.com/zeiss/go-acs/calls"
"github.com/zeiss/go-acs/client"
"github.com/zeiss/go-acs/identities"
"github.com/zeiss/go-acs/sms"
)

// DefaultVersion
var DefaultVersion = struct {
APIVersion string `url:"api-version"`
}{
APIVersion: "2024-06-15-preview",
}

// Client is the client for the ACS API.
type Client struct {
SMS *sms.Service
Expand All @@ -18,11 +25,11 @@ type Client struct {

// New creates a new Client.
func New(endpointURL, key string, c *http.Client) *Client {
base := client.New().
base := carry.New().
Client(c).
Base(endpointURL).
QueryStruct(client.DefaultVersion).
SignProvider(client.NewHMacSigner(key))
QueryStruct(DefaultVersion).
SignProvider(carry.NewHMacSigner(key))

return &Client{
SMS: sms.NewService(base),
Expand Down
6 changes: 3 additions & 3 deletions calls/calls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
"fmt"

"github.com/go-resty/resty/v2"
"github.com/zeiss/go-acs/client"
"github.com/zeiss/carry"
)

// Service is the service for call.
type Service struct {
client *client.Client
client *carry.Client
}

// NewService returns a new CallService
func NewService(c *client.Client) *Service {
func NewService(c *carry.Client) *Service {
return &Service{c}
}

Expand Down
68 changes: 0 additions & 68 deletions client/body.go

This file was deleted.

Loading

0 comments on commit 4776218

Please sign in to comment.