mirror of https://github.com/dapr/dapr.git
Use protoc 3.14.0 to generate protobuf v2 apis. (#2700)
* wip * wip * wip * fix linter * regen * update go mod in tests
This commit is contained in:
parent
e36d95976b
commit
be08e55201
|
@ -11,7 +11,7 @@
|
|||
|
||||
## Proto client generation
|
||||
|
||||
1. Install protoc version: [v3.11.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.11.0)
|
||||
1. Install protoc version: [v3.14.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.14.0)
|
||||
|
||||
2. Install protoc-gen-go and protoc-gen-go-grpc
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// MockServer implementation of fake user app server
|
||||
|
@ -40,16 +40,16 @@ func (m *MockServer) OnInvoke(ctx context.Context, in *commonv1pb.InvokeRequest)
|
|||
dt["querystring"] = string(serialized)
|
||||
|
||||
ds, _ := json.Marshal(dt)
|
||||
return &commonv1pb.InvokeResponse{Data: &any.Any{Value: ds}, ContentType: "application/json"}, m.Error
|
||||
return &commonv1pb.InvokeResponse{Data: &anypb.Any{Value: ds}, ContentType: "application/json"}, m.Error
|
||||
}
|
||||
|
||||
func (m *MockServer) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*runtimev1pb.ListTopicSubscriptionsResponse, error) {
|
||||
func (m *MockServer) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty) (*runtimev1pb.ListTopicSubscriptionsResponse, error) {
|
||||
return &runtimev1pb.ListTopicSubscriptionsResponse{
|
||||
Subscriptions: m.Subscriptions,
|
||||
}, m.Error
|
||||
}
|
||||
|
||||
func (m *MockServer) ListInputBindings(ctx context.Context, in *empty.Empty) (*runtimev1pb.ListInputBindingsResponse, error) {
|
||||
func (m *MockServer) ListInputBindings(ctx context.Context, in *emptypb.Empty) (*runtimev1pb.ListInputBindingsResponse, error) {
|
||||
return &runtimev1pb.ListInputBindingsResponse{
|
||||
Bindings: m.Bindings,
|
||||
}, m.Error
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
config "github.com/dapr/dapr/pkg/config/modes"
|
||||
"github.com/dapr/dapr/pkg/logger"
|
||||
operatorv1pb "github.com/dapr/dapr/pkg/proto/operator/v1"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
var log = logger.NewLogger("dapr.runtime.components")
|
||||
|
@ -41,7 +41,7 @@ func NewKubernetesComponents(configuration config.KubernetesConfig, operatorClie
|
|||
|
||||
// LoadComponents returns components from a given control plane address
|
||||
func (k *KubernetesComponents) LoadComponents() ([]components_v1alpha1.Component, error) {
|
||||
resp, err := k.client.ListComponents(context.Background(), &empty.Empty{}, grpc_retry.WithMax(operatorMaxRetries), grpc_retry.WithPerRetryTimeout(operatorCallTimeout))
|
||||
resp, err := k.client.ListComponents(context.Background(), &emptypb.Empty{}, grpc_retry.WithMax(operatorMaxRetries), grpc_retry.WithPerRetryTimeout(operatorCallTimeout))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -12,10 +12,10 @@ import (
|
|||
subscriptions "github.com/dapr/dapr/pkg/apis/subscriptions/v1alpha1"
|
||||
config "github.com/dapr/dapr/pkg/config/modes"
|
||||
operatorv1pb "github.com/dapr/dapr/pkg/proto/operator/v1"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/phayes/freeport"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
type mockOperator struct {
|
||||
|
@ -25,7 +25,7 @@ func (o *mockOperator) GetConfiguration(ctx context.Context, in *operatorv1pb.Ge
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
func (o *mockOperator) ListComponents(ctx context.Context, in *empty.Empty) (*operatorv1pb.ListComponentResponse, error) {
|
||||
func (o *mockOperator) ListComponents(ctx context.Context, in *emptypb.Empty) (*operatorv1pb.ListComponentResponse, error) {
|
||||
component := v1alpha1.Component{}
|
||||
component.ObjectMeta.Name = "test"
|
||||
component.Spec = v1alpha1.ComponentSpec{
|
||||
|
@ -38,7 +38,7 @@ func (o *mockOperator) ListComponents(ctx context.Context, in *empty.Empty) (*op
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (o *mockOperator) ListSubscriptions(ctx context.Context, in *empty.Empty) (*operatorv1pb.ListSubscriptionsResponse, error) {
|
||||
func (o *mockOperator) ListSubscriptions(ctx context.Context, in *emptypb.Empty) (*operatorv1pb.ListSubscriptionsResponse, error) {
|
||||
subscription := subscriptions.Subscription{}
|
||||
subscription.ObjectMeta.Name = "test"
|
||||
subscription.Spec = subscriptions.SubscriptionSpec{
|
||||
|
@ -53,7 +53,7 @@ func (o *mockOperator) ListSubscriptions(ctx context.Context, in *empty.Empty) (
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (o *mockOperator) ComponentUpdate(in *empty.Empty, srv operatorv1pb.Operator_ComponentUpdateServer) error {
|
||||
func (o *mockOperator) ComponentUpdate(in *emptypb.Empty, srv operatorv1pb.Operator_ComponentUpdateServer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ import (
|
|||
"time"
|
||||
|
||||
diag_utils "github.com/dapr/dapr/pkg/diagnostics/utils"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
"go.opencensus.io/tag"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// This implementation is inspired by
|
||||
|
|
114
pkg/grpc/api.go
114
pkg/grpc/api.go
|
@ -31,12 +31,12 @@ import (
|
|||
internalv1pb "github.com/dapr/dapr/pkg/proto/internals/v1"
|
||||
runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
runtime_pubsub "github.com/dapr/dapr/pkg/runtime/pubsub"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -50,30 +50,30 @@ type API interface {
|
|||
CallLocal(ctx context.Context, in *internalv1pb.InternalInvokeRequest) (*internalv1pb.InternalInvokeResponse, error)
|
||||
|
||||
// Dapr Service methods
|
||||
PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*empty.Empty, error)
|
||||
PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*emptypb.Empty, error)
|
||||
InvokeService(ctx context.Context, in *runtimev1pb.InvokeServiceRequest) (*commonv1pb.InvokeResponse, error)
|
||||
InvokeBinding(ctx context.Context, in *runtimev1pb.InvokeBindingRequest) (*runtimev1pb.InvokeBindingResponse, error)
|
||||
GetState(ctx context.Context, in *runtimev1pb.GetStateRequest) (*runtimev1pb.GetStateResponse, error)
|
||||
GetBulkState(ctx context.Context, in *runtimev1pb.GetBulkStateRequest) (*runtimev1pb.GetBulkStateResponse, error)
|
||||
GetSecret(ctx context.Context, in *runtimev1pb.GetSecretRequest) (*runtimev1pb.GetSecretResponse, error)
|
||||
GetBulkSecret(ctx context.Context, in *runtimev1pb.GetBulkSecretRequest) (*runtimev1pb.GetBulkSecretResponse, error)
|
||||
SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*empty.Empty, error)
|
||||
DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*empty.Empty, error)
|
||||
ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*empty.Empty, error)
|
||||
SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*emptypb.Empty, error)
|
||||
DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*emptypb.Empty, error)
|
||||
ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*emptypb.Empty, error)
|
||||
SetAppChannel(appChannel channel.AppChannel)
|
||||
SetDirectMessaging(directMessaging messaging.DirectMessaging)
|
||||
SetActorRuntime(actor actors.Actors)
|
||||
RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*empty.Empty, error)
|
||||
UnregisterActorTimer(ctx context.Context, in *runtimev1pb.UnregisterActorTimerRequest) (*empty.Empty, error)
|
||||
RegisterActorReminder(ctx context.Context, in *runtimev1pb.RegisterActorReminderRequest) (*empty.Empty, error)
|
||||
UnregisterActorReminder(ctx context.Context, in *runtimev1pb.UnregisterActorReminderRequest) (*empty.Empty, error)
|
||||
RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*emptypb.Empty, error)
|
||||
UnregisterActorTimer(ctx context.Context, in *runtimev1pb.UnregisterActorTimerRequest) (*emptypb.Empty, error)
|
||||
RegisterActorReminder(ctx context.Context, in *runtimev1pb.RegisterActorReminderRequest) (*emptypb.Empty, error)
|
||||
UnregisterActorReminder(ctx context.Context, in *runtimev1pb.UnregisterActorReminderRequest) (*emptypb.Empty, error)
|
||||
GetActorState(ctx context.Context, in *runtimev1pb.GetActorStateRequest) (*runtimev1pb.GetActorStateResponse, error)
|
||||
ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteActorStateTransactionRequest) (*empty.Empty, error)
|
||||
ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteActorStateTransactionRequest) (*emptypb.Empty, error)
|
||||
InvokeActor(ctx context.Context, in *runtimev1pb.InvokeActorRequest) (*runtimev1pb.InvokeActorResponse, error)
|
||||
// Gets metadata of the sidecar
|
||||
GetMetadata(ctx context.Context, in *empty.Empty) (*runtimev1pb.GetMetadataResponse, error)
|
||||
GetMetadata(ctx context.Context, in *emptypb.Empty) (*runtimev1pb.GetMetadataResponse, error)
|
||||
// Sets value in extended metadata of the sidecar
|
||||
SetMetadata(ctx context.Context, in *runtimev1pb.SetMetadataRequest) (*empty.Empty, error)
|
||||
SetMetadata(ctx context.Context, in *runtimev1pb.SetMetadataRequest) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type api struct {
|
||||
|
@ -201,32 +201,32 @@ func (a *api) CallActor(ctx context.Context, in *internalv1pb.InternalInvokeRequ
|
|||
return resp.Proto(), nil
|
||||
}
|
||||
|
||||
func (a *api) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*empty.Empty, error) {
|
||||
func (a *api) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*emptypb.Empty, error) {
|
||||
if a.pubsubAdapter == nil {
|
||||
err := status.Error(codes.FailedPrecondition, messages.ErrPubsubNotConfigured)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
pubsubName := in.PubsubName
|
||||
if pubsubName == "" {
|
||||
err := status.Error(codes.InvalidArgument, messages.ErrPubsubEmpty)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
thepubsub := a.pubsubAdapter.GetPubSub(pubsubName)
|
||||
if thepubsub == nil {
|
||||
err := status.Errorf(codes.InvalidArgument, messages.ErrPubsubNotFound, pubsubName)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
topic := in.Topic
|
||||
if topic == "" {
|
||||
err := status.Errorf(codes.InvalidArgument, messages.ErrTopicEmpty, pubsubName)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
body := []byte{}
|
||||
|
@ -249,7 +249,7 @@ func (a *api) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequ
|
|||
if err != nil {
|
||||
err = status.Errorf(codes.InvalidArgument, messages.ErrPubsubCloudEventCreation, err.Error())
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
features := thepubsub.Features()
|
||||
|
@ -259,7 +259,7 @@ func (a *api) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequ
|
|||
if err != nil {
|
||||
err = status.Errorf(codes.InvalidArgument, messages.ErrPubsubCloudEventsSer, topic, pubsubName, err.Error())
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := pubsub.PublishRequest{
|
||||
|
@ -280,9 +280,9 @@ func (a *api) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequ
|
|||
nerr = status.Errorf(codes.NotFound, err.Error())
|
||||
}
|
||||
apiServerLogger.Debug(nerr)
|
||||
return &empty.Empty{}, nerr
|
||||
return &emptypb.Empty{}, nerr
|
||||
}
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (a *api) InvokeService(ctx context.Context, in *runtimev1pb.InvokeServiceRequest) (*commonv1pb.InvokeResponse, error) {
|
||||
|
@ -455,11 +455,11 @@ func (a *api) GetState(ctx context.Context, in *runtimev1pb.GetStateRequest) (*r
|
|||
return response, nil
|
||||
}
|
||||
|
||||
func (a *api) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*empty.Empty, error) {
|
||||
func (a *api) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*emptypb.Empty, error) {
|
||||
store, err := a.getStateStore(in.StoreName)
|
||||
if err != nil {
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
reqs := []state.SetRequest{}
|
||||
|
@ -485,9 +485,9 @@ func (a *api) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (
|
|||
if err != nil {
|
||||
err = a.stateErrorResponse(err, messages.ErrStateSave, in.StoreName, err.Error())
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
// stateErrorResponse takes a state store error, format and args and returns a status code encoded gRPC error
|
||||
|
@ -506,11 +506,11 @@ func (a *api) stateErrorResponse(err error, format string, args ...interface{})
|
|||
return status.Errorf(codes.Internal, format, args...)
|
||||
}
|
||||
|
||||
func (a *api) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*empty.Empty, error) {
|
||||
func (a *api) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*emptypb.Empty, error) {
|
||||
store, err := a.getStateStore(in.StoreName)
|
||||
if err != nil {
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := state.DeleteRequest{
|
||||
|
@ -531,9 +531,9 @@ func (a *api) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateReques
|
|||
if err != nil {
|
||||
err = a.stateErrorResponse(err, messages.ErrStateDelete, in.Key, err.Error())
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (a *api) GetSecret(ctx context.Context, in *runtimev1pb.GetSecretRequest) (*runtimev1pb.GetSecretResponse, error) {
|
||||
|
@ -630,11 +630,11 @@ func extractEtag(req *commonv1pb.StateItem) (bool, string) {
|
|||
return false, ""
|
||||
}
|
||||
|
||||
func (a *api) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*empty.Empty, error) {
|
||||
func (a *api) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*emptypb.Empty, error) {
|
||||
if a.stateStores == nil || len(a.stateStores) == 0 {
|
||||
err := status.Error(codes.FailedPrecondition, messages.ErrStateStoresNotConfigured)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
storeName := in.StoreName
|
||||
|
@ -642,14 +642,14 @@ func (a *api) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.Execu
|
|||
if a.stateStores[storeName] == nil {
|
||||
err := status.Errorf(codes.InvalidArgument, messages.ErrStateStoreNotFound, storeName)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
transactionalStore, ok := a.stateStores[storeName].(state.TransactionalStore)
|
||||
if !ok {
|
||||
err := status.Errorf(codes.Unimplemented, messages.ErrStateStoreNotSupported, storeName)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
operations := []state.TransactionalStateOperation{}
|
||||
|
@ -709,7 +709,7 @@ func (a *api) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.Execu
|
|||
default:
|
||||
err := status.Errorf(codes.Unimplemented, messages.ErrNotSupportedStateOperation, inputReq.OperationType)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
operations = append(operations, operation)
|
||||
|
@ -723,16 +723,16 @@ func (a *api) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.Execu
|
|||
if err != nil {
|
||||
err = status.Errorf(codes.Internal, messages.ErrStateTransaction, err.Error())
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (a *api) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*empty.Empty, error) {
|
||||
func (a *api) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*emptypb.Empty, error) {
|
||||
if a.actor == nil {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorRuntimeNotFound)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := &actors.CreateTimerRequest{
|
||||
|
@ -748,14 +748,14 @@ func (a *api) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterAc
|
|||
req.Data = in.Data
|
||||
}
|
||||
err := a.actor.CreateTimer(ctx, req)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
func (a *api) UnregisterActorTimer(ctx context.Context, in *runtimev1pb.UnregisterActorTimerRequest) (*empty.Empty, error) {
|
||||
func (a *api) UnregisterActorTimer(ctx context.Context, in *runtimev1pb.UnregisterActorTimerRequest) (*emptypb.Empty, error) {
|
||||
if a.actor == nil {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorRuntimeNotFound)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := &actors.DeleteTimerRequest{
|
||||
|
@ -765,14 +765,14 @@ func (a *api) UnregisterActorTimer(ctx context.Context, in *runtimev1pb.Unregist
|
|||
}
|
||||
|
||||
err := a.actor.DeleteTimer(ctx, req)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
func (a *api) RegisterActorReminder(ctx context.Context, in *runtimev1pb.RegisterActorReminderRequest) (*empty.Empty, error) {
|
||||
func (a *api) RegisterActorReminder(ctx context.Context, in *runtimev1pb.RegisterActorReminderRequest) (*emptypb.Empty, error) {
|
||||
if a.actor == nil {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorRuntimeNotFound)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := &actors.CreateReminderRequest{
|
||||
|
@ -787,14 +787,14 @@ func (a *api) RegisterActorReminder(ctx context.Context, in *runtimev1pb.Registe
|
|||
req.Data = in.Data
|
||||
}
|
||||
err := a.actor.CreateReminder(ctx, req)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
func (a *api) UnregisterActorReminder(ctx context.Context, in *runtimev1pb.UnregisterActorReminderRequest) (*empty.Empty, error) {
|
||||
func (a *api) UnregisterActorReminder(ctx context.Context, in *runtimev1pb.UnregisterActorReminderRequest) (*emptypb.Empty, error) {
|
||||
if a.actor == nil {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorRuntimeNotFound)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := &actors.DeleteReminderRequest{
|
||||
|
@ -804,7 +804,7 @@ func (a *api) UnregisterActorReminder(ctx context.Context, in *runtimev1pb.Unreg
|
|||
}
|
||||
|
||||
err := a.actor.DeleteReminder(ctx, req)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
func (a *api) GetActorState(ctx context.Context, in *runtimev1pb.GetActorStateRequest) (*runtimev1pb.GetActorStateResponse, error) {
|
||||
|
@ -847,11 +847,11 @@ func (a *api) GetActorState(ctx context.Context, in *runtimev1pb.GetActorStateRe
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (a *api) ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteActorStateTransactionRequest) (*empty.Empty, error) {
|
||||
func (a *api) ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteActorStateTransactionRequest) (*emptypb.Empty, error) {
|
||||
if a.actor == nil {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorRuntimeNotFound)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
actorType := in.ActorType
|
||||
|
@ -886,7 +886,7 @@ func (a *api) ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.
|
|||
default:
|
||||
err := status.Errorf(codes.Unimplemented, messages.ErrNotSupportedStateOperation, op.OperationType)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
actorOps = append(actorOps, actorOp)
|
||||
|
@ -900,7 +900,7 @@ func (a *api) ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.
|
|||
if !hosted {
|
||||
err := status.Errorf(codes.Internal, messages.ErrActorInstanceMissing)
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
req := actors.TransactionalRequest{
|
||||
|
@ -913,10 +913,10 @@ func (a *api) ExecuteActorStateTransaction(ctx context.Context, in *runtimev1pb.
|
|||
if err != nil {
|
||||
err = status.Errorf(codes.Internal, fmt.Sprintf(messages.ErrActorStateTransactionSave, err))
|
||||
apiServerLogger.Debug(err)
|
||||
return &empty.Empty{}, err
|
||||
return &emptypb.Empty{}, err
|
||||
}
|
||||
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (a *api) InvokeActor(ctx context.Context, in *runtimev1pb.InvokeActorRequest) (*runtimev1pb.InvokeActorResponse, error) {
|
||||
|
@ -981,7 +981,7 @@ func (a *api) SetActorRuntime(actor actors.Actors) {
|
|||
a.actor = actor
|
||||
}
|
||||
|
||||
func (a *api) GetMetadata(ctx context.Context, in *empty.Empty) (*runtimev1pb.GetMetadataResponse, error) {
|
||||
func (a *api) GetMetadata(ctx context.Context, in *emptypb.Empty) (*runtimev1pb.GetMetadataResponse, error) {
|
||||
temp := make(map[string]string)
|
||||
|
||||
// Copy synchronously so it can be serialized to JSON.
|
||||
|
@ -1007,7 +1007,7 @@ func (a *api) GetMetadata(ctx context.Context, in *empty.Empty) (*runtimev1pb.Ge
|
|||
}
|
||||
|
||||
// Sets value in extended metadata of the sidecar
|
||||
func (a *api) SetMetadata(ctx context.Context, in *runtimev1pb.SetMetadataRequest) (*empty.Empty, error) {
|
||||
func (a *api) SetMetadata(ctx context.Context, in *runtimev1pb.SetMetadataRequest) (*emptypb.Empty, error) {
|
||||
a.extendedMetadata.Store(in.Key, in.Value)
|
||||
return &empty.Empty{}, nil
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ import (
|
|||
"github.com/dapr/dapr/pkg/actors"
|
||||
runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
daprt "github.com/dapr/dapr/pkg/testing"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/phayes/freeport"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
func TestRegisterActorReminder(t *testing.T) {
|
||||
|
@ -193,7 +193,7 @@ func TestExecuteActorStateTransaction(t *testing.T) {
|
|||
{
|
||||
OperationType: "upsert",
|
||||
Key: "key1",
|
||||
Value: &any.Any{Value: data},
|
||||
Value: &anypb.Any{Value: data},
|
||||
},
|
||||
{
|
||||
OperationType: "delete",
|
||||
|
|
|
@ -32,10 +32,6 @@ import (
|
|||
runtime_pubsub "github.com/dapr/dapr/pkg/runtime/pubsub"
|
||||
daprt "github.com/dapr/dapr/pkg/testing"
|
||||
testtrace "github.com/dapr/dapr/pkg/testing/trace"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"github.com/phayes/freeport"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -46,6 +42,9 @@ import (
|
|||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
const maxGRPCServerUptime = 100 * time.Millisecond
|
||||
|
@ -65,8 +64,8 @@ func (m *mockGRPCAPI) CallActor(ctx context.Context, in *internalv1pb.InternalIn
|
|||
return resp.Proto(), nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*empty.Empty, error) {
|
||||
return &empty.Empty{}, nil
|
||||
func (m *mockGRPCAPI) PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*emptypb.Empty, error) {
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) InvokeService(ctx context.Context, in *runtimev1pb.InvokeServiceRequest) (*commonv1pb.InvokeResponse, error) {
|
||||
|
@ -85,24 +84,24 @@ func (m *mockGRPCAPI) GetBulkState(ctx context.Context, in *runtimev1pb.GetBulkS
|
|||
return &runtimev1pb.GetBulkStateResponse{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*empty.Empty, error) {
|
||||
return &empty.Empty{}, nil
|
||||
func (m *mockGRPCAPI) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*emptypb.Empty, error) {
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*empty.Empty, error) {
|
||||
return &empty.Empty{}, nil
|
||||
func (m *mockGRPCAPI) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*emptypb.Empty, error) {
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) GetSecret(ctx context.Context, in *runtimev1pb.GetSecretRequest) (*runtimev1pb.GetSecretResponse, error) {
|
||||
return &runtimev1pb.GetSecretResponse{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*empty.Empty, error) {
|
||||
return &empty.Empty{}, nil
|
||||
func (m *mockGRPCAPI) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*emptypb.Empty, error) {
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func (m *mockGRPCAPI) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*empty.Empty, error) {
|
||||
return &empty.Empty{}, nil
|
||||
func (m *mockGRPCAPI) RegisterActorTimer(ctx context.Context, in *runtimev1pb.RegisterActorTimerRequest) (*emptypb.Empty, error) {
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
func ExtractSpanContext(ctx context.Context) []byte {
|
||||
|
@ -310,10 +309,10 @@ func TestCallLocal(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func mustMarshalAny(msg proto.Message) *any.Any {
|
||||
any, err := ptypes.MarshalAny(msg)
|
||||
func mustMarshalAny(msg proto.Message) *anypb.Any {
|
||||
any, err := anypb.New(msg)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("ptypes.MarshalAny(%+v) failed: %v", msg, err))
|
||||
panic(fmt.Sprintf("anypb.New((%+v) failed: %v", msg, err))
|
||||
}
|
||||
return any
|
||||
}
|
||||
|
@ -355,7 +354,7 @@ func TestAPIToken(t *testing.T) {
|
|||
Id: "fakeAppID",
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "fakeMethod",
|
||||
Data: &any.Any{Value: []byte("testData")},
|
||||
Data: &anypb.Any{Value: []byte("testData")},
|
||||
},
|
||||
}
|
||||
md := metadata.Pairs("dapr-api-token", token)
|
||||
|
@ -403,7 +402,7 @@ func TestAPIToken(t *testing.T) {
|
|||
Id: "fakeAppID",
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "fakeMethod",
|
||||
Data: &any.Any{Value: []byte("testData")},
|
||||
Data: &anypb.Any{Value: []byte("testData")},
|
||||
},
|
||||
}
|
||||
md := metadata.Pairs("dapr-api-token", "4567")
|
||||
|
@ -445,7 +444,7 @@ func TestAPIToken(t *testing.T) {
|
|||
Id: "fakeAppID",
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "fakeMethod",
|
||||
Data: &any.Any{Value: []byte("testData")},
|
||||
Data: &anypb.Any{Value: []byte("testData")},
|
||||
},
|
||||
}
|
||||
_, err := client.InvokeService(context.Background(), req)
|
||||
|
@ -536,7 +535,7 @@ func TestInvokeServiceFromHTTPResponse(t *testing.T) {
|
|||
Id: "fakeAppID",
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "fakeMethod",
|
||||
Data: &any.Any{Value: []byte("testData")},
|
||||
Data: &anypb.Any{Value: []byte("testData")},
|
||||
},
|
||||
}
|
||||
var header metadata.MD
|
||||
|
@ -573,7 +572,7 @@ func TestInvokeServiceFromGRPCResponse(t *testing.T) {
|
|||
t.Run("handle grpc response code", func(t *testing.T) {
|
||||
fakeResp := invokev1.NewInvokeMethodResponse(
|
||||
int32(codes.Unimplemented), "Unimplemented",
|
||||
[]*any.Any{
|
||||
[]*anypb.Any{
|
||||
mustMarshalAny(&epb.ResourceInfo{
|
||||
ResourceType: "sidecar",
|
||||
ResourceName: "invoke/service",
|
||||
|
@ -605,7 +604,7 @@ func TestInvokeServiceFromGRPCResponse(t *testing.T) {
|
|||
Id: "fakeAppID",
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "fakeMethod",
|
||||
Data: &any.Any{Value: []byte("testData")},
|
||||
Data: &anypb.Any{Value: []byte("testData")},
|
||||
},
|
||||
}
|
||||
_, err := client.InvokeService(context.Background(), req)
|
||||
|
@ -1453,7 +1452,7 @@ func TestGetMetadata(t *testing.T) {
|
|||
defer clientConn.Close()
|
||||
|
||||
client := runtimev1pb.NewDaprClient(clientConn)
|
||||
response, err := client.GetMetadata(context.Background(), &empty.Empty{})
|
||||
response, err := client.GetMetadata(context.Background(), &emptypb.Empty{})
|
||||
assert.NoError(t, err, "Expected no error")
|
||||
assert.Len(t, response.RegisteredComponents, 1, "One component should be returned")
|
||||
assert.Equal(t, response.RegisteredComponents[0].Name, "testComponent")
|
||||
|
|
|
@ -12,8 +12,8 @@ import (
|
|||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
internalv1pb "github.com/dapr/dapr/pkg/proto/internals/v1"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/valyala/fasthttp"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -87,7 +87,7 @@ func (imr *InvokeMethodRequest) WithRawData(data []byte, contentType string) *In
|
|||
contentType = JSONContentType
|
||||
}
|
||||
imr.r.Message.ContentType = contentType
|
||||
imr.r.Message.Data = &any.Any{Value: data}
|
||||
imr.r.Message.Data = &anypb.Any{Value: data}
|
||||
return imr
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ import (
|
|||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
internalv1pb "github.com/dapr/dapr/pkg/proto/internals/v1"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/valyala/fasthttp"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
func TestInvokeRequest(t *testing.T) {
|
||||
|
@ -35,7 +35,7 @@ func TestInternalInvokeRequest(t *testing.T) {
|
|||
m := &commonv1pb.InvokeRequest{
|
||||
Method: "invoketest",
|
||||
ContentType: "application/json",
|
||||
Data: &any.Any{Value: []byte("test")},
|
||||
Data: &anypb.Any{Value: []byte("test")},
|
||||
}
|
||||
pb := internalv1pb.InternalInvokeRequest{
|
||||
Ver: internalv1pb.APIVersion_V1,
|
||||
|
@ -111,7 +111,7 @@ func TestData(t *testing.T) {
|
|||
|
||||
t.Run("typeurl is set but content_type is unset", func(t *testing.T) {
|
||||
resp := NewInvokeMethodRequest("test_method")
|
||||
resp.r.Message.Data = &any.Any{TypeUrl: "fake", Value: []byte("fake")}
|
||||
resp.r.Message.Data = &anypb.Any{TypeUrl: "fake", Value: []byte("fake")}
|
||||
contentType, bData := resp.RawData()
|
||||
assert.Equal(t, "", contentType)
|
||||
assert.Equal(t, []byte("fake"), bData)
|
||||
|
@ -136,7 +136,7 @@ func TestProto(t *testing.T) {
|
|||
m := &commonv1pb.InvokeRequest{
|
||||
Method: "invoketest",
|
||||
ContentType: "application/json",
|
||||
Data: &any.Any{Value: []byte("test")},
|
||||
Data: &anypb.Any{Value: []byte("test")},
|
||||
}
|
||||
pb := internalv1pb.InternalInvokeRequest{
|
||||
Ver: internalv1pb.APIVersion_V1,
|
||||
|
|
|
@ -8,9 +8,9 @@ package v1
|
|||
import (
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
internalv1pb "github.com/dapr/dapr/pkg/proto/internals/v1"
|
||||
any "github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/valyala/fasthttp"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// InvokeMethodResponse holds InternalInvokeResponse protobuf message
|
||||
|
@ -20,7 +20,7 @@ type InvokeMethodResponse struct {
|
|||
}
|
||||
|
||||
// NewInvokeMethodResponse returns new InvokeMethodResponse object with status
|
||||
func NewInvokeMethodResponse(statusCode int32, statusMessage string, statusDetails []*any.Any) *InvokeMethodResponse {
|
||||
func NewInvokeMethodResponse(statusCode int32, statusMessage string, statusDetails []*anypb.Any) *InvokeMethodResponse {
|
||||
return &InvokeMethodResponse{
|
||||
r: &internalv1pb.InternalInvokeResponse{
|
||||
Status: &internalv1pb.Status{Code: statusCode, Message: statusMessage, Details: statusDetails},
|
||||
|
@ -33,7 +33,7 @@ func NewInvokeMethodResponse(statusCode int32, statusMessage string, statusDetai
|
|||
func InternalInvokeResponse(resp *internalv1pb.InternalInvokeResponse) (*InvokeMethodResponse, error) {
|
||||
rsp := &InvokeMethodResponse{r: resp}
|
||||
if resp.Message == nil {
|
||||
resp.Message = &commonv1pb.InvokeResponse{Data: &any.Any{Value: []byte{}}}
|
||||
resp.Message = &commonv1pb.InvokeResponse{Data: &anypb.Any{Value: []byte{}}}
|
||||
}
|
||||
|
||||
return rsp, nil
|
||||
|
@ -54,7 +54,7 @@ func (imr *InvokeMethodResponse) WithRawData(data []byte, contentType string) *I
|
|||
imr.r.Message.ContentType = contentType
|
||||
|
||||
// Clone data to prevent GC from deallocating data
|
||||
imr.r.Message.Data = &any.Any{Value: cloneBytes(data)}
|
||||
imr.r.Message.Data = &anypb.Any{Value: cloneBytes(data)}
|
||||
|
||||
return imr
|
||||
}
|
||||
|
|
|
@ -11,10 +11,10 @@ import (
|
|||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
internalv1pb "github.com/dapr/dapr/pkg/proto/internals/v1"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/valyala/fasthttp"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
func TestInvocationResponse(t *testing.T) {
|
||||
|
@ -28,7 +28,7 @@ func TestInvocationResponse(t *testing.T) {
|
|||
func TestInternalInvocationResponse(t *testing.T) {
|
||||
t.Run("valid internal invoke response", func(t *testing.T) {
|
||||
m := &commonv1pb.InvokeResponse{
|
||||
Data: &any.Any{Value: []byte("response")},
|
||||
Data: &anypb.Any{Value: []byte("response")},
|
||||
ContentType: "application/json",
|
||||
}
|
||||
pb := internalv1pb.InternalInvokeResponse{
|
||||
|
@ -74,7 +74,7 @@ func TestResponseData(t *testing.T) {
|
|||
|
||||
t.Run("typeurl is set but content_type is unset", func(t *testing.T) {
|
||||
resp := NewInvokeMethodResponse(0, "OK", nil)
|
||||
resp.r.Message.Data = &any.Any{TypeUrl: "fake", Value: []byte("fake")}
|
||||
resp.r.Message.Data = &anypb.Any{TypeUrl: "fake", Value: []byte("fake")}
|
||||
contentType, bData := resp.RawData()
|
||||
assert.Equal(t, "", contentType)
|
||||
assert.Equal(t, []byte("fake"), bData)
|
||||
|
|
|
@ -17,9 +17,9 @@ import (
|
|||
dapr_credentials "github.com/dapr/dapr/pkg/credentials"
|
||||
"github.com/dapr/dapr/pkg/logger"
|
||||
operatorv1pb "github.com/dapr/dapr/pkg/proto/operator/v1"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
@ -88,7 +88,7 @@ func (a *apiServer) GetConfiguration(ctx context.Context, in *operatorv1pb.GetCo
|
|||
}
|
||||
|
||||
// GetComponents returns a list of Dapr components
|
||||
func (a *apiServer) ListComponents(ctx context.Context, in *empty.Empty) (*operatorv1pb.ListComponentResponse, error) {
|
||||
func (a *apiServer) ListComponents(ctx context.Context, in *emptypb.Empty) (*operatorv1pb.ListComponentResponse, error) {
|
||||
var components componentsapi.ComponentList
|
||||
if err := a.Client.List(ctx, &components); err != nil {
|
||||
return nil, errors.Wrap(err, "error getting components")
|
||||
|
@ -109,7 +109,7 @@ func (a *apiServer) ListComponents(ctx context.Context, in *empty.Empty) (*opera
|
|||
}
|
||||
|
||||
// ListSubscriptions returns a list of Dapr pub/sub subscriptions
|
||||
func (a *apiServer) ListSubscriptions(ctx context.Context, in *empty.Empty) (*operatorv1pb.ListSubscriptionsResponse, error) {
|
||||
func (a *apiServer) ListSubscriptions(ctx context.Context, in *emptypb.Empty) (*operatorv1pb.ListSubscriptionsResponse, error) {
|
||||
var subs subscriptionsapi.SubscriptionList
|
||||
if err := a.Client.List(ctx, &subs); err != nil {
|
||||
return nil, errors.Wrap(err, "error getting subscriptions")
|
||||
|
@ -130,7 +130,7 @@ func (a *apiServer) ListSubscriptions(ctx context.Context, in *empty.Empty) (*op
|
|||
}
|
||||
|
||||
// ComponentUpdate updates Dapr sidecars whenever a component in the cluster is modified
|
||||
func (a *apiServer) ComponentUpdate(in *empty.Empty, srv operatorv1pb.Operator_ComponentUpdateServer) error {
|
||||
func (a *apiServer) ComponentUpdate(in *emptypb.Empty, srv operatorv1pb.Operator_ComponentUpdateServer) error {
|
||||
log.Info("sidecar connected for component updates")
|
||||
|
||||
for c := range a.updateChan {
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/common/v1/common.proto
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
any "github.com/golang/protobuf/ptypes/any"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -276,7 +276,7 @@ type InvokeRequest struct {
|
|||
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
|
||||
// Required. Bytes value or Protobuf message which caller sent.
|
||||
// Dapr treats Any.value as bytes type if Any.type_url is unset.
|
||||
Data *any.Any `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Data *anypb.Any `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
// The type of data content.
|
||||
//
|
||||
// This field is required if data delivers http request body
|
||||
|
@ -328,7 +328,7 @@ func (x *InvokeRequest) GetMethod() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (x *InvokeRequest) GetData() *any.Any {
|
||||
func (x *InvokeRequest) GetData() *anypb.Any {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ type InvokeResponse struct {
|
|||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Required. The content body of InvokeService response.
|
||||
Data *any.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Data *anypb.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
// Required. The type of data content.
|
||||
ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ func (*InvokeResponse) Descriptor() ([]byte, []int) {
|
|||
return file_dapr_proto_common_v1_common_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *InvokeResponse) GetData() *any.Any {
|
||||
func (x *InvokeResponse) GetData() *anypb.Any {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ var file_dapr_proto_common_v1_common_proto_goTypes = []interface{}{
|
|||
(*StateOptions)(nil), // 8: dapr.proto.common.v1.StateOptions
|
||||
nil, // 9: dapr.proto.common.v1.HTTPExtension.QuerystringEntry
|
||||
nil, // 10: dapr.proto.common.v1.StateItem.MetadataEntry
|
||||
(*any.Any)(nil), // 11: google.protobuf.Any
|
||||
(*anypb.Any)(nil), // 11: google.protobuf.Any
|
||||
}
|
||||
var file_dapr_proto_common_v1_common_proto_depIdxs = []int32{
|
||||
0, // 0: dapr.proto.common.v1.HTTPExtension.verb:type_name -> dapr.proto.common.v1.HTTPExtension.Verb
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/internals/v1/apiversion.proto
|
||||
|
||||
package internals
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/internals/v1/service_invocation.proto
|
||||
|
||||
package internals
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/internals/v1/status.proto
|
||||
|
||||
package internals
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
any "github.com/golang/protobuf/ptypes/any"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -42,7 +42,7 @@ type Status struct {
|
|||
// Error message
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
// A list of messages that carry the error details
|
||||
Details []*any.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
|
||||
Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Status) Reset() {
|
||||
|
@ -91,7 +91,7 @@ func (x *Status) GetMessage() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (x *Status) GetDetails() []*any.Any {
|
||||
func (x *Status) GetDetails() []*anypb.Any {
|
||||
if x != nil {
|
||||
return x.Details
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ func file_dapr_proto_internals_v1_status_proto_rawDescGZIP() []byte {
|
|||
|
||||
var file_dapr_proto_internals_v1_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_dapr_proto_internals_v1_status_proto_goTypes = []interface{}{
|
||||
(*Status)(nil), // 0: dapr.proto.internals.v1.Status
|
||||
(*any.Any)(nil), // 1: google.protobuf.Any
|
||||
(*Status)(nil), // 0: dapr.proto.internals.v1.Status
|
||||
(*anypb.Any)(nil), // 1: google.protobuf.Any
|
||||
}
|
||||
var file_dapr_proto_internals_v1_status_proto_depIdxs = []int32{
|
||||
1, // 0: dapr.proto.internals.v1.Status.details:type_name -> google.protobuf.Any
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/operator/v1/operator.proto
|
||||
|
||||
package operator
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -359,7 +359,7 @@ var file_dapr_proto_operator_v1_operator_proto_goTypes = []interface{}{
|
|||
(*GetConfigurationRequest)(nil), // 2: dapr.proto.operator.v1.GetConfigurationRequest
|
||||
(*GetConfigurationResponse)(nil), // 3: dapr.proto.operator.v1.GetConfigurationResponse
|
||||
(*ListSubscriptionsResponse)(nil), // 4: dapr.proto.operator.v1.ListSubscriptionsResponse
|
||||
(*empty.Empty)(nil), // 5: google.protobuf.Empty
|
||||
(*emptypb.Empty)(nil), // 5: google.protobuf.Empty
|
||||
}
|
||||
var file_dapr_proto_operator_v1_operator_proto_depIdxs = []int32{
|
||||
5, // 0: dapr.proto.operator.v1.Operator.ComponentUpdate:input_type -> google.protobuf.Empty
|
||||
|
|
|
@ -4,10 +4,10 @@ package operator
|
|||
|
||||
import (
|
||||
context "context"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
|
@ -20,13 +20,13 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type OperatorClient interface {
|
||||
// Sends events to Dapr sidecars upon component changes.
|
||||
ComponentUpdate(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Operator_ComponentUpdateClient, error)
|
||||
ComponentUpdate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Operator_ComponentUpdateClient, error)
|
||||
// Returns a list of available components
|
||||
ListComponents(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListComponentResponse, error)
|
||||
ListComponents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListComponentResponse, error)
|
||||
// Returns a given configuration by name
|
||||
GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error)
|
||||
// Returns a list of pub/sub subscriptions
|
||||
ListSubscriptions(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error)
|
||||
ListSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error)
|
||||
}
|
||||
|
||||
type operatorClient struct {
|
||||
|
@ -37,7 +37,7 @@ func NewOperatorClient(cc grpc.ClientConnInterface) OperatorClient {
|
|||
return &operatorClient{cc}
|
||||
}
|
||||
|
||||
func (c *operatorClient) ComponentUpdate(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Operator_ComponentUpdateClient, error) {
|
||||
func (c *operatorClient) ComponentUpdate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Operator_ComponentUpdateClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Operator_ServiceDesc.Streams[0], "/dapr.proto.operator.v1.Operator/ComponentUpdate", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -69,7 +69,7 @@ func (x *operatorComponentUpdateClient) Recv() (*ComponentUpdateEvent, error) {
|
|||
return m, nil
|
||||
}
|
||||
|
||||
func (c *operatorClient) ListComponents(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListComponentResponse, error) {
|
||||
func (c *operatorClient) ListComponents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListComponentResponse, error) {
|
||||
out := new(ListComponentResponse)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.operator.v1.Operator/ListComponents", in, out, opts...)
|
||||
if err != nil {
|
||||
|
@ -87,7 +87,7 @@ func (c *operatorClient) GetConfiguration(ctx context.Context, in *GetConfigurat
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *operatorClient) ListSubscriptions(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) {
|
||||
func (c *operatorClient) ListSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) {
|
||||
out := new(ListSubscriptionsResponse)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.operator.v1.Operator/ListSubscriptions", in, out, opts...)
|
||||
if err != nil {
|
||||
|
@ -101,29 +101,29 @@ func (c *operatorClient) ListSubscriptions(ctx context.Context, in *empty.Empty,
|
|||
// for forward compatibility
|
||||
type OperatorServer interface {
|
||||
// Sends events to Dapr sidecars upon component changes.
|
||||
ComponentUpdate(*empty.Empty, Operator_ComponentUpdateServer) error
|
||||
ComponentUpdate(*emptypb.Empty, Operator_ComponentUpdateServer) error
|
||||
// Returns a list of available components
|
||||
ListComponents(context.Context, *empty.Empty) (*ListComponentResponse, error)
|
||||
ListComponents(context.Context, *emptypb.Empty) (*ListComponentResponse, error)
|
||||
// Returns a given configuration by name
|
||||
GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error)
|
||||
// Returns a list of pub/sub subscriptions
|
||||
ListSubscriptions(context.Context, *empty.Empty) (*ListSubscriptionsResponse, error)
|
||||
ListSubscriptions(context.Context, *emptypb.Empty) (*ListSubscriptionsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedOperatorServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedOperatorServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedOperatorServer) ComponentUpdate(*empty.Empty, Operator_ComponentUpdateServer) error {
|
||||
func (UnimplementedOperatorServer) ComponentUpdate(*emptypb.Empty, Operator_ComponentUpdateServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method ComponentUpdate not implemented")
|
||||
}
|
||||
func (UnimplementedOperatorServer) ListComponents(context.Context, *empty.Empty) (*ListComponentResponse, error) {
|
||||
func (UnimplementedOperatorServer) ListComponents(context.Context, *emptypb.Empty) (*ListComponentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListComponents not implemented")
|
||||
}
|
||||
func (UnimplementedOperatorServer) GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented")
|
||||
}
|
||||
func (UnimplementedOperatorServer) ListSubscriptions(context.Context, *empty.Empty) (*ListSubscriptionsResponse, error) {
|
||||
func (UnimplementedOperatorServer) ListSubscriptions(context.Context, *emptypb.Empty) (*ListSubscriptionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSubscriptions not implemented")
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ func RegisterOperatorServer(s grpc.ServiceRegistrar, srv OperatorServer) {
|
|||
}
|
||||
|
||||
func _Operator_ComponentUpdate_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(empty.Empty)
|
||||
m := new(emptypb.Empty)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ func (x *operatorComponentUpdateServer) Send(m *ComponentUpdateEvent) error {
|
|||
}
|
||||
|
||||
func _Operator_ListComponents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ func _Operator_ListComponents_Handler(srv interface{}, ctx context.Context, dec
|
|||
FullMethod: "/dapr.proto.operator.v1.Operator/ListComponents",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OperatorServer).ListComponents(ctx, req.(*empty.Empty))
|
||||
return srv.(OperatorServer).ListComponents(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ func _Operator_GetConfiguration_Handler(srv interface{}, ctx context.Context, de
|
|||
}
|
||||
|
||||
func _Operator_ListSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ func _Operator_ListSubscriptions_Handler(srv interface{}, ctx context.Context, d
|
|||
FullMethod: "/dapr.proto.operator.v1.Operator/ListSubscriptions",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OperatorServer).ListSubscriptions(ctx, req.(*empty.Empty))
|
||||
return srv.(OperatorServer).ListSubscriptions(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/placement/v1/placement.proto
|
||||
|
||||
package placement
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/runtime/v1/appcallback.proto
|
||||
|
||||
package runtime
|
||||
|
@ -14,9 +14,9 @@ package runtime
|
|||
import (
|
||||
v1 "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -786,7 +786,7 @@ var file_dapr_proto_runtime_v1_appcallback_proto_goTypes = []interface{}{
|
|||
nil, // 10: dapr.proto.runtime.v1.TopicSubscription.MetadataEntry
|
||||
(*v1.StateItem)(nil), // 11: dapr.proto.common.v1.StateItem
|
||||
(*v1.InvokeRequest)(nil), // 12: dapr.proto.common.v1.InvokeRequest
|
||||
(*empty.Empty)(nil), // 13: google.protobuf.Empty
|
||||
(*emptypb.Empty)(nil), // 13: google.protobuf.Empty
|
||||
(*v1.InvokeResponse)(nil), // 14: dapr.proto.common.v1.InvokeResponse
|
||||
}
|
||||
var file_dapr_proto_runtime_v1_appcallback_proto_depIdxs = []int32{
|
||||
|
|
|
@ -5,10 +5,10 @@ package runtime
|
|||
import (
|
||||
context "context"
|
||||
v1 "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
|
@ -23,11 +23,11 @@ type AppCallbackClient interface {
|
|||
// Invokes service method with InvokeRequest.
|
||||
OnInvoke(ctx context.Context, in *v1.InvokeRequest, opts ...grpc.CallOption) (*v1.InvokeResponse, error)
|
||||
// Lists all topics subscribed by this app.
|
||||
ListTopicSubscriptions(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error)
|
||||
ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error)
|
||||
// Subscribes events from Pubsub
|
||||
OnTopicEvent(ctx context.Context, in *TopicEventRequest, opts ...grpc.CallOption) (*TopicEventResponse, error)
|
||||
// Lists all input bindings subscribed by this app.
|
||||
ListInputBindings(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListInputBindingsResponse, error)
|
||||
ListInputBindings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListInputBindingsResponse, error)
|
||||
// Listens events from the input bindings
|
||||
//
|
||||
// User application can save the states or send the events to the output
|
||||
|
@ -52,7 +52,7 @@ func (c *appCallbackClient) OnInvoke(ctx context.Context, in *v1.InvokeRequest,
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *appCallbackClient) ListTopicSubscriptions(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) {
|
||||
func (c *appCallbackClient) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) {
|
||||
out := new(ListTopicSubscriptionsResponse)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.AppCallback/ListTopicSubscriptions", in, out, opts...)
|
||||
if err != nil {
|
||||
|
@ -70,7 +70,7 @@ func (c *appCallbackClient) OnTopicEvent(ctx context.Context, in *TopicEventRequ
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *appCallbackClient) ListInputBindings(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListInputBindingsResponse, error) {
|
||||
func (c *appCallbackClient) ListInputBindings(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListInputBindingsResponse, error) {
|
||||
out := new(ListInputBindingsResponse)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.AppCallback/ListInputBindings", in, out, opts...)
|
||||
if err != nil {
|
||||
|
@ -95,11 +95,11 @@ type AppCallbackServer interface {
|
|||
// Invokes service method with InvokeRequest.
|
||||
OnInvoke(context.Context, *v1.InvokeRequest) (*v1.InvokeResponse, error)
|
||||
// Lists all topics subscribed by this app.
|
||||
ListTopicSubscriptions(context.Context, *empty.Empty) (*ListTopicSubscriptionsResponse, error)
|
||||
ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error)
|
||||
// Subscribes events from Pubsub
|
||||
OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error)
|
||||
// Lists all input bindings subscribed by this app.
|
||||
ListInputBindings(context.Context, *empty.Empty) (*ListInputBindingsResponse, error)
|
||||
ListInputBindings(context.Context, *emptypb.Empty) (*ListInputBindingsResponse, error)
|
||||
// Listens events from the input bindings
|
||||
//
|
||||
// User application can save the states or send the events to the output
|
||||
|
@ -114,13 +114,13 @@ type UnimplementedAppCallbackServer struct {
|
|||
func (UnimplementedAppCallbackServer) OnInvoke(context.Context, *v1.InvokeRequest) (*v1.InvokeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnInvoke not implemented")
|
||||
}
|
||||
func (UnimplementedAppCallbackServer) ListTopicSubscriptions(context.Context, *empty.Empty) (*ListTopicSubscriptionsResponse, error) {
|
||||
func (UnimplementedAppCallbackServer) ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListTopicSubscriptions not implemented")
|
||||
}
|
||||
func (UnimplementedAppCallbackServer) OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnTopicEvent not implemented")
|
||||
}
|
||||
func (UnimplementedAppCallbackServer) ListInputBindings(context.Context, *empty.Empty) (*ListInputBindingsResponse, error) {
|
||||
func (UnimplementedAppCallbackServer) ListInputBindings(context.Context, *emptypb.Empty) (*ListInputBindingsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListInputBindings not implemented")
|
||||
}
|
||||
func (UnimplementedAppCallbackServer) OnBindingEvent(context.Context, *BindingEventRequest) (*BindingEventResponse, error) {
|
||||
|
@ -157,7 +157,7 @@ func _AppCallback_OnInvoke_Handler(srv interface{}, ctx context.Context, dec fun
|
|||
}
|
||||
|
||||
func _AppCallback_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ func _AppCallback_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Co
|
|||
FullMethod: "/dapr.proto.runtime.v1.AppCallback/ListTopicSubscriptions",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, req.(*empty.Empty))
|
||||
return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ func _AppCallback_OnTopicEvent_Handler(srv interface{}, ctx context.Context, dec
|
|||
}
|
||||
|
||||
func _AppCallback_ListInputBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ func _AppCallback_ListInputBindings_Handler(srv interface{}, ctx context.Context
|
|||
FullMethod: "/dapr.proto.runtime.v1.AppCallback/ListInputBindings",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AppCallbackServer).ListInputBindings(ctx, req.(*empty.Empty))
|
||||
return srv.(AppCallbackServer).ListInputBindings(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,10 +5,10 @@ package runtime
|
|||
import (
|
||||
context "context"
|
||||
v1 "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
|
@ -27,13 +27,13 @@ type DaprClient interface {
|
|||
// Gets a bulk of state items for a list of keys
|
||||
GetBulkState(ctx context.Context, in *GetBulkStateRequest, opts ...grpc.CallOption) (*GetBulkStateResponse, error)
|
||||
// Saves the state for a specific key.
|
||||
SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Deletes the state for a specific key.
|
||||
DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Executes transactions for a specified store
|
||||
ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Publishes events to the specific topic.
|
||||
PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Invokes binding data to specific output bindings
|
||||
InvokeBinding(ctx context.Context, in *InvokeBindingRequest, opts ...grpc.CallOption) (*InvokeBindingResponse, error)
|
||||
// Gets secrets from secret stores.
|
||||
|
@ -41,23 +41,23 @@ type DaprClient interface {
|
|||
// Gets a bulk of secrets
|
||||
GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest, opts ...grpc.CallOption) (*GetBulkSecretResponse, error)
|
||||
// Register an actor timer.
|
||||
RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Unregister an actor timer.
|
||||
UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Register an actor reminder.
|
||||
RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Unregister an actor reminder.
|
||||
UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Gets the state for a specific actor.
|
||||
GetActorState(ctx context.Context, in *GetActorStateRequest, opts ...grpc.CallOption) (*GetActorStateResponse, error)
|
||||
// Executes state transactions for a specified actor
|
||||
ExecuteActorStateTransaction(ctx context.Context, in *ExecuteActorStateTransactionRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
ExecuteActorStateTransaction(ctx context.Context, in *ExecuteActorStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// InvokeActor calls a method on an actor.
|
||||
InvokeActor(ctx context.Context, in *InvokeActorRequest, opts ...grpc.CallOption) (*InvokeActorResponse, error)
|
||||
// Gets metadata of the sidecar
|
||||
GetMetadata(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetMetadataResponse, error)
|
||||
GetMetadata(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMetadataResponse, error)
|
||||
// Sets value in extended metadata of the sidecar
|
||||
SetMetadata(ctx context.Context, in *SetMetadataRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||
SetMetadata(ctx context.Context, in *SetMetadataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type daprClient struct {
|
||||
|
@ -95,8 +95,8 @@ func (c *daprClient) GetBulkState(ctx context.Context, in *GetBulkStateRequest,
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/SaveState", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -104,8 +104,8 @@ func (c *daprClient) SaveState(ctx context.Context, in *SaveStateRequest, opts .
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/DeleteState", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -113,8 +113,8 @@ func (c *daprClient) DeleteState(ctx context.Context, in *DeleteStateRequest, op
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/ExecuteStateTransaction", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -122,8 +122,8 @@ func (c *daprClient) ExecuteStateTransaction(ctx context.Context, in *ExecuteSta
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/PublishEvent", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -158,8 +158,8 @@ func (c *daprClient) GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/RegisterActorTimer", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -167,8 +167,8 @@ func (c *daprClient) RegisterActorTimer(ctx context.Context, in *RegisterActorTi
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/UnregisterActorTimer", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -176,8 +176,8 @@ func (c *daprClient) UnregisterActorTimer(ctx context.Context, in *UnregisterAct
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/RegisterActorReminder", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -185,8 +185,8 @@ func (c *daprClient) RegisterActorReminder(ctx context.Context, in *RegisterActo
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/UnregisterActorReminder", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -203,8 +203,8 @@ func (c *daprClient) GetActorState(ctx context.Context, in *GetActorStateRequest
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) ExecuteActorStateTransaction(ctx context.Context, in *ExecuteActorStateTransactionRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) ExecuteActorStateTransaction(ctx context.Context, in *ExecuteActorStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/ExecuteActorStateTransaction", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -221,7 +221,7 @@ func (c *daprClient) InvokeActor(ctx context.Context, in *InvokeActorRequest, op
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) GetMetadata(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetMetadataResponse, error) {
|
||||
func (c *daprClient) GetMetadata(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetMetadataResponse, error) {
|
||||
out := new(GetMetadataResponse)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/GetMetadata", in, out, opts...)
|
||||
if err != nil {
|
||||
|
@ -230,8 +230,8 @@ func (c *daprClient) GetMetadata(ctx context.Context, in *empty.Empty, opts ...g
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *daprClient) SetMetadata(ctx context.Context, in *SetMetadataRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||
out := new(empty.Empty)
|
||||
func (c *daprClient) SetMetadata(ctx context.Context, in *SetMetadataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/dapr.proto.runtime.v1.Dapr/SetMetadata", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -250,13 +250,13 @@ type DaprServer interface {
|
|||
// Gets a bulk of state items for a list of keys
|
||||
GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error)
|
||||
// Saves the state for a specific key.
|
||||
SaveState(context.Context, *SaveStateRequest) (*empty.Empty, error)
|
||||
SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error)
|
||||
// Deletes the state for a specific key.
|
||||
DeleteState(context.Context, *DeleteStateRequest) (*empty.Empty, error)
|
||||
DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error)
|
||||
// Executes transactions for a specified store
|
||||
ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*empty.Empty, error)
|
||||
ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error)
|
||||
// Publishes events to the specific topic.
|
||||
PublishEvent(context.Context, *PublishEventRequest) (*empty.Empty, error)
|
||||
PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error)
|
||||
// Invokes binding data to specific output bindings
|
||||
InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error)
|
||||
// Gets secrets from secret stores.
|
||||
|
@ -264,23 +264,23 @@ type DaprServer interface {
|
|||
// Gets a bulk of secrets
|
||||
GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error)
|
||||
// Register an actor timer.
|
||||
RegisterActorTimer(context.Context, *RegisterActorTimerRequest) (*empty.Empty, error)
|
||||
RegisterActorTimer(context.Context, *RegisterActorTimerRequest) (*emptypb.Empty, error)
|
||||
// Unregister an actor timer.
|
||||
UnregisterActorTimer(context.Context, *UnregisterActorTimerRequest) (*empty.Empty, error)
|
||||
UnregisterActorTimer(context.Context, *UnregisterActorTimerRequest) (*emptypb.Empty, error)
|
||||
// Register an actor reminder.
|
||||
RegisterActorReminder(context.Context, *RegisterActorReminderRequest) (*empty.Empty, error)
|
||||
RegisterActorReminder(context.Context, *RegisterActorReminderRequest) (*emptypb.Empty, error)
|
||||
// Unregister an actor reminder.
|
||||
UnregisterActorReminder(context.Context, *UnregisterActorReminderRequest) (*empty.Empty, error)
|
||||
UnregisterActorReminder(context.Context, *UnregisterActorReminderRequest) (*emptypb.Empty, error)
|
||||
// Gets the state for a specific actor.
|
||||
GetActorState(context.Context, *GetActorStateRequest) (*GetActorStateResponse, error)
|
||||
// Executes state transactions for a specified actor
|
||||
ExecuteActorStateTransaction(context.Context, *ExecuteActorStateTransactionRequest) (*empty.Empty, error)
|
||||
ExecuteActorStateTransaction(context.Context, *ExecuteActorStateTransactionRequest) (*emptypb.Empty, error)
|
||||
// InvokeActor calls a method on an actor.
|
||||
InvokeActor(context.Context, *InvokeActorRequest) (*InvokeActorResponse, error)
|
||||
// Gets metadata of the sidecar
|
||||
GetMetadata(context.Context, *empty.Empty) (*GetMetadataResponse, error)
|
||||
GetMetadata(context.Context, *emptypb.Empty) (*GetMetadataResponse, error)
|
||||
// Sets value in extended metadata of the sidecar
|
||||
SetMetadata(context.Context, *SetMetadataRequest) (*empty.Empty, error)
|
||||
SetMetadata(context.Context, *SetMetadataRequest) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
// UnimplementedDaprServer should be embedded to have forward compatible implementations.
|
||||
|
@ -296,16 +296,16 @@ func (UnimplementedDaprServer) GetState(context.Context, *GetStateRequest) (*Get
|
|||
func (UnimplementedDaprServer) GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBulkState not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) SaveState(context.Context, *SaveStateRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SaveState not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) DeleteState(context.Context, *DeleteStateRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteState not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ExecuteStateTransaction not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) PublishEvent(context.Context, *PublishEventRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PublishEvent not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error) {
|
||||
|
@ -317,31 +317,31 @@ func (UnimplementedDaprServer) GetSecret(context.Context, *GetSecretRequest) (*G
|
|||
func (UnimplementedDaprServer) GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBulkSecret not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) RegisterActorTimer(context.Context, *RegisterActorTimerRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) RegisterActorTimer(context.Context, *RegisterActorTimerRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RegisterActorTimer not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) UnregisterActorTimer(context.Context, *UnregisterActorTimerRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) UnregisterActorTimer(context.Context, *UnregisterActorTimerRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnregisterActorTimer not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) RegisterActorReminder(context.Context, *RegisterActorReminderRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) RegisterActorReminder(context.Context, *RegisterActorReminderRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RegisterActorReminder not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) UnregisterActorReminder(context.Context, *UnregisterActorReminderRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) UnregisterActorReminder(context.Context, *UnregisterActorReminderRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnregisterActorReminder not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) GetActorState(context.Context, *GetActorStateRequest) (*GetActorStateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetActorState not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) ExecuteActorStateTransaction(context.Context, *ExecuteActorStateTransactionRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) ExecuteActorStateTransaction(context.Context, *ExecuteActorStateTransactionRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ExecuteActorStateTransaction not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) InvokeActor(context.Context, *InvokeActorRequest) (*InvokeActorResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InvokeActor not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) GetMetadata(context.Context, *empty.Empty) (*GetMetadataResponse, error) {
|
||||
func (UnimplementedDaprServer) GetMetadata(context.Context, *emptypb.Empty) (*GetMetadataResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMetadata not implemented")
|
||||
}
|
||||
func (UnimplementedDaprServer) SetMetadata(context.Context, *SetMetadataRequest) (*empty.Empty, error) {
|
||||
func (UnimplementedDaprServer) SetMetadata(context.Context, *SetMetadataRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetMetadata not implemented")
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ func _Dapr_InvokeActor_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||
}
|
||||
|
||||
func _Dapr_GetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ func _Dapr_GetMetadata_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||
FullMethod: "/dapr.proto.runtime.v1.Dapr/GetMetadata",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DaprServer).GetMetadata(ctx, req.(*empty.Empty))
|
||||
return srv.(DaprServer).GetMetadata(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.11.0
|
||||
// protoc v3.14.0
|
||||
// source: dapr/proto/sentry/v1/sentry.proto
|
||||
|
||||
package sentry
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -120,8 +120,8 @@ type SignCertificateResponse struct {
|
|||
WorkloadCertificate []byte `protobuf:"bytes,1,opt,name=workload_certificate,json=workloadCertificate,proto3" json:"workload_certificate,omitempty"`
|
||||
// A list of PEM-encoded x509 Certificates that establish the trust chain
|
||||
// between the workload certificate and the well-known trust root cert.
|
||||
TrustChainCertificates [][]byte `protobuf:"bytes,2,rep,name=trust_chain_certificates,json=trustChainCertificates,proto3" json:"trust_chain_certificates,omitempty"`
|
||||
ValidUntil *timestamp.Timestamp `protobuf:"bytes,3,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"`
|
||||
TrustChainCertificates [][]byte `protobuf:"bytes,2,rep,name=trust_chain_certificates,json=trustChainCertificates,proto3" json:"trust_chain_certificates,omitempty"`
|
||||
ValidUntil *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SignCertificateResponse) Reset() {
|
||||
|
@ -170,7 +170,7 @@ func (x *SignCertificateResponse) GetTrustChainCertificates() [][]byte {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (x *SignCertificateResponse) GetValidUntil() *timestamp.Timestamp {
|
||||
func (x *SignCertificateResponse) GetValidUntil() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.ValidUntil
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ var file_dapr_proto_sentry_v1_sentry_proto_msgTypes = make([]protoimpl.MessageIn
|
|||
var file_dapr_proto_sentry_v1_sentry_proto_goTypes = []interface{}{
|
||||
(*SignCertificateRequest)(nil), // 0: dapr.proto.sentry.v1.SignCertificateRequest
|
||||
(*SignCertificateResponse)(nil), // 1: dapr.proto.sentry.v1.SignCertificateResponse
|
||||
(*timestamp.Timestamp)(nil), // 2: google.protobuf.Timestamp
|
||||
(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
|
||||
}
|
||||
var file_dapr_proto_sentry_v1_sentry_proto_depIdxs = []int32{
|
||||
2, // 0: dapr.proto.sentry.v1.SignCertificateResponse.valid_until:type_name -> google.protobuf.Timestamp
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
operatorv1pb "github.com/dapr/dapr/pkg/proto/operator/v1"
|
||||
runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
"github.com/ghodss/yaml"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -70,7 +70,7 @@ func filterSubscriptions(subscriptions []Subscription, log logger.Logger) []Subs
|
|||
func GetSubscriptionsGRPC(channel runtimev1pb.AppCallbackClient, log logger.Logger) []Subscription {
|
||||
var subscriptions []Subscription
|
||||
|
||||
resp, err := channel.ListTopicSubscriptions(context.Background(), &empty.Empty{})
|
||||
resp, err := channel.ListTopicSubscriptions(context.Background(), &emptypb.Empty{})
|
||||
if err != nil {
|
||||
// Unexpected response: both GRPC and HTTP have to log the same level.
|
||||
log.Errorf(getTopicsError, err)
|
||||
|
@ -145,7 +145,7 @@ func marshalSubscription(b []byte) (*Subscription, error) {
|
|||
// DeclarativeKubernetes loads subscriptions from the operator when running in Kubernetes
|
||||
func DeclarativeKubernetes(client operatorv1pb.OperatorClient, log logger.Logger) []Subscription {
|
||||
var subs []Subscription
|
||||
resp, err := client.ListSubscriptions(context.TODO(), &empty.Empty{})
|
||||
resp, err := client.ListSubscriptions(context.TODO(), &emptypb.Empty{})
|
||||
if err != nil {
|
||||
log.Errorf("failed to list subscriptions from operator: %s", err)
|
||||
return subs
|
||||
|
|
|
@ -54,7 +54,6 @@ import (
|
|||
"github.com/dapr/dapr/pkg/runtime/security"
|
||||
"github.com/dapr/dapr/pkg/scopes"
|
||||
"github.com/dapr/dapr/utils"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/google/uuid"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
openzipkin "github.com/openzipkin/zipkin-go"
|
||||
|
@ -63,6 +62,7 @@ import (
|
|||
"go.opencensus.io/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
@ -472,7 +472,7 @@ func (a *DaprRuntime) beginComponentsUpdates() error {
|
|||
}
|
||||
|
||||
go func() {
|
||||
stream, err := a.operatorClient.ComponentUpdate(context.Background(), &empty.Empty{})
|
||||
stream, err := a.operatorClient.ComponentUpdate(context.Background(), &emptypb.Empty{})
|
||||
if err != nil {
|
||||
log.Errorf("error from operator stream: %s", err)
|
||||
return
|
||||
|
@ -740,7 +740,7 @@ func (a *DaprRuntime) getPublishAdapter() runtime_pubsub.Adapter {
|
|||
|
||||
func (a *DaprRuntime) getSubscribedBindingsGRPC() []string {
|
||||
client := runtimev1pb.NewAppCallbackClient(a.grpc.AppClient)
|
||||
resp, err := client.ListInputBindings(context.Background(), &empty.Empty{})
|
||||
resp, err := client.ListInputBindings(context.Background(), &emptypb.Empty{})
|
||||
bindings := []string{}
|
||||
|
||||
if err == nil && resp != nil {
|
||||
|
|
|
@ -12,7 +12,6 @@ import (
|
|||
dapr_credentials "github.com/dapr/dapr/pkg/credentials"
|
||||
diag "github.com/dapr/dapr/pkg/diagnostics"
|
||||
sentryv1pb "github.com/dapr/dapr/pkg/proto/sentry/v1"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -125,12 +124,12 @@ func (a *authenticator) CreateSignedWorkloadCert(id, namespace, trustDomain stri
|
|||
|
||||
workloadCert := resp.GetWorkloadCertificate()
|
||||
validTimestamp := resp.GetValidUntil()
|
||||
expiry, err := ptypes.Timestamp(validTimestamp)
|
||||
if err != nil {
|
||||
if err = validTimestamp.CheckValid(); err != nil {
|
||||
diag.DefaultMonitoring.MTLSWorkLoadCertRotationFailed("invalid_ts")
|
||||
return nil, errors.Wrap(err, "error parsing ValidUntil")
|
||||
}
|
||||
|
||||
expiry := validTimestamp.AsTime()
|
||||
trustChain := x509.NewCertPool()
|
||||
for _, c := range resp.GetTrustChainCertificates() {
|
||||
ok := trustChain.AppendCertsFromPEM(c)
|
||||
|
|
|
@ -14,10 +14,10 @@ import (
|
|||
"github.com/dapr/dapr/pkg/sentry/csr"
|
||||
"github.com/dapr/dapr/pkg/sentry/identity"
|
||||
"github.com/dapr/dapr/pkg/sentry/monitoring"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -173,8 +173,8 @@ func (s *server) SignCertificate(ctx context.Context, req *sentryv1pb.SignCertif
|
|||
return nil, err
|
||||
}
|
||||
|
||||
expiry, err := ptypes.TimestampProto(signed.Certificate.NotAfter)
|
||||
if err != nil {
|
||||
expiry := timestamppb.New(signed.Certificate.NotAfter)
|
||||
if err = expiry.CheckValid(); err != nil {
|
||||
return nil, errors.Wrap(err, "could not validate certificate validity")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ module app
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4
|
||||
github.com/gorilla/mux v1.7.3
|
||||
google.golang.org/grpc v1.34.0
|
||||
)
|
||||
|
|
|
@ -210,8 +210,8 @@ github.com/dancannon/gorethink v4.0.0+incompatible/go.mod h1:BLvkat9KmZc1efyYwhz
|
|||
github.com/dapr/components-contrib v0.0.0-20200219164914-5b75f4d0fbc6/go.mod h1:AZi8IGs8LFdywJg/YGwDs7MAxJkvGa8RgHN4NoJSKt0=
|
||||
github.com/dapr/components-contrib v1.0.0-rc2.0.20210120162831-5018196c58a0/go.mod h1:wmTSIgXHIqYeFCoCJDZTbDDw86ZqP/SeGbyp4ZKS+Y0=
|
||||
github.com/dapr/dapr v0.4.1-0.20200228055659-71892bc0111e/go.mod h1:c60DJ9TdSdpbLjgqP55A5u4ZCYChFwa9UGYIXd9pmm4=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d h1:9EXxpHSSQixEbSCamxMi/cCtaUEEnFgPcPiRNXSRH9Y=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4 h1:qi9lgJh6lAPBLF0UIGYpLy8OhJSFjiQoMB5equhFsqs=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/go-sdk v0.0.0-20200121181907-48249cda2fad/go.mod h1:yeOIFBz6+BigHpk4ASJbgQDVjQ8+00oCWrFyOAFdob8=
|
||||
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
|
@ -17,8 +17,8 @@ import (
|
|||
|
||||
"net"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
|
@ -94,7 +94,7 @@ func initializeSets() {
|
|||
func (s *server) OnInvoke(ctx context.Context, in *commonv1pb.InvokeRequest) (*commonv1pb.InvokeResponse, error) {
|
||||
log.Printf("Got invoked method %s\n", in.Method)
|
||||
|
||||
respBody := &any.Any{}
|
||||
respBody := &anypb.Any{}
|
||||
switch in.Method {
|
||||
case "getMessages":
|
||||
respBody.Value = s.getReceivedMessages()
|
||||
|
@ -154,7 +154,7 @@ func (s *server) setRespondWithInvalidStatus() {
|
|||
|
||||
// Dapr will call this method to get the list of topics the app wants to subscribe to. In this example, we are telling Dapr
|
||||
// To subscribe to a topic named TopicA
|
||||
func (s *server) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*pb.ListTopicSubscriptionsResponse, error) {
|
||||
func (s *server) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty) (*pb.ListTopicSubscriptionsResponse, error) {
|
||||
log.Println("List Topic Subscription called")
|
||||
return &pb.ListTopicSubscriptionsResponse{
|
||||
Subscriptions: []*pb.TopicSubscription{
|
||||
|
@ -230,7 +230,7 @@ func (s *server) OnTopicEvent(ctx context.Context, in *pb.TopicEventRequest) (*p
|
|||
|
||||
// Dapr will call this method 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 (s *server) ListInputBindings(ctx context.Context, in *empty.Empty) (*pb.ListInputBindingsResponse, error) {
|
||||
func (s *server) ListInputBindings(ctx context.Context, in *emptypb.Empty) (*pb.ListInputBindingsResponse, error) {
|
||||
log.Println("List Input Bindings called")
|
||||
return &pb.ListInputBindingsResponse{}, nil
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ import (
|
|||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
var httpMethods []string
|
||||
|
@ -229,7 +229,7 @@ func invokeServiceWithBodyHeader(remoteApp, method string, data []byte, headers
|
|||
func constructRequest(id, method, httpVerb string, body []byte) *runtimev1pb.InvokeServiceRequest {
|
||||
msg := &commonv1pb.InvokeRequest{Method: method}
|
||||
msg.ContentType = jsonContentType
|
||||
msg.Data = &any.Any{Value: body}
|
||||
msg.Data = &anypb.Any{Value: body}
|
||||
if httpVerb != "" {
|
||||
msg.HttpExtension = &commonv1pb.HTTPExtension{
|
||||
Verb: commonv1pb.HTTPExtension_Verb(commonv1pb.HTTPExtension_Verb_value[httpVerb]),
|
||||
|
@ -502,7 +502,7 @@ func testV1RequestGRPCToGRPC(w http.ResponseWriter, r *http.Request) {
|
|||
Id: commandBody.RemoteApp,
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "retrieve_request_object",
|
||||
Data: &any.Any{Value: []byte("GRPCToGRPCTest")},
|
||||
Data: &anypb.Any{Value: []byte("GRPCToGRPCTest")},
|
||||
ContentType: "text/plain; utf-8",
|
||||
},
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ func testV1RequestGRPCToHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
Id: commandBody.RemoteApp,
|
||||
Message: &commonv1pb.InvokeRequest{
|
||||
Method: "retrieve_request_object",
|
||||
Data: &any.Any{Value: []byte("GRPCToHTTPTest")},
|
||||
Data: &anypb.Any{Value: []byte("GRPCToHTTPTest")},
|
||||
ContentType: "text/plain; utf-8",
|
||||
HttpExtension: &commonv1pb.HTTPExtension{
|
||||
Verb: commonv1pb.HTTPExtension_POST,
|
||||
|
|
|
@ -3,11 +3,11 @@ module app
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d
|
||||
github.com/golang/protobuf v1.4.3
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4
|
||||
github.com/google/uuid v1.1.2
|
||||
github.com/gorilla/mux v1.7.3
|
||||
google.golang.org/grpc v1.33.1
|
||||
google.golang.org/protobuf v1.25.0
|
||||
)
|
||||
|
||||
replace k8s.io/client => github.com/kubernetes-client/go v0.0.0-20190928040339-c757968c4c36
|
||||
|
|
|
@ -209,8 +209,8 @@ github.com/dancannon/gorethink v4.0.0+incompatible/go.mod h1:BLvkat9KmZc1efyYwhz
|
|||
github.com/dapr/components-contrib v0.0.0-20200219164914-5b75f4d0fbc6/go.mod h1:AZi8IGs8LFdywJg/YGwDs7MAxJkvGa8RgHN4NoJSKt0=
|
||||
github.com/dapr/components-contrib v1.0.0-rc2.0.20210120162831-5018196c58a0/go.mod h1:wmTSIgXHIqYeFCoCJDZTbDDw86ZqP/SeGbyp4ZKS+Y0=
|
||||
github.com/dapr/dapr v0.4.1-0.20200228055659-71892bc0111e/go.mod h1:c60DJ9TdSdpbLjgqP55A5u4ZCYChFwa9UGYIXd9pmm4=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d h1:9EXxpHSSQixEbSCamxMi/cCtaUEEnFgPcPiRNXSRH9Y=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4 h1:qi9lgJh6lAPBLF0UIGYpLy8OhJSFjiQoMB5equhFsqs=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/go-sdk v0.0.0-20200121181907-48249cda2fad/go.mod h1:yeOIFBz6+BigHpk4ASJbgQDVjQ8+00oCWrFyOAFdob8=
|
||||
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
|
@ -14,10 +14,10 @@ import (
|
|||
|
||||
"net"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"go.opencensus.io/trace"
|
||||
"go.opencensus.io/trace/propagation"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
|
||||
commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
|
||||
pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
|
||||
|
@ -122,14 +122,14 @@ func (s *server) OnInvoke(ctx context.Context, in *commonv1pb.InvokeRequest) (*c
|
|||
response, _ = json.Marshal(msg)
|
||||
}
|
||||
|
||||
respBody := &any.Any{Value: response}
|
||||
respBody := &anypb.Any{Value: response}
|
||||
|
||||
return &commonv1pb.InvokeResponse{Data: respBody, ContentType: "application/json"}, nil
|
||||
}
|
||||
|
||||
// Dapr will call this method to get the list of topics the app wants to subscribe to. In this example, we are telling Dapr
|
||||
// To subscribe to a topic named TopicA
|
||||
func (s *server) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*pb.ListTopicSubscriptionsResponse, error) {
|
||||
func (s *server) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty) (*pb.ListTopicSubscriptionsResponse, error) {
|
||||
return &pb.ListTopicSubscriptionsResponse{
|
||||
Subscriptions: []*pb.TopicSubscription{
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ func (s *server) ListTopicSubscriptions(ctx context.Context, in *empty.Empty) (*
|
|||
|
||||
// Dapr will call this method 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 (s *server) ListInputBindings(ctx context.Context, in *empty.Empty) (*pb.ListInputBindingsResponse, error) {
|
||||
func (s *server) ListInputBindings(ctx context.Context, in *emptypb.Empty) (*pb.ListInputBindingsResponse, error) {
|
||||
return &pb.ListInputBindingsResponse{
|
||||
Bindings: []string{"storage"},
|
||||
}, nil
|
||||
|
|
|
@ -3,10 +3,10 @@ module app
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d
|
||||
github.com/golang/protobuf v1.4.3
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4
|
||||
go.opencensus.io v0.22.5
|
||||
google.golang.org/grpc v1.33.1
|
||||
google.golang.org/protobuf v1.25.0
|
||||
)
|
||||
|
||||
replace k8s.io/client => github.com/kubernetes-client/go v0.0.0-20190928040339-c757968c4c36
|
||||
|
|
|
@ -209,8 +209,8 @@ github.com/dancannon/gorethink v4.0.0+incompatible/go.mod h1:BLvkat9KmZc1efyYwhz
|
|||
github.com/dapr/components-contrib v0.0.0-20200219164914-5b75f4d0fbc6/go.mod h1:AZi8IGs8LFdywJg/YGwDs7MAxJkvGa8RgHN4NoJSKt0=
|
||||
github.com/dapr/components-contrib v1.0.0-rc2.0.20210120162831-5018196c58a0/go.mod h1:wmTSIgXHIqYeFCoCJDZTbDDw86ZqP/SeGbyp4ZKS+Y0=
|
||||
github.com/dapr/dapr v0.4.1-0.20200228055659-71892bc0111e/go.mod h1:c60DJ9TdSdpbLjgqP55A5u4ZCYChFwa9UGYIXd9pmm4=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d h1:9EXxpHSSQixEbSCamxMi/cCtaUEEnFgPcPiRNXSRH9Y=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4 h1:qi9lgJh6lAPBLF0UIGYpLy8OhJSFjiQoMB5equhFsqs=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/go-sdk v0.0.0-20200121181907-48249cda2fad/go.mod h1:yeOIFBz6+BigHpk4ASJbgQDVjQ8+00oCWrFyOAFdob8=
|
||||
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
|
@ -3,7 +3,7 @@ module app
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4
|
||||
github.com/gorilla/mux v1.7.3
|
||||
google.golang.org/grpc v1.33.1
|
||||
)
|
||||
|
|
|
@ -213,8 +213,8 @@ github.com/dancannon/gorethink v4.0.0+incompatible/go.mod h1:BLvkat9KmZc1efyYwhz
|
|||
github.com/dapr/components-contrib v0.0.0-20200219164914-5b75f4d0fbc6/go.mod h1:AZi8IGs8LFdywJg/YGwDs7MAxJkvGa8RgHN4NoJSKt0=
|
||||
github.com/dapr/components-contrib v1.0.0-rc2.0.20210120162831-5018196c58a0/go.mod h1:wmTSIgXHIqYeFCoCJDZTbDDw86ZqP/SeGbyp4ZKS+Y0=
|
||||
github.com/dapr/dapr v0.4.1-0.20200228055659-71892bc0111e/go.mod h1:c60DJ9TdSdpbLjgqP55A5u4ZCYChFwa9UGYIXd9pmm4=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d h1:9EXxpHSSQixEbSCamxMi/cCtaUEEnFgPcPiRNXSRH9Y=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210120190900-dfe7edb55c6d/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4 h1:qi9lgJh6lAPBLF0UIGYpLy8OhJSFjiQoMB5equhFsqs=
|
||||
github.com/dapr/dapr v1.0.0-rc.2.0.20210122073344-d48d25e83cf4/go.mod h1:hmLcngbeNvuVn6Ukj+ZGv825otjiYbvvlHgdoZbtlXg=
|
||||
github.com/dapr/go-sdk v0.0.0-20200121181907-48249cda2fad/go.mod h1:yeOIFBz6+BigHpk4ASJbgQDVjQ8+00oCWrFyOAFdob8=
|
||||
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
|
@ -7,7 +7,7 @@ appsdirName='apps'
|
|||
for appdir in * ; do
|
||||
if test -f "$appsroot/$appdir/go.mod"; then
|
||||
cd $appsroot/$appdir > /dev/null
|
||||
go get -u github.com/dapr/dapr@master
|
||||
go get -u github.com/dapr/dapr@d48d25e83cf4c85f566e9423340993dc517d8ac3
|
||||
go mod tidy
|
||||
echo "successfully updated dapr dependency for $appdir"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue