helpers

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetComposerArchive added in v1.0.3

func GetComposerArchive(src []byte, repoUUID, repoRef string) ([]byte, error)

Note:

GitLab serves repository archive as tar.gz archive, so, for composer:

  • repack gitlab archive: ungzip -> untar -> zip
  • during repack, set directory and file mtime/atime to predefined constant
  • cleanup all temporary files and directories
  • cache archive bytes
  • return zip archive bytes

func GetNpmArchiveFromCache added in v1.0.3

func GetNpmArchiveFromCache(repoUUID, repoRef string) ([]byte, error)

Fetch .tgz version of npm archive stored in cache

func GetTokenFromRequest

func GetTokenFromRequest(r *http.Request) string

func PutNpmArchiveToCache added in v1.0.3

func PutNpmArchiveToCache(src []byte, repoUUID, repoRef string) ([]byte, string, error)

Note:

When project npm-shrinkwrap.json or yarn.lock used to access two different Pavlik instances with different GitLab instances, repository names can differ. In that case, mandatory "shasum" field will not match.

So, for npm: * repack tar.gz archive recevied from GitLab: tar.gz -> tar -> tar -> tgz * force set constant mtime/atime for directories and files * cache final archive bytes * return final archive bytes and calculated shasum

Types

This section is empty.

Jump to

Keyboard shortcuts

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