Documentation ¶
Index ¶
- Constants
- type LogStream
- type Platform
- func (ap *Platform) AutoFixConfiguration(ctx context.Context, err error, functionConfig *functionconfig.Config) bool
- func (ap *Platform) BuildAndPushContainerImage(ctx context.Context, buildOptions *containerimagebuilderpusher.BuildOptions) error
- func (ap *Platform) CreateAPIGateway(ctx context.Context, createAPIGatewayOptions *platform.CreateAPIGatewayOptions) error
- func (ap *Platform) CreateFunctionBuild(ctx context.Context, ...) (*platform.CreateFunctionBuildResult, error)
- func (ap *Platform) CreateFunctionEvent(ctx context.Context, ...) error
- func (ap *Platform) CreateFunctionInvocation(ctx context.Context, ...) (*platform.CreateFunctionInvocationResult, error)
- func (ap *Platform) CreateProject(ctx context.Context, createProjectOptions *platform.CreateProjectOptions) error
- func (ap *Platform) DeleteAPIGateway(ctx context.Context, deleteAPIGatewayOptions *platform.DeleteAPIGatewayOptions) error
- func (ap *Platform) DeleteFunctionEvent(ctx context.Context, ...) error
- func (ap *Platform) DeleteProject(ctx context.Context, deleteProjectOptions *platform.DeleteProjectOptions) error
- func (ap *Platform) EnrichCreateProjectConfig(createProjectOptions *platform.CreateProjectOptions) error
- func (ap *Platform) EnrichFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error
- func (ap *Platform) EnrichFunctionEvent(ctx context.Context, functionEventConfig *platform.FunctionEventConfig) error
- func (ap *Platform) EnrichFunctionsWithDeployLogStream(functions []platform.Function)
- func (ap *Platform) EnrichLabels(ctx context.Context, labels map[string]string)
- func (ap *Platform) EnsureDefaultProjectExistence(ctx context.Context) error
- func (ap *Platform) EnsureProjectRead(projectName string, permissionOptions *opa.PermissionOptions) error
- func (ap *Platform) FilterFunctionEventsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, ...) ([]platform.FunctionEvent, error)
- func (ap *Platform) FilterFunctionsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, ...) ([]platform.Function, error)
- func (ap *Platform) FilterProjectsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, ...) ([]platform.Project, error)
- func (ap *Platform) GetAPIGateways(ctx context.Context, getAPIGatewaysOptions *platform.GetAPIGatewaysOptions) ([]platform.APIGateway, error)
- func (ap *Platform) GetAllowedAuthenticationModes() []string
- func (ap *Platform) GetBaseImageRegistry(registry string, runtime runtime.Runtime) (string, error)
- func (ap *Platform) GetConfig() *platformconfig.Config
- func (ap *Platform) GetContainerBuilderKind() string
- func (ap *Platform) GetDefaultRegistryCredentialsSecretName() string
- func (ap *Platform) GetDisableDefaultHttpTrigger() bool
- func (ap *Platform) GetExternalIPAddresses() ([]string, error)
- func (ap *Platform) GetFunctionEvents(ctx context.Context, ...) ([]platform.FunctionEvent, error)
- func (ap *Platform) GetFunctionProject(ctx context.Context, functionConfig *functionconfig.Config) (platform.Project, error)
- func (ap *Platform) GetHealthCheckMode() platform.HealthCheckMode
- func (ap *Platform) GetImageNamePrefixTemplate() string
- func (ap *Platform) GetOnbuildImageRegistry(registry string, runtime runtime.Runtime) (string, error)
- func (ap *Platform) GetOnbuildStages(onbuildArtifacts []runtime.Artifact) ([]string, error)
- func (ap *Platform) GetProcessorLogsAndBriefError(scanner *bufio.Scanner) (string, string)
- func (ap *Platform) GetProjectResources(ctx context.Context, projectMeta *platform.ProjectMeta) ([]platform.Function, []platform.APIGateway, error)
- func (ap *Platform) GetProjects(ctx context.Context, getProjectsOptions *platform.GetProjectsOptions) ([]platform.Project, error)
- func (ap *Platform) GetRegistryKind() string
- func (ap *Platform) GetRuntimeBuildArgs(runtime runtime.Runtime) map[string]string
- func (ap *Platform) GetScaleToZeroConfiguration() *platformconfig.ScaleToZero
- func (ap *Platform) HandleDeployFunction(ctx context.Context, existingFunctionConfig *functionconfig.ConfigWithStatus, ...) (*platform.CreateFunctionResult, error)
- func (ap *Platform) QueryOPAFunctionEventPermissions(projectName, functionName, functionEventName string, action opa.Action, ...) (bool, error)
- func (ap *Platform) QueryOPAFunctionPermissions(projectName, functionName string, action opa.Action, ...) (bool, error)
- func (ap *Platform) QueryOPAFunctionRedeployPermissions(projectName, functionName string, permissionOptions *opa.PermissionOptions) (bool, error)
- func (ap *Platform) QueryOPAMultipleResources(ctx context.Context, resources []string, action opa.Action, ...) ([]bool, error)
- func (ap *Platform) QueryOPAProjectPermissions(projectName string, action opa.Action, ...) (bool, error)
- func (ap *Platform) RenderImageNamePrefixTemplate(projectName string, functionName string) (string, error)
- func (ap *Platform) ResolveProjectNameFromLabelsStr(encodedLabels string) (string, error)
- func (ap *Platform) ResolveReservedResourceNames() []string
- func (ap *Platform) SetExternalIPAddresses(externalIPAddresses []string) error
- func (ap *Platform) SetImageNamePrefixTemplate(imageNamePrefixTemplate string)
- func (ap *Platform) TransformOnbuildArtifactPaths(onbuildArtifacts []runtime.Artifact) (map[string]string, error)
- func (ap *Platform) UpdateAPIGateway(ctx context.Context, updateAPIGatewayOptions *platform.UpdateAPIGatewayOptions) error
- func (ap *Platform) UpdateFunctionEvent(ctx context.Context, ...) error
- func (ap *Platform) UpdateProject(ctx context.Context, updateProjectOptions *platform.UpdateProjectOptions) error
- func (ap *Platform) ValidateCreateFunctionOptionsAgainstExistingFunctionConfig(ctx context.Context, existingFunctionConfig *functionconfig.ConfigWithStatus, ...) error
- func (ap *Platform) ValidateDeleteFunctionOptions(ctx context.Context, deleteFunctionOptions *platform.DeleteFunctionOptions) (platform.Function, error)
- func (ap *Platform) ValidateDeleteProjectOptions(ctx context.Context, deleteProjectOptions *platform.DeleteProjectOptions) error
- func (ap *Platform) ValidateFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error
- func (ap *Platform) ValidateFunctionConfigWithRetry(ctx context.Context, functionConfig *functionconfig.Config, autofix bool) error
- func (ap *Platform) ValidateProjectConfig(projectConfig *platform.ProjectConfig) error
- func (ap *Platform) ValidateResourceVersion(ctx context.Context, functionConfigWithStatus *functionconfig.ConfigWithStatus, ...) error
- func (ap *Platform) WaitForProjectResourcesDeletion(ctx context.Context, projectMeta *platform.ProjectMeta, duration time.Duration) error
Constants ¶
const ( FunctionContainerHTTPPort = 8080 FunctionContainerWebAdminHTTPPort = 8081 FunctionContainerHealthCheckHTTPPort = 8082 DefaultTargetCPU = 75 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogStream ¶
type LogStream struct {
// contains filtered or unexported fields
}
func NewLogStream ¶
NewLogStream returns a new log stream
func (*LogStream) GetRedactor ¶
func (ls *LogStream) GetRedactor() *nucliozap.Redactor
type Platform ¶
type Platform struct { Logger logger.Logger Config *platformconfig.Config ExternalIPAddresses []string DeployLogStreams *sync.Map ContainerBuilder containerimagebuilderpusher.BuilderPusher ImageNamePrefixTemplate string DefaultNamespace string OpaClient opa.Client FunctionScrubber *functionconfig.Scrubber // contains filtered or unexported fields }
func NewPlatform ¶
func (*Platform) AutoFixConfiguration ¶
func (*Platform) BuildAndPushContainerImage ¶
func (ap *Platform) BuildAndPushContainerImage(ctx context.Context, buildOptions *containerimagebuilderpusher.BuildOptions) error
BuildAndPushContainerImage builds container image and pushes it into docker registry
func (*Platform) CreateAPIGateway ¶
func (ap *Platform) CreateAPIGateway(ctx context.Context, createAPIGatewayOptions *platform.CreateAPIGatewayOptions) error
CreateAPIGateway creates and deploys a new api gateway
func (*Platform) CreateFunctionBuild ¶
func (ap *Platform) CreateFunctionBuild(ctx context.Context, createFunctionBuildOptions *platform.CreateFunctionBuildOptions) ( *platform.CreateFunctionBuildResult, error)
func (*Platform) CreateFunctionEvent ¶
func (ap *Platform) CreateFunctionEvent(ctx context.Context, createFunctionEventOptions *platform.CreateFunctionEventOptions) error
CreateFunctionEvent will create a new function event that can later be used as a template from which to invoke functions
func (*Platform) CreateFunctionInvocation ¶
func (ap *Platform) CreateFunctionInvocation(ctx context.Context, createFunctionInvocationOptions *platform.CreateFunctionInvocationOptions) ( *platform.CreateFunctionInvocationResult, error)
CreateFunctionInvocation will invoke a previously deployed function
func (*Platform) CreateProject ¶
func (ap *Platform) CreateProject(ctx context.Context, createProjectOptions *platform.CreateProjectOptions) error
CreateProject will probably create a new project
func (*Platform) DeleteAPIGateway ¶
func (ap *Platform) DeleteAPIGateway(ctx context.Context, deleteAPIGatewayOptions *platform.DeleteAPIGatewayOptions) error
DeleteAPIGateway will delete a previously existing api gateway
func (*Platform) DeleteFunctionEvent ¶
func (ap *Platform) DeleteFunctionEvent(ctx context.Context, deleteFunctionEventOptions *platform.DeleteFunctionEventOptions) error
DeleteFunctionEvent will delete a previously existing function event
func (*Platform) DeleteProject ¶
func (ap *Platform) DeleteProject(ctx context.Context, deleteProjectOptions *platform.DeleteProjectOptions) error
DeleteProject will delete a previously existing project
func (*Platform) EnrichCreateProjectConfig ¶
func (ap *Platform) EnrichCreateProjectConfig(createProjectOptions *platform.CreateProjectOptions) error
EnrichCreateProjectConfig enrich project configuration with defaults
func (*Platform) EnrichFunctionConfig ¶
func (ap *Platform) EnrichFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error
EnrichFunctionConfig enriches function config
func (*Platform) EnrichFunctionEvent ¶
func (*Platform) EnrichFunctionsWithDeployLogStream ¶
EnrichFunctionsWithDeployLogStream enriches functions status with logs
func (*Platform) EnrichLabels ¶
EnrichLabels enriches labels with default project name
func (*Platform) EnsureDefaultProjectExistence ¶
func (*Platform) EnsureProjectRead ¶
func (ap *Platform) EnsureProjectRead(projectName string, permissionOptions *opa.PermissionOptions) error
func (*Platform) FilterFunctionEventsByPermissions ¶
func (ap *Platform) FilterFunctionEventsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, functionEvents []platform.FunctionEvent) ([]platform.FunctionEvent, error)
FilterFunctionEventsByPermissions will filter out some function events
func (*Platform) FilterFunctionsByPermissions ¶
func (ap *Platform) FilterFunctionsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, functions []platform.Function) ([]platform.Function, error)
FilterFunctionsByPermissions will filter out some functions
func (*Platform) FilterProjectsByPermissions ¶
func (ap *Platform) FilterProjectsByPermissions(ctx context.Context, permissionOptions *opa.PermissionOptions, projects []platform.Project) ([]platform.Project, error)
FilterProjectsByPermissions will filter out some projects
func (*Platform) GetAPIGateways ¶
func (ap *Platform) GetAPIGateways(ctx context.Context, getAPIGatewaysOptions *platform.GetAPIGatewaysOptions) ([]platform.APIGateway, error)
GetAPIGateways will list existing api gateways
func (*Platform) GetAllowedAuthenticationModes ¶
GetAllowedAuthenticationModes returns allowed authentication modes
func (*Platform) GetBaseImageRegistry ¶
GetBaseImageRegistry returns base image registry
func (*Platform) GetConfig ¶
func (ap *Platform) GetConfig() *platformconfig.Config
func (*Platform) GetContainerBuilderKind ¶
GetContainerBuilderKind returns the container-builder kind
func (*Platform) GetDefaultRegistryCredentialsSecretName ¶
GetDefaultRegistryCredentialsSecretName returns secret with credentials to push/pull from docker registry
func (*Platform) GetDisableDefaultHttpTrigger ¶
func (*Platform) GetExternalIPAddresses ¶
GetExternalIPAddresses returns the external IP addresses invocations will use. These addresses are either set through SetExternalIPAddresses or automatically discovered
func (*Platform) GetFunctionEvents ¶
func (ap *Platform) GetFunctionEvents(ctx context.Context, getFunctionEventsOptions *platform.GetFunctionEventsOptions) ([]platform.FunctionEvent, error)
GetFunctionEvents will list existing function events
func (*Platform) GetFunctionProject ¶
func (*Platform) GetHealthCheckMode ¶
func (ap *Platform) GetHealthCheckMode() platform.HealthCheckMode
GetHealthCheckMode returns the healthcheck mode the platform requires
func (*Platform) GetImageNamePrefixTemplate ¶
func (*Platform) GetOnbuildImageRegistry ¶
func (ap *Platform) GetOnbuildImageRegistry(registry string, runtime runtime.Runtime) (string, error)
GetOnbuildImageRegistry returns onbuild image registry
func (*Platform) GetOnbuildStages ¶
GetOnbuildStages get onbuild multistage builds
func (*Platform) GetProcessorLogsAndBriefError ¶
func (*Platform) GetProjectResources ¶
func (ap *Platform) GetProjectResources(ctx context.Context, projectMeta *platform.ProjectMeta) ([]platform.Function, []platform.APIGateway, error)
func (*Platform) GetProjects ¶
func (ap *Platform) GetProjects(ctx context.Context, getProjectsOptions *platform.GetProjectsOptions) ([]platform.Project, error)
GetProjects will list existing projects
func (*Platform) GetRegistryKind ¶
func (*Platform) GetRuntimeBuildArgs ¶
GetRuntimeBuildArgs returns the runtime specific build arguments
func (*Platform) GetScaleToZeroConfiguration ¶
func (ap *Platform) GetScaleToZeroConfiguration() *platformconfig.ScaleToZero
GetScaleToZeroConfiguration returns scale to zero configuration
func (*Platform) HandleDeployFunction ¶
func (ap *Platform) HandleDeployFunction(ctx context.Context, existingFunctionConfig *functionconfig.ConfigWithStatus, createFunctionOptions *platform.CreateFunctionOptions, onAfterConfigUpdated func() error, onAfterBuild func(*platform.CreateFunctionBuildResult, error) (*platform.CreateFunctionResult, error)) ( *platform.CreateFunctionResult, error)
HandleDeployFunction calls a deployer that does the platform specific deploy, but adds a lot of common code
func (*Platform) QueryOPAFunctionEventPermissions ¶
func (*Platform) QueryOPAFunctionPermissions ¶
func (*Platform) QueryOPAFunctionRedeployPermissions ¶
func (*Platform) QueryOPAMultipleResources ¶
func (*Platform) QueryOPAProjectPermissions ¶
func (*Platform) RenderImageNamePrefixTemplate ¶
func (*Platform) ResolveProjectNameFromLabelsStr ¶
ResolveProjectNameFromLabelsStr resolves first project name from label string
func (*Platform) ResolveReservedResourceNames ¶
ResolveReservedResourceNames returns a list of reserved resource names
func (*Platform) SetExternalIPAddresses ¶
SetExternalIPAddresses configures the IP addresses invocations will use. If this is not invoked, each platform will try to discover these addresses automatically
func (*Platform) SetImageNamePrefixTemplate ¶
func (*Platform) TransformOnbuildArtifactPaths ¶
func (ap *Platform) TransformOnbuildArtifactPaths(onbuildArtifacts []runtime.Artifact) (map[string]string, error)
TransformOnbuildArtifactPaths changes Onbuild artifact paths depending on the type of the builder used
func (*Platform) UpdateAPIGateway ¶
func (ap *Platform) UpdateAPIGateway(ctx context.Context, updateAPIGatewayOptions *platform.UpdateAPIGatewayOptions) error
UpdateAPIGateway will update a previously existing api gateway
func (*Platform) UpdateFunctionEvent ¶
func (ap *Platform) UpdateFunctionEvent(ctx context.Context, updateFunctionEventOptions *platform.UpdateFunctionEventOptions) error
UpdateFunctionEvent will update a previously existing function event
func (*Platform) UpdateProject ¶
func (ap *Platform) UpdateProject(ctx context.Context, updateProjectOptions *platform.UpdateProjectOptions) error
UpdateProject will update a previously existing project
func (*Platform) ValidateCreateFunctionOptionsAgainstExistingFunctionConfig ¶
func (ap *Platform) ValidateCreateFunctionOptionsAgainstExistingFunctionConfig(ctx context.Context, existingFunctionConfig *functionconfig.ConfigWithStatus, createFunctionOptions *platform.CreateFunctionOptions) error
ValidateCreateFunctionOptionsAgainstExistingFunctionConfig validates a function against its existing instance
func (*Platform) ValidateDeleteFunctionOptions ¶
func (ap *Platform) ValidateDeleteFunctionOptions(ctx context.Context, deleteFunctionOptions *platform.DeleteFunctionOptions) ( platform.Function, error)
ValidateDeleteFunctionOptions validates and enforces of required function deletion logic
func (*Platform) ValidateDeleteProjectOptions ¶
func (ap *Platform) ValidateDeleteProjectOptions(ctx context.Context, deleteProjectOptions *platform.DeleteProjectOptions) error
ValidateDeleteProjectOptions validates and enforces of required project deletion logic
func (*Platform) ValidateFunctionConfig ¶
func (ap *Platform) ValidateFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error
ValidateFunctionConfig validates and enforces of required function creation logic
func (*Platform) ValidateFunctionConfigWithRetry ¶
func (*Platform) ValidateProjectConfig ¶
func (ap *Platform) ValidateProjectConfig(projectConfig *platform.ProjectConfig) error
ValidateProjectConfig perform validation on a given project config
func (*Platform) ValidateResourceVersion ¶
func (ap *Platform) ValidateResourceVersion(ctx context.Context, functionConfigWithStatus *functionconfig.ConfigWithStatus, requestFunctionConfig *functionconfig.Config) error
ValidateResourceVersion validates existing and new create function options resource version