use endpoint built into client

This commit is contained in:
2023-04-18 13:26:28 -07:00
parent 81328860a1
commit 952bfe906e
2 changed files with 17 additions and 9 deletions

View File

@@ -5,9 +5,18 @@ const apiEndpoint = "https://api.elevenlabs.io"
var ErrUnauthorized error
type Client struct {
apiKey string
apiKey string
endpoint string
}
func New(apiKey string) Client {
return Client{apiKey: apiKey}
return Client{
apiKey: apiKey,
endpoint: apiEndpoint,
}
}
func (c Client) WithEndpoint(endpoint string) Client {
c.endpoint = endpoint
return c
}