chore: move '/internal/pkg' to '/pkg'
This commit is contained in:
32
pkg/sdk3rd/wangsu/certificate/api_list_certificates.go
Normal file
32
pkg/sdk3rd/wangsu/certificate/api_list_certificates.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package certificate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ListCertificatesResponse struct {
|
||||
apiResponseBase
|
||||
|
||||
Certificates []*CertificateRecord `json:"ssl-certificates,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) ListCertificates() (*ListCertificatesResponse, error) {
|
||||
return c.ListCertificatesWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (c *Client) ListCertificatesWithContext(ctx context.Context) (*ListCertificatesResponse, error) {
|
||||
httpreq, err := c.newRequest(http.MethodGet, "/api/ssl/certificate")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
httpreq.SetContext(ctx)
|
||||
}
|
||||
|
||||
result := &ListCertificatesResponse{}
|
||||
if _, err := c.doRequestWithResult(httpreq, result); err != nil {
|
||||
return result, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user