Documentation ¶
Index ¶
- Constants
- func CheckGithubWhiteList(user string, repo string) bool
- func CheckNpmWhiteList(user string, pkg string) bool
- func CheckWordpressWhitelist(t WpProxyType, name string) bool
- func GetGithubRawFile(user string, repo string, version string, path string) []byte
- func GetNpmRawFile(user string, pkg string, version string, path string) []byte
- func GetWordpressRawFile(endpoint string, name string, version string, path string) []byte
- func ParsePackageMainUrl(info *NpmPackageData) (string, error)
- type Browser
- type Browserify
- type Bugs
- type Dependencies
- type Directories
- type Dist
- type Exports
- type NpmOperationalInternal
- type NpmPackageData
- type NpmUser
- type PeerDependencies
- type Repository
- type Scripts
- type Server
- type Signature
- type WpProxyType
Constants ¶
View Source
const (
ErrNoMainFlag = "no main flag"
)
Variables ¶
This section is empty.
Functions ¶
func CheckGithubWhiteList ¶
CheckGithubWhiteList 检验仓库信息是否在白名单内
func CheckNpmWhiteList ¶
CheckNpmWhiteList 检验仓库信息是否在白名单内
func CheckWordpressWhitelist ¶
func CheckWordpressWhitelist(t WpProxyType, name string) bool
func GetGithubRawFile ¶
GetGithubRawFile 从 GitHub Raw 获取源文件信息
func GetNpmRawFile ¶
GetNpmRawFile 从 Npm 获取源文件信息
func GetWordpressRawFile ¶
func ParsePackageMainUrl ¶
func ParsePackageMainUrl(info *NpmPackageData) (string, error)
Types ¶
type Browserify ¶
type Browserify struct {
Transform []string `json:"transform,omitempty"`
}
type Dependencies ¶
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 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 PeerDependencies ¶
type PeerDependencies struct {
React *string `json:"react,omitempty"`
}
type Repository ¶
type WpProxyType ¶
type WpProxyType string
const ( WpProxyTypeTheme WpProxyType = "theme" WpProxyTypePlugin WpProxyType = "plugin" )
Click to show internal directories.
Click to hide internal directories.