Documentation
¶
Index ¶
- type BatchOperation
- type BatchRequest
- type BatchResponse
- type BatchResult
- type CategoriesData
- type CategoriesResponse
- type Category
- type Client
- func (c *Client) BatchFiles(skillID int, req *BatchRequest) (*BatchResponse, error)
- func (c *Client) CreateSkill(req *CreateSkillRequest) (*CreateSkillResponse, error)
- func (c *Client) DeleteFile(skillID int, path string) error
- func (c *Client) DownloadSkill(id int, outputPath string) (string, error)
- func (c *Client) GetFile(skillID int, path string) (*FileContentResponse, error)
- func (c *Client) GetPackageDetail(id int) (*PackageDetailResponse, error)
- func (c *Client) GetSkillDetail(id int) (*DetailResponse, error)
- func (c *Client) GetSkillFiles(id int) (*FilesResponse, error)
- func (c *Client) HealthCheck() (*HealthResponse, error)
- func (c *Client) ImportZip(zipPath, description string, categoryID int, overwrite bool) (*ImportZipResponse, error)
- func (c *Client) ListCategories() ([]Category, error)
- func (c *Client) ListPackages(pageNum, pageSize int, keyword string) (*PackageListResponse, error)
- func (c *Client) ListSkills(pageNum, pageSize, categoryID int, keyword string) (*ListResponse, error)
- func (c *Client) Login(token string) (*LoginResponse, error)
- func (c *Client) PatchFile(skillID int, req *PatchFileRequest) (*PatchFileResponse, error)
- func (c *Client) Publish(skillID int, req *PublishRequest) (*PublishResponse, error)
- func (c *Client) PutFile(skillID int, req *PutFileRequest) (*PutFileResponse, error)
- func (c *Client) Unpublish(skillID int) error
- func (c *Client) UpdateSkill(req *UpdateSkillRequest) error
- func (c *Client) Validate(skillID int, strict bool) (*ValidateResponse, error)
- type CreateSkillRequest
- type CreateSkillResponse
- type DetailResponse
- type FileContent
- type FileContentResponse
- type FileNode
- type FilesData
- type FilesResponse
- type HealthResponse
- type ImportZipResponse
- type ListData
- type ListResponse
- type LoginResponse
- type PackageActionResponse
- type PackageDetailResponse
- type PackageListResponse
- type PatchEdit
- type PatchFileRequest
- type PatchFileResponse
- type PublishRequest
- type PublishResponse
- type PutFileRequest
- type PutFileResponse
- type Skill
- type SkillPackage
- type UpdateSkillRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchOperation ¶ added in v0.0.4
type BatchRequest ¶ added in v0.0.4
type BatchRequest struct {
Operations []BatchOperation `json:"operations"`
}
type BatchResponse ¶ added in v0.0.4
type BatchResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Results []BatchResult `json:"results"`
} `json:"data"`
}
type BatchResult ¶ added in v0.0.4
type CategoriesData ¶
type CategoriesResponse ¶
type CategoriesResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data CategoriesData `json:"data"`
}
type Client ¶
func (*Client) BatchFiles ¶ added in v0.0.4
func (c *Client) BatchFiles(skillID int, req *BatchRequest) (*BatchResponse, error)
BatchFiles 批量文件操作
func (*Client) CreateSkill ¶ added in v0.0.4
func (c *Client) CreateSkill(req *CreateSkillRequest) (*CreateSkillResponse, error)
CreateSkill 创建技能(支持初始文件)
func (*Client) DeleteFile ¶ added in v0.0.4
DeleteFile 删除单个技能文件
func (*Client) DownloadSkill ¶
func (*Client) GetFile ¶ added in v0.0.4
func (c *Client) GetFile(skillID int, path string) (*FileContentResponse, error)
GetFile 读取单个技能文件
func (*Client) GetPackageDetail ¶
func (c *Client) GetPackageDetail(id int) (*PackageDetailResponse, error)
func (*Client) GetSkillDetail ¶
func (c *Client) GetSkillDetail(id int) (*DetailResponse, error)
func (*Client) GetSkillFiles ¶
func (c *Client) GetSkillFiles(id int) (*FilesResponse, error)
func (*Client) HealthCheck ¶
func (c *Client) HealthCheck() (*HealthResponse, error)
func (*Client) ListCategories ¶
func (*Client) ListPackages ¶
func (c *Client) ListPackages(pageNum, pageSize int, keyword string) (*PackageListResponse, error)
func (*Client) ListSkills ¶
func (c *Client) ListSkills(pageNum, pageSize, categoryID int, keyword string) (*ListResponse, error)
func (*Client) PatchFile ¶ added in v0.0.4
func (c *Client) PatchFile(skillID int, req *PatchFileRequest) (*PatchFileResponse, error)
PatchFile 增量编辑技能文件
func (*Client) Publish ¶ added in v0.0.4
func (c *Client) Publish(skillID int, req *PublishRequest) (*PublishResponse, error)
Publish 发布技能
func (*Client) PutFile ¶ added in v0.0.4
func (c *Client) PutFile(skillID int, req *PutFileRequest) (*PutFileResponse, error)
PutFile 创建或更新单个技能文件
func (*Client) UpdateSkill ¶ added in v0.0.4
func (c *Client) UpdateSkill(req *UpdateSkillRequest) error
UpdateSkill 更新技能元数据
type CreateSkillRequest ¶ added in v0.0.4
type CreateSkillResponse ¶ added in v0.0.4
type DetailResponse ¶
type FileContent ¶ added in v0.0.4
type FileContent struct {
Path string `json:"path"`
Content string `json:"content"`
Size int64 `json:"size"`
Sha256 string `json:"sha256"`
UpdatedAt string `json:"updatedAt"`
}
单文件操作相关类型
type FileContentResponse ¶ added in v0.0.4
type FileContentResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data FileContent `json:"data"`
}
type FilesResponse ¶
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
}
type ImportZipResponse ¶
type ListResponse ¶
type LoginResponse ¶
type PackageActionResponse ¶
type PackageDetailResponse ¶
type PackageDetailResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data SkillPackage `json:"data"`
}
type PackageListResponse ¶
type PackageListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
CurrentPage int `json:"currentPage"`
Total int `json:"total"`
List []SkillPackage `json:"packagesList"`
} `json:"data"`
}
type PatchFileRequest ¶ added in v0.0.4
type PatchFileResponse ¶ added in v0.0.4
type PublishRequest ¶ added in v0.0.4
type PublishResponse ¶ added in v0.0.4
type PutFileRequest ¶ added in v0.0.4
type PutFileResponse ¶ added in v0.0.4
type Skill ¶
type Skill struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
CategoryID int `json:"categoryId"`
CategoryName string `json:"categoryName"`
Status int `json:"status"`
IsPublic bool `json:"isPublic"`
IsValid bool `json:"isValid"`
FilePath string `json:"filePath"`
License string `json:"license"`
DownloadCount int `json:"downloadCount"`
StarCount int `json:"starCount"`
FileSize int64 `json:"fileSize"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ValidatedAt string `json:"validatedAt"`
Tags []string `json:"tags"`
}
type SkillPackage ¶
type SkillPackage struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Color string `json:"color"`
CategoryID int `json:"categoryId"`
CategoryName string `json:"categoryName"`
IsFavorite bool `json:"isFavorite"`
SkillCount int `json:"skillCount"`
Skills []Skill `json:"skills,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type UpdateSkillRequest ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.