Skip to content

Commit

Permalink
Merge pull request #78 from Mershab99/exposeDaprClient
Browse files Browse the repository at this point in the history
Expose Dapr Client
  • Loading branch information
benjaminhuo authored Jun 17, 2024
2 parents 39db25b + e79f3ee commit 1652601
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ type Context interface {

// GetInputName return the inputName of the event
GetInputName() string

GetDaprClient() dapr.Client
}

type Out interface {
Expand Down Expand Up @@ -417,6 +419,10 @@ func (ctx *FunctionContext) Send(outputName string, data []byte) ([]byte, error)
return nil, nil
}

func (ctx *FunctionContext) GetDaprClient() dapr.Client {
return ctx.daprClient
}

func (ctx *FunctionContext) HasInputs() bool {
if len(ctx.GetInputs()) > 0 {
return true
Expand Down

0 comments on commit 1652601

Please sign in to comment.