Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c6577
commit e1c0f5a
Showing
26 changed files
with
1,514 additions
and
748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package cdn | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/volcengine/volc-sdk-golang/service/cdn" | ||
) | ||
|
||
func AddCdnCertificate(t *testing.T) { | ||
resp, err := DefaultInstance.AddCdnCertificate(&cdn.AddCdnCertificateRequest{ | ||
Certificate: cdn.Certificate{ | ||
Certificate: cdn.GetStrPtr("-----BEGIN CERTIFICATE-----\\r\\nHmU2w=\\r\\n-----END CERTIFICATE-----\\r\\n-----BEGIN CERTIFICATE-----\\r\\nMIIElg==\\r\\n-----END CERTIFICATE-----\\r\\n-----BEGIN CERTIFICATE-----\\r\\nMIIDV5Adg\\r\\n06O/nVsJ8dWd4=\\r\\n-----END CERTIFICATE-----"), | ||
PrivateKey: cdn.GetStrPtr("-----BEGIN RSA PRIVATE KEY-----\nMIIE6\nBNtw==\n-----END RSA PRIVATE KEY-----"), | ||
}, | ||
CertInfo: &cdn.AddCdnCertInfo{ | ||
Desc: cdn.GetStrPtr("MyCert"), | ||
}, | ||
Source: cdn.GetStrPtr("volc_cert_center"), | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.NotNil(t, resp) | ||
fmt.Printf("%+v", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package cdn | ||
|
||
import ( | ||
"fmt" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/volcengine/volc-sdk-golang/service/cdn" | ||
"testing" | ||
) | ||
|
||
func BatchDeployCert(t *testing.T) { | ||
resp, err := DefaultInstance.BatchDeployCert(&cdn.BatchDeployCertRequest{ | ||
CertId: "cert-c195f679cecb4fc5yjt3dd8c54e6c0a2", | ||
Domain: "www.example.com,img.example.com", | ||
}) | ||
assert.NoError(t, err) | ||
assert.NotNil(t, resp) | ||
fmt.Printf("%+v", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package cdn | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/volcengine/volc-sdk-golang/service/cdn" | ||
) | ||
|
||
func DescribeCertConfig(t *testing.T) { | ||
resp, err := DefaultInstance.DescribeCertConfig(&cdn.DescribeCertConfigRequest{ | ||
CertId: cdn.GetStrPtr("cert-2b12dd79c3ef441ea1e58a09248d0fd6"), | ||
}) | ||
assert.NoError(t, err) | ||
assert.NotNil(t, resp) | ||
fmt.Printf("%+v", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
package cdn | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/volcengine/volc-sdk-golang/service/cdn" | ||
"testing" | ||
) | ||
|
||
func DescribeIPInfo(t *testing.T) { | ||
resp, err := DefaultInstance.DescribeIPInfo(&cdn.DescribeIPInfoRequest{ | ||
IP: exampleDomain, | ||
IP: "1.1.1.1", | ||
}) | ||
assert.NoError(t, err) | ||
assert.Equal(t, exampleDomain, resp.Result.IP) | ||
rsp, _ := json.Marshal(resp) | ||
fmt.Printf("%+v", string(rsp)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cdn | ||
|
||
import ( | ||
"fmt" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func ListCdnCertInfo(t *testing.T) { | ||
resp, err := DefaultInstance.ListCdnCertInfo(nil) | ||
assert.NoError(t, err) | ||
assert.NotNil(t, resp) | ||
fmt.Printf("%+v", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cdn | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/volcengine/volc-sdk-golang/service/cdn" | ||
) | ||
|
||
func ListCertInfo(t *testing.T) { | ||
resp, err := DefaultInstance.ListCertInfo(&cdn.ListCertInfoRequest{ | ||
Source: cdn.GetStrPtr("volc_cert_center"), | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.NotNil(t, resp) | ||
fmt.Printf("%+v", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.