dapr

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 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 GetState

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

GetState 保存状态

func Invoke

func Invoke(appId string, version int, namespace, method string, data interface{}, args ...string) ([]byte, error)

Invoke 调用dapr服务

func InvokeWithClient

func InvokeWithClient(appId string, version int, namespace, client, method string, data interface{}, args ...string) ([]byte, error)

InvokeWithClient 调用dapr服务

func InvokeWithDaprClient

func InvokeWithDaprClient(daprClient client.Client, appId, methodName string, data interface{}, args ...string) ([]byte, error)

InvokeWithDaprClient 需要传入daprClient去调用

func ParseHandlers

ParseHandlers parse handlers from registry

func Publish

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

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

func RegisterHandlers

func RegisterHandlers(app string, holder interface{}, methods map[string]common.ServiceInvocationHandler, registry map[string]map[string]common.ServiceInvocationHandler) error

RegisterHandlers register namespace's method to global registry

func SaveState

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

SaveState 保存状态

func Success

func Success(event *common.InvocationEvent, resp interface{}) (*common.Content, error)

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