Documentation
¶
Index ¶
- Variables
- func CheckAndDownloadArtifact(statusPath, downloadPath, token string, builder *models.Artifact, ...) (string, string, error)
- func ReDownloadSaasArtifact() error
- func RegisterLicense() error
- func SaasHeaders(token string) map[string]string
- func SecurityAuthAlert()
- type DownloadResult
- type LicenseData
- type LicenseResponse
- type PollingTimeoutError
- type SaasClient
- func (c *SaasClient) CheckAndDownloadArtifact(statusPath, downloadPath string, builder *models.Artifact, ...) DownloadResult
- func (c *SaasClient) CheckBuildStatus(statusPath string) (string, error)
- func (c *SaasClient) DownloadArtifact(downloadPath string, builder *models.Artifact) error
- func (c *SaasClient) GetLicenseInfo() (*clientpb.LicenseInfo, string, error)
- func (c *SaasClient) GetLicenseType() string
- func (c *SaasClient) RegisterLicense() (string, error)
- func (c *SaasClient) SetLicenseType(typ string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPollingTimeout = &PollingTimeoutError{}
Functions ¶
func CheckAndDownloadArtifact ¶
func CheckAndDownloadArtifact(statusPath, downloadPath, token string, builder *models.Artifact, pollInterval, maxPollTime time.Duration) (string, string, error)
对外导出:兼容外部包调用
func SecurityAuthAlert ¶ added in v0.1.2
func SecurityAuthAlert()
Types ¶
type DownloadResult ¶
type LicenseData ¶ added in v0.1.2
type LicenseData struct {
Username string `json:"username"`
Email string `json:"email,omitempty"`
Token string `json:"token,omitempty"`
Type string `json:"type"`
ExpireAt string `json:"expire_at,omitempty"`
BuildCount int64 `json:"build_count,omitempty"`
MaxBuilds int64 `json:"max_builds,omitempty"`
}
func NewCommunityLicense ¶ added in v0.1.2
func NewCommunityLicense() *LicenseData
创建默认的社区版 License 数据
func (*LicenseData) ToLicenseInfo ¶ added in v0.1.2
func (l *LicenseData) ToLicenseInfo() *clientpb.LicenseInfo
转换为 protobuf LicenseInfo
type LicenseResponse ¶ added in v0.1.2
type LicenseResponse struct {
Success bool `json:"success"`
License LicenseData `json:"license"`
}
LicenseResponse SaaS API 统一响应结构
type PollingTimeoutError ¶
type PollingTimeoutError struct{}
func (*PollingTimeoutError) Error ¶
func (e *PollingTimeoutError) Error() string
type SaasClient ¶
func GetSaasClient ¶ added in v0.1.2
func GetSaasClient() *SaasClient
func (*SaasClient) CheckAndDownloadArtifact ¶
func (c *SaasClient) CheckAndDownloadArtifact(statusPath, downloadPath string, builder *models.Artifact, pollInterval, maxPollTime time.Duration) DownloadResult
轮询并下载产物
func (*SaasClient) CheckBuildStatus ¶
func (c *SaasClient) CheckBuildStatus(statusPath string) (string, error)
查询构建状态
func (*SaasClient) DownloadArtifact ¶
func (c *SaasClient) DownloadArtifact(downloadPath string, builder *models.Artifact) error
下载构建产物
func (*SaasClient) GetLicenseInfo ¶ added in v0.1.2
func (c *SaasClient) GetLicenseInfo() (*clientpb.LicenseInfo, string, error)
获取 License 信息
func (*SaasClient) GetLicenseType ¶ added in v0.1.2
func (c *SaasClient) GetLicenseType() string
获取 LicenseType
func (*SaasClient) RegisterLicense ¶ added in v0.1.2
func (c *SaasClient) RegisterLicense() (string, error)
注册 License
func (*SaasClient) SetLicenseType ¶ added in v0.1.2
func (c *SaasClient) SetLicenseType(typ string)
Click to show internal directories.
Click to hide internal directories.