Documentation ¶
Index ¶
- func NewService(address string) (s common.Service, err error)
- func NewServiceWithListener(lis net.Listener) common.Service
- type Server
- func (s *Server) AddBindingInvocationHandler(name string, ...) error
- func (s *Server) AddServiceInvocationHandler(method string, ...) error
- func (s *Server) AddTopicEventHandler(sub *common.Subscription, ...) error
- func (s *Server) ListInputBindings(ctx context.Context, in *empty.Empty) (*pb.ListInputBindingsResponse, error)
- func (s *Server) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*pb.ListTopicSubscriptionsResponse, error)
- func (s *Server) OnBindingEvent(ctx context.Context, in *pb.BindingEventRequest) (*pb.BindingEventResponse, error)
- func (s *Server) OnInvoke(ctx context.Context, in *cpb.InvokeRequest) (*cpb.InvokeResponse, error)
- func (s *Server) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*pb.TopicEventResponse, error)
- func (s *Server) Start() error
- func (s *Server) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService creates new Service.
Types ¶
type Server ¶
type Server struct { pb.UnimplementedAppCallbackServer // contains filtered or unexported fields }
Server is the gRPC service implementation for Dapr.
func (*Server) AddBindingInvocationHandler ¶
func (s *Server) AddBindingInvocationHandler(name string, fn func(ctx context.Context, in *common.BindingEvent) (out []byte, err error)) error
AddBindingInvocationHandler appends provided binding invocation handler with its name to the service
func (*Server) AddServiceInvocationHandler ¶
func (s *Server) AddServiceInvocationHandler(method string, fn func(ctx context.Context, in *cc.InvocationEvent) (our *cc.Content, err error)) error
AddServiceInvocationHandler appends provided service invocation handler with its method to the service
func (*Server) AddTopicEventHandler ¶
func (s *Server) AddTopicEventHandler(sub *common.Subscription, fn func(ctx context.Context, e *common.TopicEvent) (retry bool, err error)) error
AddTopicEventHandler appends provided event handler with topic name to the service
func (*Server) ListInputBindings ¶
func (s *Server) 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 (*Server) ListTopicSubscriptions ¶
func (s *Server) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*pb.ListTopicSubscriptionsResponse, error)
ListTopicSubscriptions is called by Dapr to get the list of topics in a pubsub component the app wants to subscribe to.
func (*Server) OnBindingEvent ¶
func (s *Server) 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 (*Server) OnInvoke ¶
func (s *Server) OnInvoke(ctx context.Context, in *cpb.InvokeRequest) (*cpb.InvokeResponse, error)
OnInvoke gets invoked when a remote service has called the app through Dapr
func (*Server) OnTopicEvent ¶
func (s *Server) 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.