Help us shape the future of Go! Take the 2026 Go Developer Survey

universal

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Overview

Package universal contains the implementation of APIs that are shared between gRPC and HTTP servers. On HTTP servers, they use protojson to convert data to/from JSON.

Index

Constants

View Source
const ForceShutdownMetadataKey = "dapr-force-shutdown"

ForceShutdownMetadataKey is the gRPC metadata key (and HTTP header, after transport bridging) that, when set to "true", causes the sidecar to exit immediately via os.Exit(1) instead of performing a graceful shutdown.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	AppID                       string
	Namespace                   string
	Logger                      logger.Logger
	Resiliency                  resiliency.Provider
	CompStore                   *compstore.ComponentStore
	ShutdownFn                  func()
	ExitFn                      func(int)
	GetComponentsCapabilitiesFn func() map[string][]string
	ExtendedMetadata            map[string]string
	AppConnectionConfig         config.AppConnectionConfig
	GlobalConfig                *config.Configuration
	Scheduler                   schedclient.Interface
	Actors                      actors.Interface
	WorkflowEngine              wfengine.Interface
}

type Universal

type Universal struct {
	// contains filtered or unexported fields
}

Universal contains the implementation of gRPC APIs that are also used by the HTTP server.

func New

func New(opts Options) *Universal

func (*Universal) ActorReminders added in v1.15.0

func (a *Universal) ActorReminders(ctx context.Context) (reminders.Interface, error)

func (*Universal) ActorRouter added in v1.16.0

func (a *Universal) ActorRouter(ctx context.Context) (router.Interface, error)

func (*Universal) ActorState added in v1.15.0

func (a *Universal) ActorState(ctx context.Context) (state.Interface, error)

func (*Universal) ActorTimers added in v1.15.0

func (a *Universal) ActorTimers(ctx context.Context) (timers.Interface, error)

func (*Universal) Actors

func (a *Universal) Actors() actors.Interface

Actors returns the actor runtime. Callers (notably the gRPC API handler for SubscribeActorEventsAlpha1) use it to drive RegisterHosted/UnRegisterHosted imperatively from the stream lifecycle, mirroring how subscriptions go through CompStore and processor.Subscriber().

func (*Universal) AppConnectionConfig

func (a *Universal) AppConnectionConfig() config.AppConnectionConfig

func (*Universal) AppID

func (a *Universal) AppID() string

func (*Universal) BatchQueryVectorsAlpha1 added in v1.19.0

BatchQueryVectorsAlpha1 evaluates each query independently. A query that fails validation or is rejected by the provider yields an error result in its slot; only request-wide failures fail the RPC.

func (*Universal) CompStore

func (a *Universal) CompStore() *compstore.ComponentStore

func (*Universal) ConverseAlpha1 added in v1.15.0

func (*Universal) ConverseAlpha2 added in v1.16.0

func (*Universal) CreateCollectionAlpha1 added in v1.19.0

func (a *Universal) CreateCollectionAlpha1(ctx context.Context, req *runtimev1pb.CreateCollectionRequestAlpha1) (*emptypb.Empty, error)

func (*Universal) CreateIndexAlpha1 added in v1.19.0

func (a *Universal) CreateIndexAlpha1(ctx context.Context, req *runtimev1pb.CreateIndexRequestAlpha1) (*emptypb.Empty, error)

func (*Universal) CryptoGetUnwrapKeyFn

func (a *Universal) CryptoGetUnwrapKeyFn(ctx context.Context, componentName string, component contribCrypto.SubtleCrypto) encv1.UnwrapKeyFn

func (*Universal) CryptoGetWrapKeyFn

func (a *Universal) CryptoGetWrapKeyFn(ctx context.Context, componentName string, component contribCrypto.SubtleCrypto) encv1.WrapKeyFn

func (*Universal) CryptoValidateRequest

func (a *Universal) CryptoValidateRequest(componentName string) (contribCrypto.SubtleCrypto, error)

CryptoValidateRequest is an internal method that checks if the request is for a valid crypto component.

