kpm

package
v0.0.0-...-be7a3bd Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliHelp         = `kpm  <command> [arguments]...`
	KclvmAbiVersion = "v0.4.3"
)
View Source
const DefaultGitignore = "/external/\n"
View Source
const DefaultKclModContent = string(`[expected]
kclvm_version="` + KclvmAbiVersion + `"`)
View Source
const DefaultRegistryAddr = "https://kpm.kusionstack.io"

Variables

This section is empty.

Functions

func CLI

func CLI(args ...string) error

func NewAddCmd

func NewAddCmd() *cli.Command

func NewDelCmd

func NewDelCmd() *cli.Command

func NewDownloadCmd

func NewDownloadCmd() *cli.Command

func NewInitCmd

func NewInitCmd() *cli.Command

func NewStoreAddCmd

func NewStoreAddCmd() *cli.Command

func NewStoreAddFileCmd

func NewStoreAddFileCmd() *cli.Command

func NewStoreCmd

func NewStoreCmd() *cli.Command

func Setup

func Setup() error

Types

type CliClient

type CliClient struct {
	GitStore         *GlobalStore.FileStore
	RegistryStore    *GlobalStore.FileStore
	WorkDir          string
	Root             string
	RegistryAddr     string
	RegistryAddrPath string
	KclVmVersion     string
	NestedMode       bool
}

func (CliClient) Build

func (c CliClient) Build(rb *RequireBase) error

func (CliClient) Get

func (c CliClient) Get(rb *RequireBase) error

func (CliClient) LoadKpmFileStruct

func (c CliClient) LoadKpmFileStruct(rb *RequireBase) (*KpmFile, error)

func (CliClient) LoadKpmFileStructInWorkdir

func (c CliClient) LoadKpmFileStructInWorkdir() (*KpmFile, error)

func (CliClient) PkgDownload

func (c CliClient) PkgDownload(rb *RequireBase) error

PkgDownload 下载包

func (CliClient) SaveKpmFileInWorkdir

func (c CliClient) SaveKpmFileInWorkdir(kf *KpmFile) error

type DirectRequire

type DirectRequire map[string]RequireBase

type GiteeInfo

type GiteeInfo struct {
	Id              int    `json:"id"`
	TagName         string `json:"tag_name"`
	TargetCommitish string `json:"target_commitish"`
	Prerelease      bool   `json:"prerelease"`
	Name            string `json:"name"`
	Body            string `json:"body"`
	Author          struct {
		Id                int    `json:"id"`
		Login             string `json:"login"`
		Name              string `json:"name"`
		AvatarUrl         string `json:"avatar_url"`
		Url               string `json:"url"`
		HtmlUrl           string `json:"html_url"`
		Remark            string `json:"remark"`
		FollowersUrl      string `json:"followers_url"`
		FollowingUrl      string `json:"following_url"`
		GistsUrl          string `json:"gists_url"`
		StarredUrl        string `json:"starred_url"`
		SubscriptionsUrl  string `json:"subscriptions_url"`
		OrganizationsUrl  string `json:"organizations_url"`
		ReposUrl          string `json:"repos_url"`
		EventsUrl         string `json:"events_url"`
		ReceivedEventsUrl string `json:"received_events_url"`
		Type              string `json:"type"`
	} `json:"author"`
	CreatedAt time.Time `json:"created_at"`
	Assets    []struct {
		BrowserDownloadUrl string `json:"browser_download_url"`
		Name               string `json:"name,omitempty"`
	} `json:"assets"`
}

GiteeInfo https://gitee.com/api/v5/repos/dotnetchina/SmartSQL/releases/latest

type GithubInfo

