Documentation
¶
Index ¶
- func GetEnvPort(envPlaceholder string) int
- func GetEnvPortFromDockerfile(envPlaceholder string, path string) int
- type AngularCliJson
- type AngularDetector
- type AngularJson
- type ExpressDetector
- type HostPort
- type NextDetector
- type NuxtDetector
- type ProjectBody
- type ReactJsDetector
- type SvelteDetector
- type VueDetector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvPort ¶
func GetEnvPortFromDockerfile ¶ added in v1.1.5
GetEnvPortFromDockerfile returns a port value from the Dockerfile (locations provided by the 'utils.GetLocations' function) matching the specified 'envPlaceHolder'. It first extracts the environment variable name to lookup from 'envPlaceholder' by removing any 'process.env.' prefix. It then searches through all environment variables detected from the Dockerfile (as determined by 'utils.GetEnvVarsFromDockerFile'). And if the environment variable specified via 'envPlaceholder' is found in the Dockerfile environment variables and its corresponding value is a valid port (as determined by 'utils.GetValidPort'), it returns this valid port value.
If there is an error reading the Dockerfile or if the environment variable specified via 'envPlaceholder' is not found among the Dockerfile environment variables, the function returns -1.
Types ¶
type AngularCliJson ¶
type AngularCliJson struct { Defaults struct { Serve HostPort `json:"serve"` } `json:"defaults"` }
type AngularDetector ¶
type AngularDetector struct{}
func (AngularDetector) DoFrameworkDetection ¶
func (a AngularDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (AngularDetector) DoPortsDetection ¶
func (a AngularDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in angular.json, package.json, and angular-cli.json
func (AngularDetector) GetSupportedFrameworks ¶
func (a AngularDetector) GetSupportedFrameworks() []string
type AngularJson ¶
type AngularJson struct {
Projects map[string]ProjectBody `json:"projects"`
}
type ExpressDetector ¶
type ExpressDetector struct{}
func (ExpressDetector) DoFrameworkDetection ¶
func (e ExpressDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (ExpressDetector) DoPortsDetection ¶
func (e ExpressDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
func (ExpressDetector) GetSupportedFrameworks ¶
func (e ExpressDetector) GetSupportedFrameworks() []string
type NextDetector ¶
type NextDetector struct{}
func (NextDetector) DoFrameworkDetection ¶
func (n NextDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (NextDetector) DoPortsDetection ¶
func (n NextDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in package.json
func (NextDetector) GetSupportedFrameworks ¶
func (n NextDetector) GetSupportedFrameworks() []string
type NuxtDetector ¶
type NuxtDetector struct{}
func (NuxtDetector) DoFrameworkDetection ¶
func (n NuxtDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (NuxtDetector) DoPortsDetection ¶
func (n NuxtDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in package.json, and nuxt.config.js
func (NuxtDetector) GetSupportedFrameworks ¶
func (n NuxtDetector) GetSupportedFrameworks() []string
type ProjectBody ¶
type ProjectBody struct { Architect struct { Serve struct { Options HostPort `json:"options"` } `json:"serve"` } `json:"architect"` }
type ReactJsDetector ¶
type ReactJsDetector struct{}
func (ReactJsDetector) DoFrameworkDetection ¶
func (r ReactJsDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (ReactJsDetector) DoPortsDetection ¶
func (r ReactJsDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in the env var, .env file, and package.json
func (ReactJsDetector) GetSupportedFrameworks ¶
func (r ReactJsDetector) GetSupportedFrameworks() []string
type SvelteDetector ¶
type SvelteDetector struct{}
func (SvelteDetector) DoFrameworkDetection ¶
func (s SvelteDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (SvelteDetector) DoPortsDetection ¶
func (s SvelteDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in package.json
func (SvelteDetector) GetSupportedFrameworks ¶
func (s SvelteDetector) GetSupportedFrameworks() []string
type VueDetector ¶
type VueDetector struct{}
func (VueDetector) DoFrameworkDetection ¶
func (v VueDetector) DoFrameworkDetection(language *model.Language, config string)
DoFrameworkDetection uses a tag to check for the framework name
func (VueDetector) DoPortsDetection ¶
func (v VueDetector) DoPortsDetection(component *model.Component, ctx *context.Context)
DoPortsDetection searches for the port in package.json, .env file, and vue.config.js
func (VueDetector) GetSupportedFrameworks ¶
func (v VueDetector) GetSupportedFrameworks() []string