tools

package
v0.0.0-...-633f1b9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecode

func AESCBCDecode(key, content string) (result []byte, err error)

len 16 key(means AES-128) + key => len 16 iv

func AESCBCEncode

func AESCBCEncode(key string, content []byte) (result string, err error)

len 16 key(means AES-128) + key => len 16 iv

func CompareVersion

func CompareVersion(v1, v2 string) bool

func Contains

func Contains(ids []string, id string) bool

func CreateZipCompress

func CreateZipCompress(zipPath, dirPath, fileName string) (err error)

func DownloadFile

func DownloadFile(reqParam *NexusReqParam) (err error)

DownloadFile nexus 下载

func GetPath

func GetPath(path string) (newPath string, err error)

func ListFilesInRepo

func ListFilesInRepo(reqParam *NexusReqParam) (fileNameList []string, err error)

ListFilesInRepo 列出 nexus 仓库中特定目录下的所有文件

func PathExist

func PathExist(path string) (bool, error)

func ProcNodeSort

func ProcNodeSort(nodeIds []string, links [][]string) (nodeIndexMap map[string]int, isLoop bool)

func RSADecrypt

func RSADecrypt(inputString, rsaPemContent string) (string, error)

func RSAEncrypt

func RSAEncrypt(inputData []byte, rsaPemContent string) (string, error)

func RSAExtractPubKey

func RSAExtractPubKey(rsaPriPemContent string) (string, error)

func StringListContains

func StringListContains(inputList []string, target string) bool

func WriteJsonData2File

func WriteJsonData2File(path string, inter interface{}) (err error)

Types

type AssetChecksum

type AssetChecksum struct {
	Sha1 string `json:"sha1"`
	Md5  string `json:"md5"`
}

type AssetItem

type AssetItem struct {
	DownloadUrl  string         `json:"downloadUrl"`
	Path         string         `json:"path"`
	Id           string         `json:"id"`
	Repository   string         `json:"repository"`
	Checksum     *AssetChecksum `json:"checksum"`
	ContentType  string         `json:"contentType"`
	LastModified string         `json:"lastModified"`
}

type NexusFileParam

type NexusFileParam struct {
	SourceFilePath string `json:"sourceFilePath"` // 源文件的路径
	DestFilePath   string `json:"destFilePath"`   // 目标文件的路径
}

type NexusReqParam

type NexusReqParam struct {
	UserName   string            `json:"userName"`   // 用户名
	Password   string            `json:"password"`   // 密码
	RepoUrl    string            `json:"repoUrl"`    // repo 的 url: http://127.0.0.1:8081
	Repository string            `json:"repository"` // repo 名称: test
	TimeoutSec int64             `json:"timeoutSec"` // 超时时间, 单位:s
	FileParams []*NexusFileParam `json:"fileParams"` // 文件的参数列表
	DirPath    string            `json:"dirPath"`    // 查询文件列表的目录路径: /test/t1
}

type NexusUploadFileRet

type NexusUploadFileRet struct {
	SourceFilePath string `json:"sourceFilePath"` // 源文件的路径
	DestFilePath   string `json:"destFilePath"`   // 目标文件的路径
	StorePath      string `json:"storePath"`      // 文件存储的地址
}

func UploadFile

func UploadFile(reqParam *NexusReqParam) (result []*NexusUploadFileRet, err error)

UploadFile nexus 上传

type SearchAssetsResp

type SearchAssetsResp struct {
	Items             []*AssetItem `json:"items"`
	ContinuationToken string       `json:"continuationToken"` // 分页 token
}

Jump to

Keyboard shortcuts

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