api

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypeJson = "application/json"

Variables

This section is empty.

Functions

func InternalCall

func InternalCall(ctx context.Context, app string, version int, module, handler string, request ...any) error

InternalCall 内部调用, 不返回结果

func InternalInvoke

func InternalInvoke[RESULT any](ctx context.Context, app string, version int, module, handler string, request ...any) (RESULT, error)

InternalInvoke 内部调用, 返回结果

func NewEvent

func NewEvent(pubsubName, topic string, handler common.TopicEventHandler, args ...bool) event

Types

type DaprApi added in v0.0.7

type DaprApi interface {
	Invoke(ctx context.Context, app string, apiVersion int, module string, handler string, data any, appCode ...string) ([]byte, error)
	Lock(ctx context.Context, lockStore, lockOwner, resource string, expiryInSeconds int) error
	Unlock(ctx context.Context, lockStore, lockOwner, resource string) error
	Publish(ctx context.Context, pubSubName, topic string, data interface{}, args ...bool) error
	SaveState(ctx context.Context, storeName, key string, value interface{}) error
	GetState(ctx context.Context, storeName, key string) ([]byte, error)
	DeleteState(ctx context.Context, storeName, key string) error
	GetConfigurationItems(ctx context.Context, configStore string, keys []string) (map[string]*client.ConfigurationItem, error)
	SubscribeConfigurationItems(ctx context.Context, configStore string, keys []string, handler client.ConfigurationHandleFunction) (string, error)
	GetBulkState(ctx context.Context, storeName string, keys any) (map[string][]byte, error)
}

func New

func New() DaprApi

Jump to

Keyboard shortcuts

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