dapr

package
v1.0.90 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypeJson = "application/json"

Variables

This section is empty.

Functions

func DeleteState

func DeleteState(storeName, key string) error

DeleteState 删除状态

func Error

func Error(err error) (*common.Content, error)

func GetMetaValue

func GetMetaValue(ctx context.Context, key string) string

GetMetaValue get the first grpc meta value

func GetMetaValues

func GetMetaValues(ctx context.Context, key string) []string

GetMetaValues get grpc meta values

func GetServiceInvocationName added in v1.0.50

func GetServiceInvocationName(version int, module, method string) string

GetServiceInvocationName 构造version:module:realMethod的方法名

func GetState

func GetState(storeName, key string) ([]byte, error)

GetState 保存状态

func Invoke

func Invoke(appId string, version int, module, method string, data any, args ...string) ([]byte, error)

Invoke 调用dapr服务

func Lock added in v1.0.22

func Lock(lockStore, lockOwner, resource string, expiryInSeconds int) error

Lock 锁

func Publish

func Publish(pubSubName, topic string, data interface{}, args ...bool) error

Publish 发布消息 isRawPayLoad 发送原始的消息,非cloudevent message

func SaveState

func SaveState(storeName, key string, value interface{}) error

SaveState 保存状态

func Success

func Success(event *common.InvocationEvent, resp any) (*common.Content, error)

func Unlock added in v1.0.22

func Unlock(lockStore, lockOwner, resource string) error

Unlock 取消锁

Types

type Event

type Event struct {
	Subscription *common.Subscription
	Handler      common.TopicEventHandler
}

func GetEvent

func GetEvent(pubsubName, topic string, handler common.TopicEventHandler, args ...bool) Event

Jump to

Keyboard shortcuts

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