Documentation
¶
Index ¶
- type ByteShieldClient
- type Config
- type ScdnClient
- func (c *ScdnClient) Delete(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
- func (c *ScdnClient) Get(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
- func (c *ScdnClient) GetAPIVersion() string
- func (c *ScdnClient) GetBaseURL() string
- func (c *ScdnClient) GetCredentials() (string, string)
- func (c *ScdnClient) GetServiceName() string
- func (c *ScdnClient) GetTimeout() time.Duration
- func (c *ScdnClient) IsHealthy(ctx context.Context) error
- func (c *ScdnClient) Post(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
- func (c *ScdnClient) Put(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
- func (c *ScdnClient) SetBaseURL(baseURL string)
- func (c *ScdnClient) SetCredentials(apiKey, apiSecret string)
- func (c *ScdnClient) SetTimeout(timeout time.Duration)
- type ScdnRequest
- type ScdnResponse
- type ScdnStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteShieldClient ¶
type ByteShieldClient struct {
// contains filtered or unexported fields
}
ByteShieldClient is the main client struct that holds all service clients
func (*ByteShieldClient) ScdnClient ¶
func (c *ByteShieldClient) ScdnClient() (*ScdnClient, error)
ScdnClient returns or initializes the SCDN API client
type Config ¶
Config contains all the configuration for ByteShield provider
func (*Config) Client ¶
func (c *Config) Client() (*ByteShieldClient, error)
Client returns the ByteShield client
type ScdnClient ¶
type ScdnClient struct {
// contains filtered or unexported fields
}
ScdnClient SCDN API client for domain_v5 interfaces
func NewScdnClient ¶
func NewScdnClient(baseURL, apiKey, apiSecret string, timeout time.Duration) *ScdnClient
NewScdnClient creates a new SCDN API client using official ByteShield SDK
func NewScdnClientFromConfig ¶
func NewScdnClientFromConfig(client *ByteShieldClient) *ScdnClient
NewScdnClientFromConfig creates a new SCDN API client from ByteShieldClient config Deprecated: Use ByteShieldClient.ScdnClient() instead
func (*ScdnClient) Delete ¶
func (c *ScdnClient) Delete(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
Delete performs a DELETE request to SCDN API
func (*ScdnClient) Get ¶
func (c *ScdnClient) Get(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
Get performs a GET request to SCDN API
func (*ScdnClient) GetAPIVersion ¶
func (c *ScdnClient) GetAPIVersion() string
GetAPIVersion returns the API version being used
func (*ScdnClient) GetBaseURL ¶
func (c *ScdnClient) GetBaseURL() string
GetBaseURL returns the current base URL
func (*ScdnClient) GetCredentials ¶
func (c *ScdnClient) GetCredentials() (string, string)
GetCredentials returns the current API credentials
func (*ScdnClient) GetServiceName ¶
func (c *ScdnClient) GetServiceName() string
GetServiceName returns the service name
func (*ScdnClient) GetTimeout ¶
func (c *ScdnClient) GetTimeout() time.Duration
GetTimeout returns the current client timeout
func (*ScdnClient) IsHealthy ¶
func (c *ScdnClient) IsHealthy(ctx context.Context) error
IsHealthy checks if the SCDN API is healthy
func (*ScdnClient) Post ¶
func (c *ScdnClient) Post(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
Post performs a POST request to SCDN API
func (*ScdnClient) Put ¶
func (c *ScdnClient) Put(ctx context.Context, api string, req *ScdnRequest) (*ScdnResponse, error)
Put performs a PUT request to SCDN API
func (*ScdnClient) SetBaseURL ¶
func (c *ScdnClient) SetBaseURL(baseURL string)
SetBaseURL sets the base URL for the client
func (*ScdnClient) SetCredentials ¶
func (c *ScdnClient) SetCredentials(apiKey, apiSecret string)
SetCredentials sets the API credentials
func (*ScdnClient) SetTimeout ¶
func (c *ScdnClient) SetTimeout(timeout time.Duration)
SetTimeout sets the client timeout
type ScdnRequest ¶
type ScdnRequest struct {
Data map[string]interface{} `json:"data,omitempty"`
Query map[string]interface{} `json:"query,omitempty"`
Header map[string]string `json:"header,omitempty"`
}
ScdnRequest represents a request to SCDN API
type ScdnResponse ¶
type ScdnResponse struct {
Status ScdnStatus `json:"status"`
Data interface{} `json:"data,omitempty"`
}
ScdnResponse represents a response from SCDN API
type ScdnStatus ¶
ScdnStatus represents the status in SCDN API response