Documentation ¶
Index ¶
- func AfterJava8(version *semver.Version) bool
- func BeforeJava9(version *semver.Version) bool
- func CopyDirectory(source string, destination string) error
- func CopyFile(source string, destination string) error
- func CopySymlink(source string, destination string) error
- func ExtractTar(source string, destination string, stripComponents int) error
- func ExtractTarGz(source string, destination string, stripComponents int) error
- func ExtractTarXz(source string, destination string, stripComponents int) error
- func ExtractZip(source string, destination string, stripComponents int) error
- func FileExists(file string) (bool, error)
- func FindFiles(root string, pattern *regexp.Regexp) ([]string, error)
- func FindMainModule(application application.Application) (string, bool, error)
- func HasFile(root string, pattern *regexp.Regexp) (bool, error)
- func ReadBuildpackYaml(buildpackYAMLPath string, config interface{}) error
- func WriteFile(filename string, perm os.FileMode, format string, args ...interface{}) error
- func WriteFileFromReader(filename string, perm os.FileMode, source io.Reader) error
- func WriteSymlink(oldName string, newName string) error
- type ApplicationRoute
- type ApplicationRoutes
- type Credentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterJava8 ¶
After Java8 returns true if a version is greater than or equal to 8.0.0 and false if less.
func BeforeJava9 ¶
BeforeJava9 returns true if a version is less 9.0.0 and false if greater.
func CopyDirectory ¶
CopyDirectory copies source to destination recursively.
func CopyFile ¶
CopyFile copies source to destination. Before writing, it creates all required parent directories for the destination.
func CopySymlink ¶
CopySymlink copies source to destination. Before writing, it creates all required parent directories for the destination.
func ExtractTar ¶
ExtractTar extracts a source TAR file to a destination directory. An arbitrary number of top-level directory components can be stripped from each path.
func ExtractTarGz ¶
ExtractTarGz extracts source GZIP'd TAR file to a destination directory. An arbitrary number of top-level directory components can be stripped from each path.
func ExtractTarXz ¶
ExtractTarXz extracts source XZ TAR file to a destination directory.
func ExtractZip ¶
ExtractZip extracts source ZIP file to a destination directory. An arbitrary number of top-level directory components can be stripped from each path.
func FileExists ¶
FileExists returns whether a file exists taking into account various error cases.
func FindFiles ¶
FindFiles searches a directory structure for files matching the provided pattern, returning their full paths if found.
func FindMainModule ¶
func FindMainModule(application application.Application) (string, bool, error)
FindMainModule examines a package.json file in the root of the Application and returns the value for "main" if it exists. If it does not exist, returns false.
func HasFile ¶
HasFile searches a directory structure for a file matching the provided pattern, returning true if found.
func ReadBuildpackYaml ¶
func WriteFile ¶
WriteFile writes a file with the given content. Before writing, it creates all required parent directories for the file.
func WriteFileFromReader ¶
WriteFileFromReader writes a file with the given content from a io.Reader. Before writing, it creates all required parent directories for the file.
func WriteSymlink ¶
WriteSymlink creates newName as a symbolic link to oldName. Before writing, it creates all required parent directories for the newName.
Types ¶
type ApplicationRoute ¶
type ApplicationRoute struct { // Port is the port exposed as part of the route. Port int `json:"port"` // URI is the URI exposed by the route. URI string `json:"uri"` }
ApplicationRoute represents a route exposed by the platform to an application.
type ApplicationRoutes ¶
type ApplicationRoutes map[string]ApplicationRoute
ApplicationRoutes is a map of route name to ApplicationRoute.
func DefaultApplicationRoutes ¶
func DefaultApplicationRoutes() (ApplicationRoutes, error)
DefaultApplicationRoutes creates a new instance of ApplicationRoutes, extracting the value from the CNB_APP_ROUTES environment variable.
type Credentials ¶
type Credentials map[string]interface{}
Credentials is the collection of credentials available exposed by a service.
func FindServiceCredentials ¶
func FindServiceCredentials(filter string, credentials ...string) (Credentials, bool, error)
FindServiceCredentials returns the credentials payload for given service. The selected service is one who's BindingName, InstanceName, Label, or Tags contain the filter and has the required credentials. Returns the credentials and true if exactly one service is matched, otherwise false.
NOTE: This function should ONLY be used in helper applications executed at launch time. It is BY DESIGN that credential values are not available when the buildpack is executing.
Source Files ¶
- application_routes.go
- copy_directory.go
- copy_file.go
- copy_symlink.go
- extract_tar.go
- extract_tar_gz.go
- extract_tar_xz.go
- extract_zip.go
- file_exists.go
- find_files.go
- find_main_module.go
- find_service_credentials.go
- handle_tar.go
- has_file.go
- java_version.go
- read_buildpack_yaml.go
- stripped_path.go
- write_file.go
- write_file_from_reader.go
- write_symlink.go