Documentation ¶
Index ¶
- Variables
- func DecodeCloudEvent(c *fiber.Ctx, ce *CloudEvent, target interface{}) error
- func InvokingContext(ctx context.Context, daprAppID string) context.Context
- func RegisterEventHandlers(app *fiber.App, events ...Events)
- func RegisterServices(app *fiber.App, services ...Service)
- func Subscribe(log logr.Logger, register func(subscriptions []*Subscription), ...)
- func SubscribeHTTPHandler(log logr.Logger, app *fiber.App) func(subscriptions []*Subscription)
- func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- type Client
- func (c *Client) GetSecret(ctx context.Context, store string, name string, target interface{}) error
- func (c *Client) GetState(ctx context.Context, store string, key string, target interface{}) error
- func (c *Client) Name() string
- func (c *Client) SetState(ctx context.Context, store string, items ...state.Item) error
- type CloudEvent
- type Events
- type GRPC
- func (c *GRPC) GetSecret(ctx context.Context, store string, name string, target interface{}) error
- func (c *GRPC) GetState(ctx context.Context, store string, key string, target interface{}) error
- func (c *GRPC) Name() string
- func (c *GRPC) SetState(ctx context.Context, store string, items ...state.Item) error
- type HTTP
- func (c *HTTP) GetSecret(ctx context.Context, store string, name string, target interface{}) error
- func (c *HTTP) GetState(ctx context.Context, store string, key string, target interface{}) error
- func (c *HTTP) Name() string
- func (c *HTTP) SetState(ctx context.Context, store string, items ...state.Item) error
- type HandlerRegistrar
- type RegisterEventHandler
- type Routes
- type Rule
- type Server
- 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) RegisterTopicEventHandler(path string, handler TopicEventHandler)
- func (s *Server) RegisterTopicEventHandlers(registrars ...HandlerRegistrar)
- func (s *Server) Subscribe(subscriptions []*Subscription)
- type Service
- type Subscriber
- type Subscription
- type TopicEventHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
APIURL = fmt.Sprintf("http://127.0.0.1:%s/", os.Getenv("DAPR_HTTP_PORT"))
)
View Source
var ErrDuplicateDefaultRoute = errors.New("duplicate default route")
View Source
var (
GRPCADDRESS = fmt.Sprintf("127.0.0.1:%s", os.Getenv("DAPR_GRPC_PORT"))
)
Functions ¶
func DecodeCloudEvent ¶
func DecodeCloudEvent(c *fiber.Ctx, ce *CloudEvent, target interface{}) error
func InvokingContext ¶
InvokingContext returns a new context with the target Dapr App ID added to outgoing metadata.
func RegisterEventHandlers ¶
func RegisterEventHandlers(app *fiber.App, events ...Events)
func RegisterServices ¶
func RegisterServices(app *fiber.App, services ...Service)
func Subscribe ¶
func Subscribe(log logr.Logger, register func(subscriptions []*Subscription), subscribers ...Subscriber)
Subscribe will gather all the subscriptions from `subscribers`, merge them, and pass them to `register`.
func SubscribeHTTPHandler ¶
func SubscribeHTTPHandler(log logr.Logger, app *fiber.App) func(subscriptions []*Subscription)
func UnaryClientInterceptor ¶
func UnaryClientInterceptor( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientInterceptor for passing incoming metadata to outgoing metadata
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type CloudEvent ¶
type CloudEvent struct { ID string `json:"id"` Source string `json:"source"` SpecVersion string `json:"specversion"` Type string `json:"type"` DataContentType string `json:"datacontenttype,omitempty"` DataSchema string `json:"dataschema,omitempty"` Subject string `json:"subject,omitempty"` Time time.Time `json:"time,omitempty"` Data json.RawMessage `json:"data"` }
CloudEvents specification can be found at https://github.com/cloudevents/spec/blob/v1.0.1/spec.md
type GRPC ¶
type GRPC struct {
// contains filtered or unexported fields
}
type HandlerRegistrar ¶
type HandlerRegistrar interface {
RegisterTopicEventHandlers(register RegisterEventHandler)
}
type RegisterEventHandler ¶
type RegisterEventHandler func(path string, handler TopicEventHandler)
type Routes ¶
type Routes struct { Rules []Rule `json:"rules,omitempty"` Default string `json:"default,omitempty"` }
Dapr subscription response
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListInputBindings ¶
func (*Server) ListTopicSubscriptions ¶
func (*Server) OnBindingEvent ¶
func (s *Server) OnBindingEvent(ctx context.Context, in *pb.BindingEventRequest) (*pb.BindingEventResponse, error)
func (*Server) OnInvoke ¶
func (s *Server) OnInvoke(ctx context.Context, in *cpb.InvokeRequest) (*cpb.InvokeResponse, error)
func (*Server) OnTopicEvent ¶
func (s *Server) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*pb.TopicEventResponse, error)
func (*Server) RegisterTopicEventHandler ¶
func (s *Server) RegisterTopicEventHandler(path string, handler TopicEventHandler)
func (*Server) RegisterTopicEventHandlers ¶
func (s *Server) RegisterTopicEventHandlers(registrars ...HandlerRegistrar)
func (*Server) Subscribe ¶
func (s *Server) Subscribe(subscriptions []*Subscription)
type Subscriber ¶
type Subscriber interface {
Subscriptions() []Subscription
}
Dapr subscription response
type Subscription ¶
type Subscription struct { PubsubName string `json:"pubsubname"` Topic string `json:"topic"` Metadata map[string]string `json:"metadata,omitempty"` Routes Routes `json:"routes"` }
Dapr subscription response
type TopicEventHandler ¶
type TopicEventHandler func(ctx context.Context, in *pb.TopicEventRequest) (*pb.TopicEventResponse, error)
Click to show internal directories.
Click to hide internal directories.