type GithubInfo struct {
	Url       string `json:"url"`
	AssetsUrl string `json:"assets_url"`
	UploadUrl string `json:"upload_url"`
	HtmlUrl   string `json:"html_url"`
	Id        int    `json:"id"`
	Author    struct {
		Login             string `json:"login"`
		Id                int    `json:"id"`
		NodeId            string `json:"node_id"`
		AvatarUrl         string `json:"avatar_url"`
		GravatarId        string `json:"gravatar_id"`
		Url               string `json:"url"`
		HtmlUrl           string `json:"html_url"`
		FollowersUrl      string `json:"followers_url"`
		FollowingUrl      string `json:"following_url"`
		GistsUrl          string `json:"gists_url"`
		StarredUrl        string `json:"starred_url"`
		SubscriptionsUrl  string `json:"subscriptions_url"`
		OrganizationsUrl  string `json:"organizations_url"`
		ReposUrl          string `json:"repos_url"`
		EventsUrl         string `json:"events_url"`
		ReceivedEventsUrl string `json:"received_events_url"`
		Type              string `json:"type"`
		SiteAdmin         bool   `json:"site_admin"`
	} `json:"author"`
	NodeId          string        `json:"node_id"`
	TagName         string        `json:"tag_name"`
	TargetCommitish string        `json:"target_commitish"`
	Name            string        `json:"name"`
	Draft           bool          `json:"draft"`
	Prerelease      bool          `json:"prerelease"`
	CreatedAt       time.Time     `json:"created_at"`
	PublishedAt     time.Time     `json:"published_at"`
	Assets          []interface{} `json:"assets"`
	TarballUrl      string        `json:"tarball_url"`
	ZipballUrl      string        `json:"zipball_url"`
	Body            string        `json:"body"`
}

type IndirectRequire

type IndirectRequire map[PkgString]GlobalStore.Integrity

type KCLFile

type KCLFile struct {
	//文件路径
	Path string
	//文件内容
	Body []byte
	//导入集合
	Imports Set.Set
	//写入标志
	WriterFlag bool
}

func NewKCLFileFromFile

func NewKCLFileFromFile(path string) (*KCLFile, error)

func (*KCLFile) AddPkgPrefix

func (f *KCLFile) AddPkgPrefix(str string)

func (*KCLFile) AddPkgPrefixFromPath

func (f *KCLFile) AddPkgPrefixFromPath(str string)

func (*KCLFile) Save

func (f *KCLFile) Save() error

type KpmFile

type KpmFile struct {
	//PackageName,this is usually the code source repository address
	PackageName string `json:"package_name"`
	//KclvmMinVersion,used to identify version conflict states
	KclvmMinVersion string `json:"kclvm_min_version"`
	//Dependencies that are directly needed, aliases are not duplicated
	Direct DirectRequire `json:"direct,omitempty"`
	//Indirect dependencies, do not look at the alias, the package name and version are unique
	Indirect IndirectRequire `json:"indirect,omitempty"`
}

type Metadata

type Metadata struct {
	Name        string                   `json:"name"`
	Version     Semver.VersionString     `json:"version"`
	Integrity   GlobalStore2.Integrity   `json:"integrity"`
	PackageSize int64                    `json:"package_size"`
	SubPkgName  []string                 `json:"sub_pkg_name,omitempty"`
	Files       GlobalStore2.FileInfoMap `json:"files,omitempty"`
}

func LoadLocalMetadata

func LoadLocalMetadata(pkgName string, pkgVersion Semver.VersionString, gs *GlobalStore2.FileStore) (*Metadata, error)

func NewMetadata

func NewMetadata(pkgName, pkgPath string, pkgVersion string, gs *GlobalStore2.FileStore) (*Metadata, error)

func (*Metadata) Build

func (md *Metadata) Build(gs *GlobalStore2.FileStore) error

func (*Metadata) Save

func (md *Metadata) Save(gs *GlobalStore2.FileStore) error

type PkgString

type PkgString = string

type Require

type Require struct {
	RequireBase
	Alias string `json:"alias,omitempty"`
}

type RequireBase

type RequireBase struct {
	RequirePkgStruct
	Integrity GlobalStore.Integrity `json:"integrity"`
}

type RequirePkgStruct

type RequirePkgStruct struct {
	Type    string               `json:"type"`
	Name    string               `json:"name"`
	Version Semver.VersionString `json:"version"`
}

func GetRequirePkgStruct

func GetRequirePkgStruct(ps PkgString) (*RequirePkgStruct, error)

func (*RequirePkgStruct) GetPkgString

func (rps *RequirePkgStruct) GetPkgString() PkgString

func (*RequirePkgStruct) GetShortName

func (rps *RequirePkgStruct) GetShortName() string

Directories

Path Synopsis
go-oneutils
Set

Jump to

Keyboard shortcuts

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