mock

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Platform

type Platform struct {
	mock.Mock

	// a mock only field signifying whether, during the CreateFunction call, the CreationStateUpdated channel
	// should be populated. This is used to mock failures before/after the update on the production types
	CreateFunctionCreationStateUpdated bool
}

Platform defines the interface that any underlying function platform must provide for nuclio to run over it

func (*Platform) AutoFixConfiguration

func (mp *Platform) AutoFixConfiguration(ctx context.Context, err error, functionConfig *functionconfig.Config) bool

func (*Platform) BuildAndPushContainerImage

func (mp *Platform) BuildAndPushContainerImage(ctx context.Context, buildOptions *containerimagebuilderpusher.BuildOptions) error

func (*Platform) CreateAPIGateway

func (mp *Platform) CreateAPIGateway(ctx context.Context, createAPIGatewayOptions *platform.CreateAPIGatewayOptions) error

CreateAPIGateway creates and deploys a new api gateway

func (*Platform) CreateFunction

func (mp *Platform) CreateFunction(ctx context.Context, createFunctionOptions *platform.CreateFunctionOptions) (*platform.CreateFunctionResult, error)

CreateFunction will deploy a processor image to the platform (optionally building it, if source is provided)

func (*Platform) CreateFunctionBuild

func (mp *Platform) CreateFunctionBuild(ctx context.Context,
	createFunctionBuildOptions *platform.CreateFunctionBuildOptions) (*platform.CreateFunctionBuildResult, error)

CreateFunctionBuild will locally build a processor image and return its name (or the error)

func (*Platform) CreateFunctionEvent