func (*Universal) DeleteBinaryFileAlpha1 added in v1.19.0

func (a *Universal) DeleteBinaryFileAlpha1(ctx context.Context, componentName, fileName string) error

DeleteBinaryFileAlpha1 removes the named file from the given component.

func (*Universal) DeleteCollectionAlpha1 added in v1.19.0

func (a *Universal) DeleteCollectionAlpha1(ctx context.Context, req *runtimev1pb.DeleteCollectionRequestAlpha1) (*emptypb.Empty, error)

func (*Universal) DeleteDocumentsAlpha1 added in v1.19.0

DeleteDocumentsAlpha1 is a write and shares the acknowledgement model of IndexDocumentsAlpha1. IDs that do not exist are not an error.

func (*Universal) DeleteIndexAlpha1 added in v1.19.0

func (a *Universal) DeleteIndexAlpha1(ctx context.Context, req *runtimev1pb.DeleteIndexRequestAlpha1) (*emptypb.Empty, error)

func (*Universal) DeleteJob added in v1.18.0

func (*Universal) DeleteJobAlpha1 added in v1.14.0

func (*Universal) DeleteJobsByPrefix added in v1.18.0

func (*Universal) DeleteJobsByPrefixAlpha1 added in v1.17.0

func (*Universal) DeleteVectorsAlpha1 added in v1.19.0

DeleteVectorsAlpha1 is a write and shares the acknowledgement model of UpsertVectorsAlpha1. IDs that do not exist are not an error.

func (*Universal) GetActorReminder added in v1.17.0

func (*Universal) GetActorTimer added in v1.19.0

func (*Universal) GetBinaryFileAlpha1 added in v1.19.0

func (a *Universal) GetBinaryFileAlpha1(ctx context.Context, componentName, fileName string) (io.ReadCloser, error)

GetBinaryFileAlpha1 retrieves the named file from the given component and returns a streaming reader. The caller is responsible for closing the returned reader when reading is complete.

func (*Universal) GetCollectionAlpha1 added in v1.19.0

func (*Universal) GetDocumentsAlpha1 added in v1.19.0

func (*Universal) GetIndexAlpha1 added in v1.19.0

func (*Universal) GetJob added in v1.18.0

func (*Universal) GetJobAlpha1 added in v1.14.0

func (*Universal) GetSecret

func (*Universal) GetStateStore

func (a *Universal) GetStateStore(name string) (state.Store, error)

func (*Universal) GetVectorsAlpha1 added in v1.19.0

func (*Universal) GetWorkflow added in v1.15.0

GetWorkflow is the API handler for getting workflow details

func (*Universal) GetWorkflowAlpha1 deprecated

GetWorkflowAlpha1 is the API handler for getting workflow details

Deprecated: Use GetWorkflow instead.

func (*Universal) GetWorkflowBeta1

GetWorkflowBeta1 is the API handler for getting workflow details

func (*Universal) IndexDocumentsAlpha1 added in v1.19.0

IndexDocumentsAlpha1 is a keyed upsert: every document carries a non-empty, caller-supplied ID that is unique within the request, which makes retrying the same request idempotent. Documents whose content is not a JSON object are reported in failed_items and never reach the provider.

func (*Universal) ListActorReminders added in v1.17.0

func (*Universal) ListActorTimers added in v1.19.0

func (*Universal) ListCollectionsAlpha1 added in v1.19.0

func (*Universal) ListIndexesAlpha1 added in v1.19.0

func (*Universal) ListJobs added in v1.18.0

func (*Universal) ListJobsAlpha1 added in v1.17.0

func (*Universal) Namespace added in v1.14.0

func (a *Universal) Namespace() string

func (*Universal) PauseWorkflow added in v1.15.0

PauseWorkflow is the API handler for pausing a workflow

func (*Universal) PauseWorkflowAlpha1 deprecated

func (a *Universal) PauseWorkflowAlpha1(ctx context.Context, in *runtimev1pb.PauseWorkflowRequest) (*emptypb.Empty, error)

