connectivity

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

type Config struct {
	AccessKey string
	SecretKey string
	Endpoint  string
	Region    string
}

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

type ScdnStatus struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ScdnStatus represents the status in SCDN API response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL