Documentation
¶
Index ¶
- func CompressZip(files []*os.File, dest string) error
- func CreateDeployment(client *kubernetes.Clientset, username, deploymentName string, ...) (*appsv1.Deployment, error)
- func CreateHttpsIngress(client *kubernetes.Clientset, namespace, serviceName, gateway string, ...) (*networkingv1beta1.Ingress, error)
- func CreateIngress(client *kubernetes.Clientset, namespace, serviceName, gateway string, ...) (*networkingv1beta1.Ingress, error)
- func CreateNamespace(client *kubernetes.Clientset, username string) error
- func CreateService(client *kubernetes.Clientset, username, serviceName string, ...) error
- func DeCompressZip(zipFile, dest string) error
- func DefaultConfigDir() string
- func FileToHexString(filePath string) (string, error)
- func FormatJobToString(name string, id int) string
- func GetDefaultNamedAddress(tomlPath string) (string, error)
- func GetFilenameWithSuffixAndFilenameOnly(path string) (fileName string, fileNameWithSuffix string)
- func GetFiles(workdir string, fuzzyPath []string, pathList []string) []string
- func GetJobNameAndIDFromFormatString(str string) (string, int, error)
- func GetKeyValuesFromString(keyValueString string) (map[string]string, error)
- func GetMyHostname() (string, error)
- func GetMyIP() (string, error)
- func GetNodeKey(name, address string) string
- func GetPodLogs(containerName, deploymentName, namespace string) (*restclient.Request, error)
- func GetRedundantPath(shortPath string, longPath string) (string, error)
- func GetSameFileNameFiles(workdir string, fileName string, pathList []string) []string
- func GetSuffixFiles(workdir string, suffixName string, pathList []string) []string
- func GetUIDAndGID() (string, string, error)
- func InitK8sClient() (*kubernetes.Clientset, error)
- func KeyValuesToString(keyValues []KeyValue) string
- func RandSeq(n int) string
- func ReplaceWithParam(content string, paramMap map[string]string) string
- func SaveMoveTomlString(moveToml *MoveToml) (string, error)
- func SlicePage(page, pageSize, nums int) (int, int, int, int)
- type Cmd
- type HttpUtil
- type KeyValue
- type MoveToml
- type Package
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressZip ¶
CompressZip Compress files to zip files File array, which can be files or folders under different dirs dest Compressed file storage address
func CreateDeployment ¶ added in v1.0.3
func CreateDeployment(client *kubernetes.Clientset, username, deploymentName string, container []corev1.Container) (*appsv1.Deployment, error)
CreateDeployment create deployment
func CreateHttpsIngress ¶ added in v1.0.3
func CreateHttpsIngress(client *kubernetes.Clientset, namespace, serviceName, gateway string, ports []corev1.ServicePort) (*networkingv1beta1.Ingress, error)
func CreateIngress ¶ added in v1.0.3
func CreateIngress(client *kubernetes.Clientset, namespace, serviceName, gateway string, ports []corev1.ServicePort) (*networkingv1beta1.Ingress, error)
func CreateNamespace ¶ added in v1.0.3
func CreateNamespace(client *kubernetes.Clientset, username string) error
func CreateService ¶ added in v1.0.3
func CreateService(client *kubernetes.Clientset, username, serviceName string, ports []corev1.ServicePort) error
func DefaultConfigDir ¶
func DefaultConfigDir() string
func FileToHexString ¶ added in v1.0.3
FileToHexString 读取文件内容,转换为 hex 字符串
func FormatJobToString ¶ added in v1.0.3
FormatJobToString 格式化为字符串 return: name(id)
func GetDefaultNamedAddress ¶ added in v1.0.3
func GetFilenameWithSuffixAndFilenameOnly ¶
GetFilenameWithSuffixAndFilenameOnly 获取带后置的文件名和不带后缀的文件名
func GetJobNameAndIDFromFormatString ¶ added in v1.0.3
func GetKeyValuesFromString ¶ added in v1.0.3
func GetMyHostname ¶ added in v1.0.3
func GetNodeKey ¶ added in v1.0.3
func GetPodLogs ¶ added in v1.0.3
func GetPodLogs(containerName, deploymentName, namespace string) (*restclient.Request, error)
func GetRedundantPath ¶
GetRedundantPath 获取多余的路径 longPath 相对于 shortPath 的 /a/b/ /a/b/c/d.txt return c/d.txt
func GetSameFileNameFiles ¶
GetSameFileNameFiles 获取路径下的所有相同文件文件名的文件 workdir 基础路径 fileName 要赛选的路径 pathList 查找到的路径对象
func GetSuffixFiles ¶
GetSuffixFiles 获取路径下的所有相同后缀文件 workdir 基础路径 suffixName 要赛选的路径 pathList 查找到的路径对象
func GetUIDAndGID ¶
func InitK8sClient ¶ added in v1.0.3
func InitK8sClient() (*kubernetes.Clientset, error)
func KeyValuesToString ¶ added in v1.0.3
func ReplaceWithParam ¶
ReplaceWithParam 参数替换
func SaveMoveTomlString ¶ added in v1.0.3
Types ¶
type Cmd ¶
func NewCommand ¶
NewCommand is like exec.CommandContext but ensures that subprocesses are killed when the context times out, not just the top level process.
type HttpUtil ¶ added in v1.0.3
type HttpUtil struct {
// contains filtered or unexported fields
}
func (*HttpUtil) NewRequest ¶ added in v1.0.3
func (h *HttpUtil) NewRequest() *resty.Request
type KeyValue ¶ added in v1.0.3
func KeyValuesFromString ¶ added in v1.0.3
type MoveToml ¶ added in v1.0.3
type MoveToml struct { Package `toml:"package"` Addresses map[string]string `toml:"addresses"` Dependencies map[string]any `toml:"dependencies"` }
MoveToml Move.toml