Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureJRE(configCtx ConfigJREContext) error
- func IsBeforeJava18(candidate string) bool
- func IsBeforeJava9(candidate string) bool
- func IsBuildContribution(metadata map[string]interface{}) bool
- func IsLaunchContribution(metadata map[string]interface{}) bool
- func NewManifest(applicationPath string) (*properties.Properties, error)
- func NewManifestFromJAR(jarFilePath string) (*properties.Properties, error)
- type Build
- type BuildOption
- type CertificateLoader
- type ConfigJREContext
- type Detect
- type DistributionType
- type ExtendConfig
- type ExtendImageConfig
- type ExtendImageConfigArg
- type Generate
- type GenerateContentBuilder
- type GenerateContentContext
- type GenerateContentResult
- type JDK
- type JKSKeystore
- type JLink
- type JRE
- type JVMVersion
- type JavaSecurityProperties
- type Keystore
- type MavenJAR
- type NIK
- type NativeImage
- type PasswordLessPKCS12Keystore
- type SDKInfo
Constants ¶
View Source
const ( PlanEntryNativeImageBuilder = "native-image-builder" PlanEntryJRE = "jre" PlanEntryJDK = "jdk" )
View Source
const DefaultCertFile = "/etc/ssl/certs/ca-certificates.crt"
Variables ¶
View Source
var Java18, _ = semver.NewVersion("18")
View Source
var Java9, _ = semver.NewVersion("9")
Functions ¶
func ConfigureJRE ¶
func ConfigureJRE(configCtx ConfigJREContext) error
func IsBeforeJava18 ¶
func IsBeforeJava9 ¶
func IsBuildContribution ¶
func IsLaunchContribution ¶
func NewManifest ¶
func NewManifest(applicationPath string) (*properties.Properties, error)
NewManifest reads the <APP>/META-INF/MANIFEST.MF file if it exists, normalizing it into the standard properties form.
func NewManifestFromJAR ¶
func NewManifestFromJAR(jarFilePath string) (*properties.Properties, error)
NewManifestFromJAR reads the META-INF/MANIFEST.MF from a JAR file if it exists, normalizing it into the standard properties form.
Types ¶
type Build ¶
type Build struct { Logger log.Logger CertLoader CertificateLoader DependencyCache libpak.DependencyCache Native NativeImage CustomHelpers []string Contributable []libpak.Contributable }
type BuildOption ¶
func WithCustomHelpers ¶
func WithCustomHelpers(customHelpers []string) BuildOption
func WithNativeImage ¶
func WithNativeImage(nativeImage NativeImage) BuildOption
type CertificateLoader ¶
func NewCertificateLoader ¶
func NewCertificateLoader(logger log.Logger) CertificateLoader
func (*CertificateLoader) Load ¶
func (c *CertificateLoader) Load(path string, password string) error
func (*CertificateLoader) Metadata ¶
func (c *CertificateLoader) Metadata() (map[string]interface{}, error)
type ConfigJREContext ¶
type ConfigJREContext struct { Layer *libcnb.Layer Logger log.Logger JavaHome string JavaVersion string ApplicationPath string IsBuild bool IsLaunch bool SkipCerts bool CertificateLoader CertificateLoader DistType DistributionType }
type DistributionType ¶
type DistributionType uint8
const ( JDKType DistributionType = iota JREType )
func (DistributionType) String ¶
func (d DistributionType) String() string
type ExtendConfig ¶
type ExtendConfig struct {
Build ExtendImageConfig `toml:"build"`
}
type ExtendImageConfig ¶
type ExtendImageConfig struct {
Args []ExtendImageConfigArg `toml:"args"`
}
type ExtendImageConfigArg ¶
type Generate ¶
type Generate struct { Logger log.Logger GenerateContentBuilder GenerateContentBuilder }
func NewGenerate ¶
func NewGenerate(logger log.Logger, contentBuilder GenerateContentBuilder) Generate
type GenerateContentBuilder ¶
type GenerateContentBuilder func(GenerateContentContext) (GenerateContentResult, error)
type GenerateContentContext ¶
type GenerateContentResult ¶
type GenerateContentResult struct { ExtendConfig ExtendConfig BuildDockerfile io.Reader RunDockerfile io.Reader GenerateResult libcnb.GenerateResult }
type JDK ¶
type JDK struct { CertificateLoader CertificateLoader LayerContributor libpak.DependencyLayerContributor }
func NewJDK ¶
func NewJDK(dependency libpak.BuildModuleDependency, cache libpak.DependencyCache, certificateLoader CertificateLoader) (JDK, error)
func (JDK) Contribute ¶
type JKSKeystore ¶
type JKSKeystore struct {
// contains filtered or unexported fields
}
func NewJKSKeystore ¶
func NewJKSKeystore(location, password string) (*JKSKeystore, error)
func (*JKSKeystore) Len ¶
func (k *JKSKeystore) Len() int
func (*JKSKeystore) Write ¶
func (k *JKSKeystore) Write() error
type JLink ¶
type JLink struct { LayerContributor libpak.LayerContributor Logger log.Logger ApplicationPath string Executor effect.Executor CertificateLoader CertificateLoader Metadata map[string]interface{} JavaVersion string Args []string UserConfigured bool }
func (JLink) Contribute ¶
type JRE ¶
type JRE struct { ApplicationPath string CertificateLoader CertificateLoader DistributionType DistributionType LayerContributor libpak.DependencyLayerContributor Logger log.Logger Metadata map[string]interface{} }
func NewJRE ¶
func NewJRE(applicationPath string, dependency libpak.BuildModuleDependency, cache libpak.DependencyCache, distributionType DistributionType, certificateLoader CertificateLoader, metadata map[string]interface{}) (JRE, error)
func (JRE) Contribute ¶
type JVMVersion ¶
func NewJVMVersion ¶
func NewJVMVersion(logger log.Logger) JVMVersion
func (JVMVersion) GetJVMVersion ¶
func (j JVMVersion) GetJVMVersion(appPath string, cr libpak.ConfigurationResolver) (string, error)
type JavaSecurityProperties ¶
type JavaSecurityProperties struct {
LayerContributor libpak.LayerContributor
}
func NewJavaSecurityProperties ¶
func NewJavaSecurityProperties(info libcnb.BuildpackInfo, logger log.Logger) JavaSecurityProperties
func (JavaSecurityProperties) Contribute ¶
func (j JavaSecurityProperties) Contribute(layer *libcnb.Layer) error
func (JavaSecurityProperties) Name ¶
func (j JavaSecurityProperties) Name() string
type Keystore ¶
func DetectKeystore ¶
type MavenJAR ¶
type MavenJAR struct { // Name is the name of the JAR, without the version or extension. Name string `toml:"name"` // Version is the version of the JAR, without the name or extension. Version string `toml:"version"` // SHA256 is the SHA256 hash of the JAR. SHA256 string `toml:"sha256"` }
MavenJAR is metadata about a JRE entry that follows Maven naming conventions.
func NewMavenJARListing ¶
NewMavenJARListing generates a listing of all JAR that follow Maven naming convention under the roots.
type NIK ¶
type NIK struct { CertificateLoader CertificateLoader DependencyCache libpak.DependencyCache Executor effect.Executor JDKDependency libpak.BuildModuleDependency LayerContributor libpak.LayerContributor Logger log.Logger NativeDependency *libpak.BuildModuleDependency CustomCommand string CustomArgs []string }
func NewNIK ¶
func NewNIK(jdkDependency libpak.BuildModuleDependency, nativeDependency *libpak.BuildModuleDependency, cache libpak.DependencyCache, certificateLoader CertificateLoader, customCommand string, customArgs []string) (NIK, error)
func (NIK) Contribute ¶
type NativeImage ¶
type PasswordLessPKCS12Keystore ¶
type PasswordLessPKCS12Keystore struct {
// contains filtered or unexported fields
}
func NewPasswordLessPKCS12Keystore ¶
func NewPasswordLessPKCS12Keystore(location string) *PasswordLessPKCS12Keystore
func (*PasswordLessPKCS12Keystore) Add ¶
func (k *PasswordLessPKCS12Keystore) Add(name string, b *pem.Block) error
func (*PasswordLessPKCS12Keystore) Len ¶
func (k *PasswordLessPKCS12Keystore) Len() int
func (*PasswordLessPKCS12Keystore) Write ¶
func (k *PasswordLessPKCS12Keystore) Write() error
type SDKInfo ¶
SDKInfo represents the information from each line in the `.sdkmanrc` file
func ReadSDKMANRC ¶
ReadSDKMANRC reads the `.sdkmanrc` format file from path and retuns the list of SDKS in it
Source Files ¶
Click to show internal directories.
Click to hide internal directories.