api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoriesData

type CategoriesData struct {
	CurrentPage    int        `json:"currentPage"`
	Total          int        `json:"total"`
	CategoriesList []Category `json:"categoriesList"`
}

type CategoriesResponse

type CategoriesResponse struct {
	Code    int            `json:"code"`
	Message string         `json:"message"`
	Data    CategoriesData `json:"data"`
}

type Category

type Category struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Sort        int    `json:"sort"`
}

type Client

type Client struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) DownloadSkill

func (c *Client) DownloadSkill(id int, outputPath string) (string, error)

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) ImportZip

func (c *Client) ImportZip(zipPath, description string, categoryID int, overwrite bool) (*ImportZipResponse, error)

func (*Client) ListCategories

func (c *Client) ListCategories() ([]Category, error)

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) Login

func (c *Client) Login(token string) (*LoginResponse, error)

type DetailResponse

type DetailResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    Skill  `json:"data"`
}

type FileNode

type FileNode struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Path     string     `json:"path"`
	Type     string     `json:"type"`
	Content  string     `json:"content,omitempty"`
	Children []FileNode `json:"children,omitempty"`
}

type FilesData

type FilesData struct {
	Files []FileNode `json:"files"`
}

type FilesResponse

type FilesResponse struct {
	Code    int       `json:"code"`
	Message string    `json:"message"`
	Data    FilesData `json:"data"`
}

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

type ImportZipResponse

type ImportZipResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		SkillID int    `json:"skillId"`
		Name    string `json:"name"`
	} `json:"data"`
}

type ListData

type ListData struct {
	CurrentPage int     `json:"currentPage"`
	Total       int     `json:"total"`
	List        []Skill `json:"skillsList"`
}

type ListResponse

type ListResponse struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	Data    ListData `json:"data"`
}

type LoginResponse

type LoginResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		Token string `json:"token"`
	} `json:"data"`
}

type PackageActionResponse

type PackageActionResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

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 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"`
}

Jump to

Keyboard shortcuts

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