feat: add cachefly deployer

This commit is contained in:
Fu Diwei
2025-02-18 11:45:41 +08:00
parent 7c3f2399c2
commit 46f02331fd
52 changed files with 433 additions and 192 deletions

View File

@@ -0,0 +1,19 @@
package cacheflysdk
import (
"encoding/json"
"net/http"
)
func (c *Client) CreateCertificate(req *CreateCertificateRequest) (*CreateCertificateResponse, error) {
params := make(map[string]any)
jsonData, _ := json.Marshal(req)
json.Unmarshal(jsonData, &params)
result := CreateCertificateResponse{}
err := c.sendRequestWithResult(http.MethodPost, "/certificates", params, &result)
if err != nil {
return nil, err
}
return &result, nil
}