services

package
v0.0.0-...-a382c62 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoMainFlag = "no main flag"
)

Variables

This section is empty.

Functions

func CheckGithubWhiteList

func CheckGithubWhiteList(user string, repo string) bool

CheckGithubWhiteList 检验仓库信息是否在白名单内

func CheckNpmWhiteList

func CheckNpmWhiteList(user string, pkg string) bool

CheckNpmWhiteList 检验仓库信息是否在白名单内

func CheckWordpressWhitelist

func CheckWordpressWhitelist(t WpProxyType, name string) bool

func GetGithubRawFile

func GetGithubRawFile(user string, repo string, version string, path string) []byte

GetGithubRawFile 从 GitHub Raw 获取源文件信息

func GetNpmRawFile

func GetNpmRawFile(user string, pkg string, version string, path string) []byte

GetNpmRawFile 从 Npm 获取源文件信息

func GetWordpressRawFile

func GetWordpressRawFile(endpoint string, name string, version string, path string) []byte

func ParsePackageMainUrl

func ParsePackageMainUrl(info *NpmPackageData) (string, error)

Types

type Browser

type Browser struct {
	ServerJS *string `json:"./server.js,omitempty"`
}

type Browserify

type Browserify struct {
	Transform []string `json:"transform,omitempty"`
}

type Bugs

type Bugs struct {
	URL *string `json:"url,omitempty"`
}

type Dependencies

type Dependencies struct {
	LooseEnvify *string `json:"loose-envify,omitempty"`
	Scheduler   *string `json:"scheduler,omitempty"`
}

type Directories

type Directories struct {
}

type Dist

type Dist struct {
	Integrity    *string     `json:"integrity,omitempty"`
	Shasum       *string     `json:"shasum,omitempty"`
	Tarball      *string     `json:"tarball,omitempty"`
	FileCount    *int64      `json:"fileCount,omitempty"`
	UnpackedSize *int64      `json:"unpackedSize,omitempty"`
	Signatures   []Signature `json:"signatures,omitempty"`
	NpmSignature *string     `json:"npm-signature,omitempty"`
}

type Exports

type Exports struct {
	Empty         *string `json:".,omitempty"`
	Client        *string `json:"./client,omitempty"`
	Server        *Server `json:"./server,omitempty"`
	ServerBrowser *string `json:"./server.browser,omitempty"`
	ServerNode    *string `json:"./server.node,omitempty"`
	Profiling     *string `json:"./profiling,omitempty"`
	TestUtils     *string `json:"./test-utils,omitempty"`
	PackageJSON   *string `json:"./package.json,omitempty"`
}

type NpmOperationalInternal

type NpmOperationalInternal struct {
	Host *string `json:"host,omitempty"`
	Tmp  *string `json:"tmp,omitempty"`
}

type NpmPackageData

type NpmPackageData struct {
	Name                   string                  `json:"name"`
	Version                string                  `json:"version"`
	Description            *string                 `json:"description,omitempty"`
	Main                   *string                 `json:"main,omitempty"`
	Repository             *Repository             `json:"repository,omitempty"`
	Keywords               []string                `json:"keywords,omitempty"`
	License                *string                 `json:"license,omitempty"`
	Bugs                   *Bugs                   `json:"bugs,omitempty"`
	Homepage               *string                 `json:"homepage,omitempty"`
	Dependencies           *map[string]string      `json:"dependencies,omitempty"`
	PeerDependencies       *map[string]string      `json:"peerDependencies,omitempty"`
	Exports                *map[string]interface{} `json:"exports,omitempty"`
	Browser                *map[string]interface{} `json:"browser,omitempty"`
	Browserify             *map[string]interface{} `json:"browserify,omitempty"`
	Scripts                *map[string]string      `json:"scripts,omitempty"`
	ID                     string                  `json:"_id"`
	NodeVersion            string                  `json:"_nodeVersion"`
	NpmVersion             string                  `json:"_npmVersion"`
	Dist                   Dist                    `json:"dist"`
	NpmUser                NpmUser                 `json:"_npmUser"`
	Directories            Directories             `json:"directories"`
	Maintainers            []NpmUser               `json:"maintainers"`
	NpmOperationalInternal NpmOperationalInternal  `json:"_npmOperationalInternal"`
	HasShrinkwrap          bool                    `json:"_hasShrinkwrap"`
}

func GetPackageInfo

func GetPackageInfo(pkg string, version string) (*NpmPackageData, error)

GetPackageInfo 从 Registry 获取包信息

func UnmarshalNpmRegistryData

func UnmarshalNpmRegistryData(data []byte) (NpmPackageData, error)

func (*NpmPackageData) Marshal

func (r *NpmPackageData) Marshal() ([]byte, error)

type NpmUser

type NpmUser struct {
	Name  *string `json:"name,omitempty"`
	Email *string `json:"email,omitempty"`
}

type PeerDependencies

type PeerDependencies struct {
	React *string `json:"react,omitempty"`
}

type Repository

type Repository struct {
	Type      *string `json:"type,omitempty"`
	URL       *string `json:"url,omitempty"`
	Directory *string `json:"directory,omitempty"`
}

type Scripts

type Scripts struct {
	Start *string `json:"start,omitempty"`
}

type Server

type Server struct {
	Deno    *string `json:"deno,omitempty"`
	Worker  *string `json:"worker,omitempty"`
	Browser *string `json:"browser,omitempty"`
	Default *string `json:"default,omitempty"`
}

type Signature

type Signature struct {
	Keyid *string `json:"keyid,omitempty"`
	Sig   *string `json:"sig,omitempty"`
}

type WpProxyType

type WpProxyType string
const (
	WpProxyTypeTheme  WpProxyType = "theme"
	WpProxyTypePlugin WpProxyType = "plugin"
)

Jump to

Keyboard shortcuts

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