cdn

package
v0.0.0-...-ab98a91 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

View Source
const (
	// CDNDefaultEndpoint is the default API endpoint of CDN services
	CDNDefaultEndpoint = "https://cdn.aliyuncs.com"
	CDNAPIVersion      = "2014-11-11"
)
View Source
const (
	Web                       = "web"
	Download                  = "download"
	Video                     = "video"
	LiveStream                = "liveStream"
	Ipaddr                    = "ipaddr"
	Domain                    = "domain"
	OSS                       = "oss"
	Domestic                  = "domestic"
	Overseas                  = "overseas"
	Global                    = "global"
	ContentType               = "Content-Type"
	CacheControl              = "Cache-Control"
	ContentDisposition        = "Content-Disposition"
	ContentLanguage           = "Content-Language"
	Expires                   = "Expires"
	AccessControlAllowOrigin  = "Access-Control-Allow-Origin"
	AccessControlAllowMethods = "Access-Control-Allow-Methods"
	AccessControlMaxAge       = "Access-Control-Max-Age"
)

Variables

View Source
var SourceTypes = []string{Ipaddr, Domain, OSS}

Functions

This section is empty.

Types

type AddDomainRequest

type AddDomainRequest struct {
	DomainName string
	CdnType    string
	//optional
	SourceType string
	SourcePort int
	Sources    string
	Scope      string
}

type CacheConfigRequest

type CacheConfigRequest struct {
	DomainName   string
	CacheContent string
	TTL          string
	// optional
	Weight string
}

type CacheExpiredConfig

type CacheExpiredConfig struct {
	Status       string
	TTL          string
	CacheType    string
	Weight       string
	CacheContent string
	ConfigId     string
}

type CdnClient

type CdnClient struct {
	common.Client
}

func NewClient

func NewClient(accessKeyId string, accessKeySecret string) *CdnClient

func NewClientWithEndpoint

func NewClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string) *CdnClient

func (*CdnClient) AddCdnDomain

func (client *CdnClient) AddCdnDomain(req AddDomainRequest) (CdnCommonResponse, error)

func (*CdnClient) DeleteCacheExpiredConfig

func (client *CdnClient) DeleteCacheExpiredConfig(req DeleteCacheConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) DeleteCdnDomain

func (client *CdnClient) DeleteCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error)

func (*CdnClient) DeleteHttpHeaderConfig

func (client *CdnClient) DeleteHttpHeaderConfig(req DeleteHttpHeaderConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) DescribeCdnDomainDetail

func (client *CdnClient) DescribeCdnDomainDetail(req DescribeDomainRequest) (DomainResponse, error)

func (*CdnClient) DescribeCdnService

func (client *CdnClient) DescribeCdnService() (ServiceResponse, error)

func (*CdnClient) DescribeDomainConfigs

func (client *CdnClient) DescribeDomainConfigs(req DomainConfigRequest) (DomainConfigResponse, error)

func (*CdnClient) DescribeDomainsBySource

func (client *CdnClient) DescribeDomainsBySource(req DescribeDomainsBySourceRequest) (DomainBySourceResponse, error)

func (*CdnClient) DescribeRefreshQuota

func (client *CdnClient) DescribeRefreshQuota() (QuotaResponse, error)

func (*CdnClient) DescribeRefreshTasks

func (client *CdnClient) DescribeRefreshTasks(req DescribeRequest) (DescribeResponse, error)

func (*CdnClient) DescribeUserDomains

func (client *CdnClient) DescribeUserDomains(req DescribeDomainsRequest) (DomainsResponse, error)

func (*CdnClient) ModifyCdnDomain

func (client *CdnClient) ModifyCdnDomain(req ModifyDomainRequest) (CdnCommonResponse, error)

func (*CdnClient) ModifyCdnService

func (client *CdnClient) ModifyCdnService(req ServiceRequest) (CdnCommonResponse, error)

func (*CdnClient) ModifyFileCacheExpiredConfig

func (client *CdnClient) ModifyFileCacheExpiredConfig(req ModifyCacheConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) ModifyHttpHeaderConfig

func (client *CdnClient) ModifyHttpHeaderConfig(req ModifyHttpHeaderConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) ModifyPathCacheExpiredConfig

func (client *CdnClient) ModifyPathCacheExpiredConfig(req ModifyCacheConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) OpenCdnService

func (client *CdnClient) OpenCdnService(req ServiceRequest) (CdnCommonResponse, error)

func (*CdnClient) PushObjectCache

func (client *CdnClient) PushObjectCache(req RefreshRequest) (PushResponse, error)

func (*CdnClient) RefreshObjectCaches

func (client *CdnClient) RefreshObjectCaches(req RefreshRequest) (RefreshResponse, error)

func (*CdnClient) SetDomainServerCertificate

