async

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeServer

type FakeServer struct {
	pb.UnimplementedAppCallbackServer
	// contains filtered or unexported fields
}

FakeServer is the gRPC service implementation for Dapr.

func NewFakeService

func NewFakeService(address string) (common.Service, *FakeServer, error)

NewFakeService creates new Service.

func (*FakeServer) AddBindingInvocationHandler

func (s *FakeServer) AddBindingInvocationHandler(name string, fn common.BindingInvocationHandler) error

AddBindingInvocationHandler appends provided binding invocation handler with its name to the service.

func (*FakeServer) AddServiceInvocationHandler

func (s *FakeServer) AddServiceInvocationHandler(method string, fn common.ServiceInvocationHandler) error

AddServiceInvocationHandler appends provided service invocation handler with its method to the service.

func (*FakeServer) AddTopicEventHandler

func (s *FakeServer) AddTopicEventHandler(sub *common.Subscription, fn common.TopicEventHandler) error

AddTopicEventHandler appends provided event handler with topic name to the service.

func (*FakeServer) ListInputBindings

func (s *FakeServer) ListInputBindings(ctx context.Context, in *empty.Empty) (*pb.ListInputBindingsResponse, error)

ListInputBindings is called by Dapr to get the list of bindings the app will get invoked by. In this example, we are telling Dapr To invoke our app with a binding named storage.

func (*FakeServer) OnBindingEvent

func (s *FakeServer) OnBindingEvent(ctx context.Context, in *pb.BindingEventRequest) (*pb.BindingEventResponse, error)

OnBindingEvent gets invoked every time a new event is fired from a registered binding. The message carries the binding name, a payload and optional metadata.

func (*FakeServer) OnInvoke

func (s *FakeServer) OnInvoke(ctx context.Context, in *cpb.InvokeRequest) (*cpb.InvokeResponse, error)

OnInvoke gets invoked when a remote service has called the app through Dapr.

func (*FakeServer) OnTopicEvent

func (s *FakeServer) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*pb.TopicEventResponse, error)

OnTopicEvent fired whenever a message has been published to a topic that has been subscribed. Dapr sends published messages in a CloudEvents v1.0 envelope.

func (*FakeServer) RegisterActorImplFactory

func (s *FakeServer) RegisterActorImplFactory(f actor.Factory, opts ...config.Option)

func (*FakeServer) Start

func (s *FakeServer) Start() error

Start registers the server and starts it.

func (*FakeServer) Stop

func (s *FakeServer) Stop() error

Stop stops the previously started service.

type Runtime

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

func NewAsyncRuntime

func NewAsyncRuntime(port string) (*Runtime, error)

func (*Runtime) GetHandler

func (r *Runtime) GetHandler() interface{}

func (*Runtime) Name

func (r *Runtime) Name() ofctx.Runtime

func (*Runtime) RegisterCloudEventFunction

func (r *Runtime) RegisterCloudEventFunction(
	ctx context.Context,
	funcContext ofctx.RuntimeContext,
	prePlugins []plugin.Plugin,
	postPlugins []plugin.Plugin,
	fn func(context.Context, cloudevents.Event) error,
) error

func (*Runtime) RegisterHTTPFunction

func (r *Runtime) RegisterHTTPFunction(
	ctx ofctx.RuntimeContext,
	prePlugins []plugin.Plugin,
	postPlugins []plugin.Plugin,
	fn func(http.ResponseWriter, *http.Request),
) error

func (*Runtime) RegisterOpenFunction

func (r *Runtime) RegisterOpenFunction(
	ctx ofctx.RuntimeContext,
	prePlugins []plugin.Plugin,
	postPlugins []plugin.Plugin,
	fn func(ofctx.Context, []byte) (ofctx.Out, error),
) error

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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