connectivity

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (*ScdnClient) Upload added in v1.0.2

func (c *ScdnClient) Upload(ctx context.Context, api string, params map[string]string, fileField, filePath string) (*ScdnResponse, error)

Upload performs a multipart file upload to SCDN API

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