fake

package
v4.0.0-...-3ebc7ba Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToEngine

func ConnectToEngine(t testing.TB, addr string) *grpc.ClientConn

func StartEngineServer

func StartEngineServer(t testing.TB, engine pulumirpc.EngineServer) (addr string)

func StartMonitorServer

func StartMonitorServer(t testing.TB, monitor pulumirpc.ResourceMonitorServer) (addr string)

Types

type EngineServer

type EngineServer struct {
	pulumirpc.UnsafeEngineServer
	// contains filtered or unexported fields
}

A fake engine server for test purposes.

func NewEngineServer

func NewEngineServer(t testing.TB) *EngineServer

func (*EngineServer) GetRootResource

GetRootResource gets the URN of the root resource, the resource that should be the root of all otherwise-unparented resources.

func (*EngineServer) Log

Log logs a global message in the engine, including errors and warnings.

func (*EngineServer) Logs

func (m *EngineServer) Logs() []*pulumirpc.LogRequest

func (*EngineServer) SetRootResource

SetRootResource sets the URN of the root resource.

type HostClient

type HostClient struct {
	Engine pulumirpc.EngineServer
}

HostClient implements host.HostClient by forwarding all requests directly to the given pulumirpc.EngineServer.

func (*HostClient) EngineConn

func (h *HostClient) EngineConn() *grpc.ClientConn

func (*HostClient) Log

func (h *HostClient) Log(
	context context.Context, sev diag.Severity, urn resource.URN, msg string,
) error

Log logs a global message, including errors and warnings.

func (*HostClient) LogStatus

func (h *HostClient) LogStatus(
	context context.Context, sev diag.Severity, urn resource.URN, msg string,
) error

LogStatus logs a global status message, including errors and warnings. Status messages will appear in the `Info` column of the progress display, but not in the final output.

type Registration

type Registration struct {
	Urn     string
	ID      string
	State   resource.PropertyMap
	Request pulumirpc.RegisterResourceRequest
}

type ResourceMonitorServer

type ResourceMonitorServer struct {
	pulumirpc.UnimplementedResourceMonitorServer
	// contains filtered or unexported fields
}

func NewResourceMonitorServer

func NewResourceMonitorServer(t testing.TB, monitor pulumi.MockResourceMonitor) *ResourceMonitorServer

func (*ResourceMonitorServer) RegisterResource

func (*ResourceMonitorServer) RegisterResourceOutputs

func (*ResourceMonitorServer) Registrations

func (m *ResourceMonitorServer) Registrations() map[string]Registration

Registrations returns the resource registrations.

func (*ResourceMonitorServer) Resources

func (m *ResourceMonitorServer) Resources() map[string]resource.PropertyMap

Resources returns a map of registered resources by urn. Deprecated: Use Registrations instead.

type SimpleMonitor

type SimpleMonitor struct {
	CallF        func(args pulumi.MockCallArgs) (resource.PropertyMap, error)
	NewResourceF func(args pulumi.MockResourceArgs) (string, resource.PropertyMap, error)
}

func (*SimpleMonitor) Call

func (*SimpleMonitor) NewResource

Jump to

Keyboard shortcuts

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