Documentation ¶
Index ¶
- Variables
- func ConfigureApp(config *pkgmirror.Config, l *goapp.Lifecycle)
- func ConfigureHttp(name string, conf *pkgmirror.NpmConfig, app *goapp.App)
- func NewArchivePat(code string) goji.Pattern
- type FullPackageDefinition
- type NpmConfig
- type NpmService
- func (ns *NpmService) Get(key string) ([]byte, error)
- func (ns *NpmService) Init(app *goapp.App) (err error)
- func (ns *NpmService) Serve(state *goapp.GoroutineState) error
- func (ns *NpmService) SyncPackages() error
- func (ns *NpmService) UpdatePackage(key string) error
- func (ns *NpmService) WriteArchive(w io.Writer, pkg, version string) error
- type PackagePat
- type PackageVersionDefinition
- type ShortPackageDefinition
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NPM_ARCHIVE = regexp.MustCompile(`http(s|):\/\/([\w\.]+)\/(.*)`)
)
Functions ¶
func NewArchivePat ¶
func NewArchivePat(code string) goji.Pattern
Types ¶
type FullPackageDefinition ¶
type FullPackageDefinition struct { ID string `json:"_id,omitempty"` Rev string `json:"_rev,omitempty"` Name string `json:"name,omitempty"` Description *json.RawMessage `json:"description,omitempty"` DistTags *json.RawMessage `json:"dist-tags"` Versions map[string]*PackageVersionDefinition `json:"versions,omitempty"` //Readme *json.RawMessage `json:"readme,omitempty"` //Maintainers *json.RawMessage `json:"maintainers,omitempty"` Time *json.RawMessage `json:"time,omitempty"` Author *json.RawMessage `json:"author,omitempty"` Repository *json.RawMessage `json:"repository,omitempty"` //Users *json.RawMessage `json:"users,omitempty"` //ReadmeFilename *json.RawMessage `json:"readmeFilename,omitempty"` //Homepage *json.RawMessage `json:"homepage,omitempty"` //Bugs *json.RawMessage `json:"bugs,omitempty"` License *json.RawMessage `json:"license,omitempty"` Attachments *json.RawMessage `json:"_attachments,omitempty"` }
type NpmService ¶
type NpmService struct { DB *bolt.DB Config *NpmConfig Logger *log.Entry GitConfig *git.GitConfig Vault *vault.Vault StateChan chan pkgmirror.State BoltCompacter *pkgmirror.BoltCompacter // contains filtered or unexported fields }
func NewNpmService ¶
func NewNpmService() *NpmService
func (*NpmService) Serve ¶
func (ns *NpmService) Serve(state *goapp.GoroutineState) error
func (*NpmService) SyncPackages ¶
func (ns *NpmService) SyncPackages() error
func (*NpmService) UpdatePackage ¶
func (ns *NpmService) UpdatePackage(key string) error
func (*NpmService) WriteArchive ¶
func (ns *NpmService) WriteArchive(w io.Writer, pkg, version string) error
type PackagePat ¶
type PackageVersionDefinition ¶
type PackageVersionDefinition struct { Name string `json:"name,omitempty"` Description *json.RawMessage `json:"description,omitempty"` Version string `json:"version,omitempty"` Homepage *json.RawMessage `json:"homepage,omitempty"` Repository *json.RawMessage `json:"repository,omitempty"` //Contributors *json.RawMessage `json:"contributors,omitempty"` Main *json.RawMessage `json:"main,omitempty"` Licences *json.RawMessage `json:"licenses,omitempty"` Author *json.RawMessage `json:"author,omitempty"` Tags *json.RawMessage `json:"tags,omitempty"` Files *json.RawMessage `json:"files,omitempty"` Bin *json.RawMessage `json:"bin,omitempty"` Man *json.RawMessage `json:"man,omitempty"` Dependencies *json.RawMessage `json:"dependencies,omitempty"` DevDependencies *json.RawMessage `json:"devDependencies,omitempty"` PeerDependencies *json.RawMessage `json:"peerDependencies,omitempty"` OptionalDependencies *json.RawMessage `json:"optionalDependencies,omitempty"` EngineStrict *json.RawMessage `json:"engineStrict,omitempty"` Scripts *json.RawMessage `json:"scripts,omitempty"` Engines *json.RawMessage `json:"engines,omitempty"` Gypfile *json.RawMessage `json:"gypfile,omitempty"` License *json.RawMessage `json:"license,omitempty"` GitHead *json.RawMessage `json:"gitHead,omitempty"` //Bugs *json.RawMessage `json:"bugs,omitempty"` Binary *json.RawMessage `json:"binary,omitempty"` Os *json.RawMessage `json:"os,omitempty"` Cpu *json.RawMessage `json:"cpu,omitempty"` PreferGlobal *json.RawMessage `json:"preferGlobal,omitempty"` PublishConfig *json.RawMessage `json:"publishConfig,omitempty"` BundleDependencies *json.RawMessage `json:"bundleDependencies,omitempty"` Keywords *json.RawMessage `json:"keywords,omitempty"` //ID *json.RawMessage `json:"_id,omitempty"` //Shasum *json.RawMessage `json:"_shasum,omitempty"` //From *json.RawMessage `json:"_from,omitempty"` //NpmVersion *json.RawMessage `json:"_npmVersion,omitempty"` //NodeVersion *json.RawMessage `json:"_nodeVersion,omitempty"` //NpmUser *json.RawMessage `json:"_npmUser,omitempty"` //Maintainers *json.RawMessage `json:"maintainers,omitempty"` Dist struct { Shasum string `json:"shasum,omitempty"` Tarball string `json:"tarball,omitempty"` } `json:"dist,omitempty"` //NpmOperationalInternal *json.RawMessage `json:"_npmOperationalInternal,omitempty"` Directories *json.RawMessage `json:"directories,omitempty"` }
Click to show internal directories.
Click to hide internal directories.