PauseWorkflowAlpha1 is the API handler for pausing a workflow

Deprecated: Use PauseWorkflow instead.

func (*Universal) PauseWorkflowBeta1

func (a *Universal) PauseWorkflowBeta1(ctx context.Context, in *runtimev1pb.PauseWorkflowRequest) (*emptypb.Empty, error)

PauseWorkflowBeta1 is the API handler for pausing a workflow

func (*Universal) PurgeWorkflow added in v1.15.0

PurgeWorkflow is the API handler for purging a workflow

func (*Universal) PurgeWorkflowAlpha1 deprecated

func (a *Universal) PurgeWorkflowAlpha1(ctx context.Context, in *runtimev1pb.PurgeWorkflowRequest) (*emptypb.Empty, error)

PurgeWorkflowAlpha1 is the API handler for purging a workflow

Deprecated: Use PurgeWorkflow instead.

func (*Universal) PurgeWorkflowBeta1

func (a *Universal) PurgeWorkflowBeta1(ctx context.Context, in *runtimev1pb.PurgeWorkflowRequest) (*emptypb.Empty, error)

PurgeWorkflowBeta1 is the API handler for purging a workflow

func (*Universal) QueryStateAlpha1

func (*Universal) QueryVectorsAlpha1 added in v1.19.0

func (*Universal) RaiseEventWorkflow added in v1.15.0

func (a *Universal) RaiseEventWorkflow(ctx context.Context, in *runtimev1pb.RaiseEventWorkflowRequest) (*emptypb.Empty, error)

RaiseEventWorkflow is the API handler for raising an event to a workflow

func (*Universal) RaiseEventWorkflowAlpha1 deprecated

func (a *Universal) RaiseEventWorkflowAlpha1(ctx context.Context, in *runtimev1pb.RaiseEventWorkflowRequest) (*emptypb.Empty, error)

RaiseEventWorkflowAlpha1 is the API handler for raising an event to a workflow

Deprecated: Use RaiseEventWorkflow instead.

func (*Universal) RaiseEventWorkflowBeta1

func (a *Universal) RaiseEventWorkflowBeta1(ctx context.Context, in *runtimev1pb.RaiseEventWorkflowRequest) (*emptypb.Empty, error)

RaiseEventWorkflowBeta1 is the API handler for raising an event to a workflow

func (*Universal) RegisterActorReminder added in v1.14.0

func (a *Universal) RegisterActorReminder(ctx context.Context, in *runtimev1pb.RegisterActorReminderRequest) (*emptypb.Empty, error)

func (*Universal) RegisterActorTimer added in v1.14.0

func (a *Universal) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*emptypb.Empty, error)

func (*Universal) RejectInternalActorType added in v1.18.0

func (a *Universal) RejectInternalActorType(actorType string) error

RejectInternalActorType returns an error when actorType is a Dapr-reserved internal actor type (workflow, activity, executor, retentioner). The runtime owns these actors' lifecycle; direct user access via the generic actor APIs would corrupt workflow state or bypass per-operation policy.

func (*Universal) Resiliency

func (a *Universal) Resiliency() resiliency.Provider

func (*Universal) ResumeWorkflow added in v1.15.0

func (a *Universal) ResumeWorkflow(ctx context.Context, in *runtimev1pb.ResumeWorkflowRequest) (*emptypb.Empty, error)

ResumeWorkflow is the API handler for resuming a workflow

func (*Universal) ResumeWorkflowAlpha1 deprecated

func (a *Universal) ResumeWorkflowAlpha1(ctx context.Context, in *runtimev1pb.ResumeWorkflowRequest) (*emptypb.Empty, error)

ResumeWorkflowAlpha1 is the API handler for resuming a workflow

Deprecated: Use ResumeWorkflow instead.

func (*Universal) ResumeWorkflowBeta1

func (a *Universal) ResumeWorkflowBeta1(ctx context.Context, in *runtimev1pb.ResumeWorkflowRequest) (*emptypb.Empty, error)

