callback

package
v0.0.0-...-ac1778d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: GPL-3.0 Imports: 5 Imported by: 7

README

package callback

This package contains the callback interface that providers can override. Providers should embed the UnimplementedProviderCallback struct to ensure that the default implementation of callback methods are always available on the provider.

Important:

  • The only callback method that providers are required to implement is GetAuthorizationHeader.
  • While not strictly necessary, you might also want to implement OnConfigure.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderCallback

type ProviderCallback interface {
	// GetAuthorizationHeader returns the value of the Authorization header
	// used in all calls to the REST API.
	GetAuthorizationHeader() string

	// OnConfigure is a hook for configuring the provider.
	// Return a non-nil response to override the default behavior.
	OnConfigure(ctx context.Context, req *pulumirpc.ConfigureRequest) (*pulumirpc.ConfigureResponse, error)

	// GetGlobalPathParams returns a map of path parameters used across all (or most) requests
	// This method is called during the Configure phase, but after the OnConfigure hook.
	GetGlobalPathParams(ctx context.Context, req *pulumirpc.ConfigureRequest) (map[string]string, error)

	OnPreInvoke(ctx context.Context, req *pulumirpc.InvokeRequest, httpReq *http.Request) error
	OnPostInvoke(ctx context.Context, req *pulumirpc.InvokeRequest, outputs interface{}) (map[string]interface{}, error)

	// OnDiff is a hook for calculating diffs on old vs. new inputs.
	// Return a non-nil response to override the default behavior.
	OnDiff(ctx context.Context, req *pulumirpc.DiffRequest, resourceTypeToken string, diff *resource.ObjectDiff, jsonReq *openapi3.MediaType) (*pulumirpc.DiffResponse, error)

	// OnPreCreate is a hook for modifying the HTTP request
	// to be made for the create request.
	// Return a non-nil error to fail the request.
	OnPreCreate(ctx context.Context, req *pulumirpc.CreateRequest, httpReq *http.Request) error

	// OnPostCreate is a hook for modifying the outputs.
	// Implementations must return an outputs map,
	// which can either be the same as the one that
	// was provided to it or modified in some way.
	OnPostCreate(ctx context.Context, req *pulumirpc.CreateRequest, outputs interface{}) (map[string]interface{}, error)

	// OnPreRead is a hook for modifying the HTTP request
	// to be made for the read request.
	// Return a non-nil error to fail the request.
	OnPreRead(ctx context.Context, req *pulumirpc.ReadRequest, httpReq *http.Request) error
	// OnPostRead is a hook for modifying the outputs.
	// Implementations must return an outputs map,
	// which can either be the same as the one that
	// was provided to it or modified in some way.
	OnPostRead(ctx context.Context, req *pulumirpc.ReadRequest, outputs interface{}) (map[string]interface{}, error)

	// OnPreUpdate is a hook for modifying the HTTP request
	// to be made for the update request.
	// Return a non-nil error to fail the request.
	OnPreUpdate(ctx context.Context, req *pulumirpc.UpdateRequest, httpReq *http.Request) error
	// OnPostUpdate is a hook for modifying the outputs.
	// Implementations must return an outputs map,
	// which can either be the same as the one that
	// was provided to it or modified in some way.
	OnPostUpdate(ctx context.Context, req *pulumirpc.UpdateRequest, httpReq http.Request, outputs interface{}) (map[string]interface{}, error)

	// OnPreDelete is a hook for modifying the HTTP request
	// to be made for the delete request.
	// Return a non-nil error to fail the request.
	OnPreDelete(ctx context.Context, req *pulumirpc.DeleteRequest, httpReq *http.Request) error
	// OnPostDelete is a hook for modifying the outputs.
	OnPostDelete(ctx context.Context, req *pulumirpc.DeleteRequest) error
}

type UnimplementedProviderCallback

type UnimplementedProviderCallback struct{}

func (UnimplementedProviderCallback) GetGlobalPathParams

func (UnimplementedProviderCallback) OnPostCreate

func (UnimplementedProviderCallback) OnPostCreate(_ context.Context, _ *pulumirpc.CreateRequest, outputs interface{}) (map[string]interface{}, error)

func (UnimplementedProviderCallback) OnPostDelete

func (UnimplementedProviderCallback) OnPostInvoke

func (UnimplementedProviderCallback) OnPostInvoke(_ context.Context, _ *pulumirpc.InvokeRequest, outputs interface{}) (map[string]interface{}, error)

func (UnimplementedProviderCallback) OnPostRead

func (UnimplementedProviderCallback) OnPostRead(_ context.Context, _ *pulumirpc.ReadRequest, outputs interface{}) (map[string]interface{}, error)

func (UnimplementedProviderCallback) OnPostUpdate

func (UnimplementedProviderCallback) OnPostUpdate(_ context.Context, _ *pulumirpc.UpdateRequest, _ http.Request, outputs interface{}) (map[string]interface{}, error)

func (UnimplementedProviderCallback) OnPreCreate

func (UnimplementedProviderCallback) OnPreDelete

func (UnimplementedProviderCallback) OnPreInvoke

func (UnimplementedProviderCallback) OnPreRead

func (UnimplementedProviderCallback) OnPreUpdate

Jump to

Keyboard shortcuts

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