* [Fix] Relocate User Permanent SSH Public Key queries to DevcontainerService Layer * [Fix] Add Unix Timestamps in DB table `devstar_devcontainer` * [Feature] Tencent NAT port forwarding * [Doc] k8s Operator RBAC: ServiceAccount, ClusterRole, ClusterRoleBinding, etc. * [fix] k8s Operator Reconciler error while converting YAML to JSON * [Doc] Added DevStar API Doc * [fix] detailed errors while listing user devcontainers * [fix] Invalid metadata.labels: value must be no more than 63 characters
21 lines
645 B
Go
21 lines
645 B
Go
package errors
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// ErrFailed2CreateNATRule 封装创建 NAT 失败消息的结构化数据
|
|
type ErrFailed2CreateNATRule struct {
|
|
CloudProviderName string
|
|
PortDescription string
|
|
PrivatePort uint64
|
|
PublicPort uint64
|
|
Reason string
|
|
}
|
|
|
|
// Error 实现 error 定义的 Error 接口,将结构化的错误消息转为文本日志信息
|
|
func (err ErrFailed2CreateNATRule) Error() string {
|
|
return fmt.Sprintf("Failed to create NAT Rule '%s' from private port %v to public port %v on Cloud Provider '%s': %v",
|
|
err.PortDescription, err.PrivatePort, err.PublicPort, err.CloudProviderName, err.Reason)
|
|
}
|