ResumeWorkflowBeta1 is the API handler for resuming a workflow

func (*Universal) ScheduleJob added in v1.18.0

func (*Universal) ScheduleJobAlpha1 added in v1.14.0

func (*Universal) ScheduleJobAlpha1HTTP added in v1.14.3

func (*Universal) SearchAlpha1 added in v1.19.0

func (*Universal) SetBinaryFileAlpha1 added in v1.19.0

func (a *Universal) SetBinaryFileAlpha1(ctx context.Context, componentName, fileName string, overwrite bool, r io.Reader) error

SetBinaryFileAlpha1 stores binary content streamed from r into the named file in the given component. When overwrite is false the operation fails with ErrBinaryStoreFileExists if the file already exists.

The caller must not close r until this method returns.

func (*Universal) SetMetadata

SetMetadata Sets value in extended metadata of the sidecar.

func (*Universal) Shutdown

Shutdown the sidecar.

func (*Universal) StartWorkflow added in v1.15.0

StartWorkflow is the API handler for starting a workflow

func (*Universal) StartWorkflowAlpha1 deprecated

StartWorkflowAlpha1 is the API handler for starting a workflow

Deprecated: Use StartWorkflow instead.

func (*Universal) StartWorkflowBeta1

StartWorkflowBeta1 is the API handler for starting a workflow

func (*Universal) SubtleDecryptAlpha1

SubtleDecryptAlpha1 decrypts a small message using a key stored in the vault.

func (*Universal) SubtleEncryptAlpha1

SubtleEncryptAlpha1 encrypts a small message using a key stored in the vault.

func (*Universal) SubtleGetKeyAlpha1

SubtleGetKeyAlpha1 returns the public part of an asymmetric key stored in the vault.

func (*Universal) SubtleSignAlpha1

SubtleSignAlpha1 signs a message using a key stored in the vault.

func (*Universal) SubtleUnwrapKeyAlpha1

SubtleUnwrapKeyAlpha1 unwraps a key using a key stored in the vault.

func (*Universal) SubtleVerifyAlpha1

SubtleVerifyAlpha1 verifies the signature of a message using a key stored in the vault.

func (*Universal) SubtleWrapKeyAlpha1

SubtleWrapKeyAlpha1 wraps a key using a key stored in the vault.

func (*Universal) TerminateWorkflow added in v1.15.0

func (a *Universal) TerminateWorkflow(ctx context.Context, in *runtimev1pb.TerminateWorkflowRequest) (*emptypb.Empty, error)

TerminateWorkflow is the API handler for terminating a workflow

func (*Universal) TerminateWorkflowAlpha1 deprecated

func (a *Universal) TerminateWorkflowAlpha1(ctx context.Context, in *runtimev1pb.TerminateWorkflowRequest) (*emptypb.Empty, error)

TerminateWorkflowAlpha1 is the API handler for terminating a workflow

Deprecated: Use TerminateWorkflow instead.

func (*Universal) TerminateWorkflowBeta1

func (a *Universal) TerminateWorkflowBeta1(ctx context.Context, in *runtimev1pb.TerminateWorkflowRequest) (*emptypb.Empty, error)

TerminateWorkflowBeta1 is the API handler for terminating a workflow

func (*Universal) TryLockAlpha1

func (*Universal) UnlockAlpha1

func (*Universal) UnregisterActorReminder added in v1.14.0

func (a *Universal) UnregisterActorReminder(ctx context.Context, in *runtimev1pb.UnregisterActorReminderRequest) (*emptypb.Empty, error)

func (*Universal) UnregisterActorTimer added in v1.14.0

func (a *Universal) UnregisterActorTimer(ctx context.Context, in *runtimev1pb.UnregisterActorTimerRequest) (*emptypb.Empty, error)

func (*Universal) UpsertVectorsAlpha1 added in v1.19.0

UpsertVectorsAlpha1 is a keyed upsert: every record carries a non-empty, caller-supplied ID that is unique within the request.

Jump to

Keyboard shortcuts

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