func (mp *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 (mp *Platform) CreateFunctionInvocation(ctx context.Context, createFunctionInvocationOptions *platform.CreateFunctionInvocationOptions) (*platform.CreateFunctionInvocationResult, error)

CreateFunctionInvocation will invoke a previously deployed function

func (*Platform) CreateProject

func (mp *Platform) CreateProject(ctx context.Context, createProjectOptions *platform.CreateProjectOptions) error

CreateProject will probably create a new project

func (*Platform) DeleteAPIGateway

func (mp *Platform) DeleteAPIGateway(ctx context.Context, deleteAPIGatewayOptions *platform.DeleteAPIGatewayOptions) error

DeleteAPIGateway will delete a previously deployed api gateway

func (*Platform) DeleteFunction

func (mp *Platform) DeleteFunction(ctx context.Context, deleteFunctionOptions *platform.DeleteFunctionOptions) error

DeleteFunction will delete a previously deployed function

func (*Platform) DeleteFunctionEvent

func (mp *Platform) DeleteFunctionEvent(ctx context.Context, deleteFunctionEventOptions *platform.DeleteFunctionEventOptions) error

DeleteFunctionEvent will delete a previously existing function event

func (*Platform) DeleteProject

func (mp *Platform) DeleteProject(ctx context.Context, deleteProjectOptions *platform.DeleteProjectOptions) error

DeleteProject will delete a previously existing project

func (*Platform) EnrichFunctionConfig

func (mp *Platform) EnrichFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error

func (*Platform) EnsureDefaultProjectExistence

func (mp *Platform) EnsureDefaultProjectExistence(ctx context.Context) error

func (*Platform) FilterFunctionEventsByPermissions

func (mp *Platform) FilterFunctionEventsByPermissions(ctx context.Context,
	permissionOptions *opa.PermissionOptions,
	functionEvents []platform.FunctionEvent) ([]platform.FunctionEvent, error)

func (*Platform) FilterFunctionsByPermissions

func (mp *Platform) FilterFunctionsByPermissions(ctx context.Context,
	permissionOptions *opa.PermissionOptions,
	functions []platform.Function) ([]platform.Function, error)

func (*Platform) GetAPIGatewayScrubber

func (mp *Platform) GetAPIGatewayScrubber() *platform.APIGatewayScrubber

func (*Platform) GetAPIGateways

func (mp *Platform) GetAPIGateways(ctx context.Context, getAPIGatewaysOptions *platform.GetAPIGatewaysOptions) ([]platform.APIGateway, error)

GetAPIGateways will list existing api gateways

func (*Platform) GetAllowedAuthenticationModes

func (mp *Platform) GetAllowedAuthenticationModes() []string

func (*Platform) GetBaseImageRegistry

func (mp *Platform) GetBaseImageRegistry(registry string, runtime runtime.Runtime) (string, error)

func (*Platform) GetConfig

func (mp *Platform) GetConfig() *platformconfig.Config

func (*Platform) GetContainerBuilderKind

func (mp *Platform) GetContainerBuilderKind() string

func (*Platform) GetDefaultInvokeIPAddresses

func (mp *Platform) GetDefaultInvokeIPAddresses() ([]string, error)

func (*Platform) GetDefaultRegistryCredentialsSecretName

func (mp *Platform) GetDefaultRegistryCredentialsSecretName() string

func (*Platform) GetDisableDefaultHttpTrigger

func (mp *Platform) GetDisableDefaultHttpTrigger() bool

func (*Platform) GetExternalIPAddresses

func (mp *Platform) GetExternalIPAddresses() ([]string, error)

GetExternalIPAddresses returns the external IP addresses invocations will use.

func (*Platform) GetFunctionEvents

func (mp *Platform) GetFunctionEvents(ctx context.Context, getFunctionEventsOptions *platform.GetFunctionEventsOptions) ([]platform.FunctionEvent, error)

GetFunctionEvents will list existing function events

func (*Platform) GetFunctionProject

func (mp *Platform) GetFunctionProject(ctx context.Context, functionConfig *functionconfig.Config) (platform.Project, error)

GetFunctionProject returns project instance for specific function

func (*Platform) GetFunctionReplicaContainers

func (mp *Platform) GetFunctionReplicaContainers(ctx context.Context, functionConfig *functionconfig.Config, replicaName string) ([]string, error)

func (*Platform) GetFunctionReplicaLogsStream

func (mp *Platform) GetFunctionReplicaLogsStream(ctx context.Context, options *platform.GetFunctionReplicaLogsStreamOptions) (io.ReadCloser, error)

GetFunctionReplicaLogsStream return the function instance (Kubernetes - Pod / Docker - Container) logs stream

func (*Platform) GetFunctionReplicaNames

func (mp *Platform) GetFunctionReplicaNames(ctx context.Context, function platform.Function, permissionOptions opa.PermissionOptions) ([]string, error)

GetFunctionReplicaNames returns function replica names (Pod / Container names)

func (*Platform) GetFunctionScrubber

func (mp *Platform) GetFunctionScrubber() *functionconfig.Scrubber

func (*Platform) GetFunctions

func (mp *Platform) GetFunctions(ctx context.Context, getFunctionsOptions *platform.GetFunctionsOptions) ([]platform.Function, error)

GetFunctions will list existing functions

func (*Platform) GetHealthCheckMode

func (mp *Platform) GetHealthCheckMode() platform.HealthCheckMode

GetHealthCheckMode returns the healthcheck mode the platform requires

func (*Platform) GetImageNamePrefixTemplate

func (mp *Platform) GetImageNamePrefixTemplate() string

func (*Platform) GetName

func (mp *Platform) GetName() string

GetName returns the platform name

func (*Platform) GetNamespaces

func (mp *Platform) GetNamespaces(ctx context.Context) ([]string, error)

GetNamespaces returns the namespaces

func (*Platform) GetOnbuildImageRegistry

func (mp *Platform) GetOnbuildImageRegistry(registry string, runtime runtime.Runtime) (string, error)

func (*Platform) GetOnbuildStages

func (mp *Platform) GetOnbuildStages(onbuildArtifacts []runtime.Artifact) ([]string, error)

func (*Platform) GetProcessorLogsAndBriefError

func (mp *Platform) GetProcessorLogsAndBriefError(scanner *bufio.Scanner) (string, string)

func (*Platform) GetProjects

func (mp *Platform) GetProjects(ctx context.Context, getProjectsOptions *platform.GetProjectsOptions) ([]platform.Project, error)

GetProjects will list existing projects

func (*Platform) GetRegistryKind

func (mp *Platform) GetRegistryKind() string

func (*Platform) GetRuntimeBuildArgs

func (mp *Platform) GetRuntimeBuildArgs(runtime runtime.Runtime) map[string]string

func (*Platform) GetScaleToZeroConfiguration

func (mp *Platform) GetScaleToZeroConfiguration() *platformconfig.ScaleToZero

func (*Platform) Initialize

func (mp *Platform) Initialize(ctx context.Context) error

func (*Platform) InitializeContainerBuilder

func (mp *Platform) InitializeContainerBuilder() error

func (*Platform) QueryOPAFunctionEventPermissions

func (mp *Platform) QueryOPAFunctionEventPermissions(projectName,
	functionName,
	functionEventName string,
	action opa.Action,
	permissionOptions *opa.PermissionOptions) (bool, error)

func (*Platform) QueryOPAFunctionPermissions

func (mp *Platform) QueryOPAFunctionPermissions(projectName,
	functionName string,
	action opa.Action,
	permissionOptions *opa.PermissionOptions) (bool, error)

func (*Platform) RedeployFunction

func (mp *Platform) RedeployFunction(ctx context.Context, redeployFunctionOptions *platform.RedeployFunctionOptions) error

func (*Platform) RenderImageNamePrefixTemplate

func (mp *Platform) RenderImageNamePrefixTemplate(projectName string, functionName string) (string, error)

func (*Platform) SaveFunctionDeployLogs

func (mp *Platform) SaveFunctionDeployLogs(ctx context.Context, functionName, namespace string) error

func (*Platform) SetExternalIPAddresses

func (mp *Platform) SetExternalIPAddresses(externalIPAddresses []string) error

SetExternalIPAddresses configures the IP addresses invocations will use.

func (*Platform) SetImageNamePrefixTemplate

func (mp *Platform) SetImageNamePrefixTemplate(imageNamePrefixTemplate string)

func (*Platform) TransformOnbuildArtifactPaths

func (mp *Platform) TransformOnbuildArtifactPaths(onbuildArtifacts []runtime.Artifact) (map[string]string, error)

func (*Platform) UpdateAPIGateway

func (mp *Platform) UpdateAPIGateway(ctx context.Context, updateAPIGatewayOptions *platform.UpdateAPIGatewayOptions) error

UpdateAPIGateway will update a previously deployed api gateway

func (*Platform) UpdateFunction

func (mp *Platform) UpdateFunction(ctx context.Context, updateFunctionOptions *platform.UpdateFunctionOptions) error

UpdateFunction will update a previously deployed function

func (*Platform) UpdateFunctionEvent

func (mp *Platform) UpdateFunctionEvent(ctx context.Context, updateFunctionEventOptions *platform.UpdateFunctionEventOptions) error

UpdateFunctionEvent will update a previously existing function event

func (*Platform) UpdateProject

func (mp *Platform) UpdateProject(ctx context.Context, updateProjectOptions *platform.UpdateProjectOptions) error

UpdateProject will update a previously existing project

func (*Platform) ValidateFunctionConfig

func (mp *Platform) ValidateFunctionConfig(ctx context.Context, functionConfig *functionconfig.Config) error

func (*Platform) WaitForProjectResourcesDeletion

func (mp *Platform) WaitForProjectResourcesDeletion(ctx context.Context, projectMeta *platform.ProjectMeta, duration time.Duration) error

Jump to

Keyboard shortcuts

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