boot

package
v5.28.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

* Copyright 2018-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	LabelSpringBootVersion             = "org.springframework.boot.version"
	LabelImageTitle                    = "org.opencontainers.image.title"
	LabelImageVersion                  = "org.opencontainers.image.version"
	LabelBootConfigurationMetadata     = "org.springframework.boot.spring-configuration-metadata.json"
	LabelDataFlowConfigurationMetadata = "org.springframework.cloud.dataflow.spring-configuration-metadata.json"
	SpringCloudBindingsBoot2           = "1"
	SpringCloudBindingsBoot3           = "2"
)
View Source
const (
	PlanEntrySpringBoot       = "spring-boot"
	PlanEntryJVMApplication   = "jvm-application"
	PlanEntryNativeProcessed  = "native-processed"
	MavenConfigActiveProfiles = "BP_MAVEN_ACTIVE_PROFILES"
)
View Source
const (
	WebMVCIndicatorClass                            = "org.springframework.web.servlet.DispatcherServlet"
	WebFluxIndicatorClass                           = "org.springframework.web.reactive.DispatcherHandler"
	JerseyIndicatorClass                            = "org.glassfish.jersey.servlet.ServletContainer"
	ConfigurableWebApplicationContextIndicatorClass = "org.springframework.web.context.ConfigurableWebApplicationContext"
	JakartaServlet                                  = "jakarta.servlet.Servlet"
	JavaxServlet                                    = "javax.servlet.Servlet"
)
View Source
const DatePattern = "2006-01-02"

Variables

View Source
var (
	MaxDate           = time.Unix(1<<63-62135596801, 999999999)
	Warningf          = color.New(color.FgYellow, color.Bold, color.Faint).SprintfFunc()
	NormalizedVersion = regexp.MustCompile(`[\d]+(?:\.[\d]+(?:\.[\d]+)?)?`)
)
View Source
var ServletIndicatorClasses = []string{
	JavaxServlet,
	JakartaServlet,
}

Functions

func DataFlowConfigurationExists

func DataFlowConfigurationExists(path string) (bool, error)

func FindExistingDependency added in v5.23.0

func FindExistingDependency(jars []libjvm.MavenJAR, dependencyName string) bool

Types

type ApplicationType

type ApplicationType uint8
const (
	None ApplicationType = iota
	Reactive
	Servlet
)

type Build

type Build struct {
	Logger bard.Logger
}

func (Build) Build

func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error)

type ConfigurationMetadata

type ConfigurationMetadata struct {
	Groups     []Group    `json:"groups,omitempty"`
	Properties []Property `json:"properties,omitempty"`
	Hints      []Hint     `json:"hints,omitempty"`
}

func NewConfigurationMetadataFromJAR

func NewConfigurationMetadataFromJAR(jar string) (ConfigurationMetadata, error)

func NewConfigurationMetadataFromPath

func NewConfigurationMetadataFromPath(path string) (ConfigurationMetadata, error)

func NewDataFlowConfigurationMetadata

func NewDataFlowConfigurationMetadata(path string, metadata ConfigurationMetadata) (ConfigurationMetadata, error)

type Deprecation

type Deprecation struct {
	Level       string `json:"level,omitempty"`
	Reason      string `json:"reason,omitempty"`
	Replacement string `json:"replacement,omitempty"`
}

type Detect

type Detect struct {
	Logger bard.Logger
}

func (Detect) Detect

func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error)

type Generation

type Generation struct {
	Name       *semver.Constraints `toml:"name"`
	OSS        time.Time           `toml:"oss"`
	Commercial time.Time           `toml:"commercial"`
}

func (*Generation) UnmarshalTOML

func (g *Generation) UnmarshalTOML(data interface{}) error

type GenerationValidator

type GenerationValidator struct {
	Logger   bard.Logger
	Projects []Project
}

func NewGenerationValidator

func NewGenerationValidator(path string) (GenerationValidator, error)

func (GenerationValidator) Validate

func (v GenerationValidator) Validate(slug string, version string) error

type Group

type Group struct {
	Name         string `json:"name"`
	Type         string `json:"type,omitempty"`
	Description  string `json:"description,omitempty"`
	SourceType   string `json:"sourceType,omitempty"`
	SourceMethod string `json:"sourceMethod,omitempty"`
}

type Hint

type Hint struct {
	Name      string          `json:"name"`
	Values    []ValueHint     `json:"values,omitempty"`
	Providers []ValueProvider `json:"providers,omitempty"`
}

type NativeImageClasspath

type NativeImageClasspath struct {
	Logger          bard.Logger
	ApplicationPath string
	Manifest        *properties.Properties
}

func NewNativeImageClasspath

func NewNativeImageClasspath(appDir string, manifest *properties.Properties) (NativeImageClasspath, error)

func (NativeImageClasspath) Contribute

func (n NativeImageClasspath) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

Contribute appends application classes and entries from classpath.idx to the build time classpath.

In a JVM application the Spring Boot Loader would make these modifications to the classpath when the executable JAR or WAR is launched. To set the classpath properly for a native-image build the buildpack must replicate this behavior.

func (NativeImageClasspath) Name

type Project

type Project struct {
	Name        string       `toml:"name"`
	Slug        string       `toml:"slug"`
	Status      string       `toml:"status"`
	Generations []Generation `toml:"generations"`
}

type Projects

type Projects struct {
	Projects []Project `toml:"projects"`
}

type Property

type Property struct {
	Name         string       `json:"name"`
	Type         string       `json:"type,omitempty"`
	Description  string       `json:"description,omitempty"`
	SourceType   string       `json:"sourceType,omitempty"`
	DefaultValue interface{}  `json:"defaultValue,omitempty"`
	Deprecation  *Deprecation `json:"deprecation,omitempty"`
}

type SpringCloudBindings

type SpringCloudBindings struct {
	Dependency       libpak.BuildpackDependency
	LayerContributor libpak.DependencyLayerContributor
	Logger           bard.Logger
	SpringBootLib    string
}

func NewSpringCloudBindings

func NewSpringCloudBindings(springBootLib string, dependency libpak.BuildpackDependency, cache libpak.DependencyCache) (SpringCloudBindings, libcnb.BOMEntry)

func (SpringCloudBindings) Contribute

func (s SpringCloudBindings) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (SpringCloudBindings) Name

func (s SpringCloudBindings) Name() string

type ValueHint

type ValueHint struct {
	Value       interface{} `json:"value"`
	Description string      `json:"description,omitempty"`
}

type ValueProvider

type ValueProvider struct {
	Name       string                 `json:"name"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type WebApplicationType

type WebApplicationType struct {
	LayerContributor libpak.LayerContributor
	Logger           bard.Logger
	Resolver         WebApplicationTypeResolver
}

func NewWebApplicationType

func NewWebApplicationType(applicationPath string, resolver WebApplicationTypeResolver) (WebApplicationType, error)

func (WebApplicationType) Contribute

func (w WebApplicationType) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (WebApplicationType) Name

func (WebApplicationType) Name() string

type WebApplicationTypeResolver

type WebApplicationTypeResolver struct {
	Classes map[string]interface{}
}

func NewWebApplicationResolver

func NewWebApplicationResolver(classes string, lib string) (WebApplicationTypeResolver, error)

func (WebApplicationTypeResolver) Resolve

Jump to

Keyboard shortcuts

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