func (client *CdnClient) SetDomainServerCertificate(req CertificateRequest) (CdnCommonResponse, error)

func (*CdnClient) SetErrorPageConfig

func (client *CdnClient) SetErrorPageConfig(req ErrorPageConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetFileCacheExpiredConfig

func (client *CdnClient) SetFileCacheExpiredConfig(req CacheConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetForceRedirectConfig

func (client *CdnClient) SetForceRedirectConfig(req RedirectConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetHttpHeaderConfig

func (client *CdnClient) SetHttpHeaderConfig(req HttpHeaderConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetIgnoreQueryStringConfig

func (client *CdnClient) SetIgnoreQueryStringConfig(req QueryStringConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetIpBlackListConfig

func (client *CdnClient) SetIpBlackListConfig(req IpBlackRequest) (CdnCommonResponse, error)

func (*CdnClient) SetOptimizeConfig

func (client *CdnClient) SetOptimizeConfig(req ConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetPageCompressConfig

func (client *CdnClient) SetPageCompressConfig(req ConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetPathCacheExpiredConfig

func (client *CdnClient) SetPathCacheExpiredConfig(req CacheConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetRangeConfig

func (client *CdnClient) SetRangeConfig(req ConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetRefererConfig

func (client *CdnClient) SetRefererConfig(req ReferConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetReqAuthConfig

func (client *CdnClient) SetReqAuthConfig(req ReqAuthConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetSourceHostConfig

func (client *CdnClient) SetSourceHostConfig(req HostConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) SetVideoSeekConfig

func (client *CdnClient) SetVideoSeekConfig(req ConfigRequest) (CdnCommonResponse, error)

func (*CdnClient) StartCdnDomain

func (client *CdnClient) StartCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error)

func (*CdnClient) StopCdnDomain

func (client *CdnClient) StopCdnDomain(req DescribeDomainRequest) (CdnCommonResponse, error)

type CdnCommonResponse

type CdnCommonResponse struct {
	common.Response
}

type CertificateRequest

type CertificateRequest struct {
	DomainName              string
	CertName                string
	ServerCertificateStatus string
	// optional
	ServerCertificate string
	PrivateKey        string
}

type ConfigRequest

type ConfigRequest struct {
	DomainName string
	Enable     string
}

type DeleteCacheConfigRequest

type DeleteCacheConfigRequest struct {
	DomainName string
	CacheType  string
	ConfigID   string
}

type DeleteHttpHeaderConfigRequest

type DeleteHttpHeaderConfigRequest struct {
	DomainName string
	ConfigID   string
}

type DescribeDomainRequest

type DescribeDomainRequest struct {
	DomainName string
}

type DescribeDomainsBySourceRequest

type DescribeDomainsBySourceRequest struct {
	Sources string
}

type DescribeDomainsRequest

type DescribeDomainsRequest struct {
	//optional
	common.Pagination
	DomainName       string
	DomainStatus     string
	DomainSearchType string
}

type DescribeRequest

type DescribeRequest struct {
	// optional
	TaskId     string
	ObjectPath string
	common.Pagination
}

type DescribeResponse

type DescribeResponse struct {
	CdnCommonResponse
	common.PaginationResult
	Tasks struct {
		CDNTask []Task
	}
}

type DomainBySourceResponse

type DomainBySourceResponse struct {
	CdnCommonResponse
	Sources     string
	DomainsList struct {
		DomainsData []DomainsData
	}
}

type DomainConfigRequest

type DomainConfigRequest struct {
	DomainName string
	// optional
	ConfigList string
}

type DomainConfigResponse

type DomainConfigResponse struct {
	CdnCommonResponse
	DomainConfigs DomainConfigs
}

type DomainConfigs

type DomainConfigs struct {
	PageCompressConfig struct {
		Enable   string
		ConfigId string
		Status   string
	}
	WafConfig struct {
		Enable string
	}
	IgnoreQueryStringConfig struct {
		Enable      string
		ConfigId    string
		Status      string
		HashKeyArgs string
	}
	VideoSeekConfig struct {
		Enable   string
		ConfigId string
		Status   string
	}
	ReqAuthConfig struct {
		Key1     string
		Key2     string
		AuthType string
		TimeOut  string
	}
	RangeConfig struct {
		Enable   string
		ConfigId string
		Status   string
	}
	SrcHostConfig struct {
		DomainName string
	}
	OptimizeConfig struct {
		Enable   string
		ConfigId string
		Status   string
	}
	ErrorPageConfig struct {
		PageType      string
		CustomPageUrl string
		ErrorCode     string
	}
	RefererConfig struct {
		AllowEmpty string
		ReferType  string
		ReferList  string
	}
	CcConfig struct {
		Enable   string
		AllowIps string
		BlockIps string
		ConfigId string
		Status   string
	}
	HttpHeaderConfigs struct {
		HttpHeaderConfig []HttpHeaderConfig
	}
	CacheExpiredConfigs struct {
		CacheExpiredConfig []CacheExpiredConfig
	}
	NotifyUrlConfig struct {
		Enable    string
		NotifyUrl string
	}
	RedirectTypeConfig struct {
		RedirectType string
	}
}

type DomainDetail

type DomainDetail struct {
	DomainName              string
	Cname                   string
	HttpsCname              string
	Scope                   string
	CdnType                 string
	SourceType              string
	GmtCreated              string
	GmtModified             string
	DomainStatus            string
	CertificateName         string
	ServerCertificate       string
	ServerCertificateStatus string
	Sources                 struct {
		Source []string
	}
}

type DomainInfo

type DomainInfo struct {
	DomainName  string
	Status      string
	CreateTime  string
	UpdateTime  string
	DomainCname string
}

type DomainResponse

type DomainResponse struct {
	CdnCommonResponse
	GetDomainDetailModel DomainDetail
}

type Domains

type Domains struct {
	DomainName   string
	Cname        string
	CdnType      string
	DomainStatus string
	GmtCreated   string
	GmtModified  string
	Description  string
}

type DomainsData

type DomainsData struct {
	Source  string
	Domains struct {
		// contains filtered or unexported fields
	}
	DomainInfos struct {
		// contains filtered or unexported fields
	}
}

type DomainsResponse

type DomainsResponse struct {
	CdnCommonResponse
	common.PaginationResult
	Domains struct {
		PageData []Domains
	}
}

type ErrorPageConfigRequest

type ErrorPageConfigRequest struct {
	DomainName string
	PageType   string
	// optional
	CustomPageUrl string
}

type HostConfigRequest

type HostConfigRequest struct {
	DomainName    string
	BackSrcDomain string
}

type HttpHeaderConfig

type HttpHeaderConfig struct {
	Status      string
	HeaderKey   string
	HeaderValue string
	ConfigId    string
}

type HttpHeaderConfigRequest

type HttpHeaderConfigRequest struct {
	DomainName  string
	HeaderKey   string
	HeaderValue string
}

type IpBlackRequest

type IpBlackRequest struct {
	DomainName string
	// optional
	Enable   string
	BlockIps string
}

type LogDetail

type LogDetail struct {
	LogName   string
	LogPath   string
	LogSize   int32
	StartTime string
	EndTime   string
}

type ModifyCacheConfigRequest

type ModifyCacheConfigRequest struct {
	CacheConfigRequest
	ConfigID string
}

type ModifyDomainRequest

type ModifyDomainRequest struct {
	DomainName string
	SourceType string
	SourcePort int
	Sources    string
}

type ModifyHttpHeaderConfigRequest

type ModifyHttpHeaderConfigRequest struct {
	HttpHeaderConfigRequest
	ConfigID string
}

type MonitorDataItem

type MonitorDataItem struct {
	TimeStamp         string
	QueryPerSecond    string
	BytesHitRate      string
	BytesPerSecond    string
	RequestHitRate    string
	AverageObjectSize string
}

type PushResponse

type PushResponse struct {
	CdnCommonResponse
	PushTaskId string
}

type QueryStringConfigRequest

type QueryStringConfigRequest struct {
	DomainName string
	Enable     string
	// optional
	HashKeyArgs string
}

type QuotaResponse

type QuotaResponse struct {
	CdnCommonResponse
	UrlQuota  string
	DirQuota  string
	UrlRemain string
	DirRemain string
}

type RedirectConfigRequest

type RedirectConfigRequest struct {
	DomainName   string
	RedirectType string
}

type ReferConfigRequest

type ReferConfigRequest struct {
	DomainName string
	ReferType  string
	// optional
	ReferList  string
	AllowEmpty string
}

type RefreshRequest

type RefreshRequest struct {
	ObjectPath string
	// optional
	ObjectType string
}

type RefreshResponse

type RefreshResponse struct {
	CdnCommonResponse
	RefreshTaskId string
}

type ReqAuthConfigRequest

type ReqAuthConfigRequest struct {
	DomainName string
	AuthType   string
	// optional
	Key1    string
	Key2    string
	Timeout string
}

type Service

type Service struct {
	InternetChargeType string
	OpeningTime        string
	ChangingChargeType string
	ChangingAffectTime time.Time
	OperationLocks     struct {
		LockReason []string
	}
}

type ServiceRequest

type ServiceRequest struct {
	InternetChargeType string
}

type ServiceResponse

type ServiceResponse struct {
	CdnCommonResponse
	Service
}

type Task

type Task struct {
	TaskId       string
	ObjectPath   string
	Status       string
	Process      string
	CreationTime time.Time
	Description  string
}

type TaskItem

type TaskItem struct {
	TaskId       string
	ObjectPath   string
	Status       string
	CreationTime time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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