Merge pull request #11 from dapr/proto

Updating protobuf file and fixing the example sample.
This commit is contained in:
Shalabh Mohan Shrivastava 2020-01-21 10:19:07 -08:00 committed by GitHub
commit 48249cda2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 234 additions and 178 deletions

View File

@ -1,18 +1,19 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: dapr.proto
// source: dapr/dapr.proto
package dapr
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
duration "github.com/golang/protobuf/ptypes/duration"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -38,7 +39,7 @@ func (m *InvokeServiceResponseEnvelope) Reset() { *m = InvokeServiceResp
func (m *InvokeServiceResponseEnvelope) String() string { return proto.CompactTextString(m) }
func (*InvokeServiceResponseEnvelope) ProtoMessage() {}
func (*InvokeServiceResponseEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{0}
return fileDescriptor_221b5d054bffffd8, []int{0}
}
func (m *InvokeServiceResponseEnvelope) XXX_Unmarshal(b []byte) error {
@ -74,9 +75,10 @@ func (m *InvokeServiceResponseEnvelope) GetMetadata() map[string]string {
}
type DeleteStateEnvelope struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Etag string `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"`
Options *StateOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
StoreName string `protobuf:"bytes,1,opt,name=storeName,proto3" json:"storeName,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
Etag string `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"`
Options *StateOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -86,7 +88,7 @@ func (m *DeleteStateEnvelope) Reset() { *m = DeleteStateEnvelope{} }
func (m *DeleteStateEnvelope) String() string { return proto.CompactTextString(m) }
func (*DeleteStateEnvelope) ProtoMessage() {}
func (*DeleteStateEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{1}
return fileDescriptor_221b5d054bffffd8, []int{1}
}
func (m *DeleteStateEnvelope) XXX_Unmarshal(b []byte) error {
@ -107,6 +109,13 @@ func (m *DeleteStateEnvelope) XXX_DiscardUnknown() {
var xxx_messageInfo_DeleteStateEnvelope proto.InternalMessageInfo
func (m *DeleteStateEnvelope) GetStoreName() string {
if m != nil {
return m.StoreName
}
return ""
}
func (m *DeleteStateEnvelope) GetKey() string {
if m != nil {
return m.Key
@ -129,7 +138,8 @@ func (m *DeleteStateEnvelope) GetOptions() *StateOptions {
}
type SaveStateEnvelope struct {
Requests []*StateRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"`
StoreName string `protobuf:"bytes,1,opt,name=storeName,proto3" json:"storeName,omitempty"`
Requests []*StateRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -139,7 +149,7 @@ func (m *SaveStateEnvelope) Reset() { *m = SaveStateEnvelope{} }
func (m *SaveStateEnvelope) String() string { return proto.CompactTextString(m) }
func (*SaveStateEnvelope) ProtoMessage() {}
func (*SaveStateEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{2}
return fileDescriptor_221b5d054bffffd8, []int{2}
}
func (m *SaveStateEnvelope) XXX_Unmarshal(b []byte) error {
@ -160,6 +170,13 @@ func (m *SaveStateEnvelope) XXX_DiscardUnknown() {
var xxx_messageInfo_SaveStateEnvelope proto.InternalMessageInfo
func (m *SaveStateEnvelope) GetStoreName() string {
if m != nil {
return m.StoreName
}
return ""
}
func (m *SaveStateEnvelope) GetRequests() []*StateRequest {
if m != nil {
return m.Requests
@ -168,8 +185,9 @@ func (m *SaveStateEnvelope) GetRequests() []*StateRequest {
}
type GetStateEnvelope struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Consistency string `protobuf:"bytes,2,opt,name=consistency,proto3" json:"consistency,omitempty"`
StoreName string `protobuf:"bytes,1,opt,name=storeName,proto3" json:"storeName,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
Consistency string `protobuf:"bytes,3,opt,name=consistency,proto3" json:"consistency,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -179,7 +197,7 @@ func (m *GetStateEnvelope) Reset() { *m = GetStateEnvelope{} }
func (m *GetStateEnvelope) String() string { return proto.CompactTextString(m) }
func (*GetStateEnvelope) ProtoMessage() {}
func (*GetStateEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{3}
return fileDescriptor_221b5d054bffffd8, []int{3}
}
func (m *GetStateEnvelope) XXX_Unmarshal(b []byte) error {
@ -200,6 +218,13 @@ func (m *GetStateEnvelope) XXX_DiscardUnknown() {
var xxx_messageInfo_GetStateEnvelope proto.InternalMessageInfo
func (m *GetStateEnvelope) GetStoreName() string {
if m != nil {
return m.StoreName
}
return ""
}
func (m *GetStateEnvelope) GetKey() string {
if m != nil {
return m.Key
@ -226,7 +251,7 @@ func (m *GetStateResponseEnvelope) Reset() { *m = GetStateResponseEnvelo
func (m *GetStateResponseEnvelope) String() string { return proto.CompactTextString(m) }
func (*GetStateResponseEnvelope) ProtoMessage() {}
func (*GetStateResponseEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{4}
return fileDescriptor_221b5d054bffffd8, []int{4}
}
func (m *GetStateResponseEnvelope) XXX_Unmarshal(b []byte) error {
@ -274,7 +299,7 @@ func (m *InvokeBindingEnvelope) Reset() { *m = InvokeBindingEnvelope{} }
func (m *InvokeBindingEnvelope) String() string { return proto.CompactTextString(m) }
func (*InvokeBindingEnvelope) ProtoMessage() {}
func (*InvokeBindingEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{5}
return fileDescriptor_221b5d054bffffd8, []int{5}
}
func (m *InvokeBindingEnvelope) XXX_Unmarshal(b []byte) error {
@ -330,7 +355,7 @@ func (m *InvokeServiceEnvelope) Reset() { *m = InvokeServiceEnvelope{} }
func (m *InvokeServiceEnvelope) String() string { return proto.CompactTextString(m) }
func (*InvokeServiceEnvelope) ProtoMessage() {}
func (*InvokeServiceEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{6}
return fileDescriptor_221b5d054bffffd8, []int{6}
}
func (m *InvokeServiceEnvelope) XXX_Unmarshal(b []byte) error {
@ -391,7 +416,7 @@ func (m *PublishEventEnvelope) Reset() { *m = PublishEventEnvelope{} }
func (m *PublishEventEnvelope) String() string { return proto.CompactTextString(m) }
func (*PublishEventEnvelope) ProtoMessage() {}
func (*PublishEventEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{7}
return fileDescriptor_221b5d054bffffd8, []int{7}
}
func (m *PublishEventEnvelope) XXX_Unmarshal(b []byte) error {
@ -441,7 +466,7 @@ func (m *State) Reset() { *m = State{} }
func (m *State) String() string { return proto.CompactTextString(m) }
func (*State) ProtoMessage() {}
func (*State) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{8}
return fileDescriptor_221b5d054bffffd8, []int{8}
}
func (m *State) XXX_Unmarshal(b []byte) error {
@ -510,7 +535,7 @@ func (m *StateOptions) Reset() { *m = StateOptions{} }
func (m *StateOptions) String() string { return proto.CompactTextString(m) }
func (*StateOptions) ProtoMessage() {}
func (*StateOptions) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{9}
return fileDescriptor_221b5d054bffffd8, []int{9}
}
func (m *StateOptions) XXX_Unmarshal(b []byte) error {
@ -565,7 +590,7 @@ func (m *RetryPolicy) Reset() { *m = RetryPolicy{} }
func (m *RetryPolicy) String() string { return proto.CompactTextString(m) }
func (*RetryPolicy) ProtoMessage() {}
func (*RetryPolicy) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{10}
return fileDescriptor_221b5d054bffffd8, []int{10}
}
func (m *RetryPolicy) XXX_Unmarshal(b []byte) error {
@ -622,7 +647,7 @@ func (m *StateRequest) Reset() { *m = StateRequest{} }
func (m *StateRequest) String() string { return proto.CompactTextString(m) }
func (*StateRequest) ProtoMessage() {}
func (*StateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{11}
return fileDescriptor_221b5d054bffffd8, []int{11}
}
func (m *StateRequest) XXX_Unmarshal(b []byte) error {
@ -691,7 +716,7 @@ func (m *StateRequestOptions) Reset() { *m = StateRequestOptions{} }
func (m *StateRequestOptions) String() string { return proto.CompactTextString(m) }
func (*StateRequestOptions) ProtoMessage() {}
func (*StateRequestOptions) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{12}
return fileDescriptor_221b5d054bffffd8, []int{12}
}
func (m *StateRequestOptions) XXX_Unmarshal(b []byte) error {
@ -746,7 +771,7 @@ func (m *StateRetryPolicy) Reset() { *m = StateRetryPolicy{} }
func (m *StateRetryPolicy) String() string { return proto.CompactTextString(m) }
func (*StateRetryPolicy) ProtoMessage() {}
func (*StateRetryPolicy) Descriptor() ([]byte, []int) {
return fileDescriptor_0b1c5554fb3d73bc, []int{13}
return fileDescriptor_221b5d054bffffd8, []int{13}
}
func (m *StateRetryPolicy) XXX_Unmarshal(b []byte) error {
@ -810,59 +835,61 @@ func init() {
proto.RegisterType((*StateRetryPolicy)(nil), "dapr.StateRetryPolicy")
}
func init() { proto.RegisterFile("dapr.proto", fileDescriptor_0b1c5554fb3d73bc) }
func init() { proto.RegisterFile("dapr/dapr.proto", fileDescriptor_221b5d054bffffd8) }
var fileDescriptor_0b1c5554fb3d73bc = []byte{
// 769 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x6f, 0xd3, 0x4c,
0x10, 0xae, 0xf3, 0xd1, 0x8f, 0x49, 0xfb, 0xaa, 0xdd, 0xa6, 0x7d, 0x93, 0xf4, 0x7d, 0xab, 0xc8,
0x5c, 0x0a, 0x42, 0xae, 0x68, 0x85, 0x54, 0x01, 0x42, 0x22, 0x24, 0x45, 0x1c, 0x2a, 0x2a, 0x47,
0x42, 0x5c, 0xb7, 0xf1, 0x92, 0x58, 0x75, 0x76, 0xcd, 0x7a, 0x63, 0xc9, 0x12, 0x17, 0x4e, 0x5c,
0x91, 0xf8, 0x29, 0xfc, 0x16, 0x0e, 0xfc, 0x08, 0x7e, 0x01, 0x17, 0xe4, 0xf5, 0xda, 0x75, 0x6c,
0x27, 0x29, 0x6a, 0xcb, 0xcd, 0xbb, 0x33, 0x7e, 0x66, 0x9e, 0x99, 0x67, 0x76, 0x17, 0xc0, 0xc2,
0x2e, 0x37, 0x5c, 0xce, 0x04, 0x43, 0x95, 0xf0, 0xbb, 0xd5, 0x1c, 0x32, 0x36, 0x74, 0xc8, 0xa1,
0xdc, 0xbb, 0x98, 0xbc, 0x3f, 0xc4, 0x34, 0x88, 0x1c, 0x5a, 0x7b, 0x59, 0x13, 0x19, 0xbb, 0x22,
0x36, 0xee, 0x67, 0x8d, 0xd6, 0x84, 0x63, 0x61, 0x33, 0x1a, 0xd9, 0xf5, 0xef, 0x1a, 0xfc, 0xff,
0x9a, 0xfa, 0xec, 0x92, 0xf4, 0x09, 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7a, 0xbf, 0x20, 0x9b, 0xe7, 0xb0, 0x96, 0xbc, 0x37, 0xd0, 0xbf, 0xaa, 0xcf, 0xd9,
0x07, 0xc8, 0x9c, 0x2c, 0x3a, 0x50, 0x4b, 0x3d, 0x8d, 0x90, 0xd2, 0x7e, 0xc1, 0x6b, 0x69, 0x36,
0x46, 0x67, 0x07, 0x56, 0x6c, 0x26, 0x7f, 0xec, 0x40, 0xd8, 0xbd, 0xf3, 0xd0, 0xc1, 0xbb, 0x58,
0x96, 0x8e, 0xc7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x56, 0xf6, 0x6a, 0x4d, 0xc0, 0x0a, 0x00,
0x00,
var fileDescriptor_221b5d054bffffd8 = []byte{
// 805 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0xd3, 0x4a,
0x10, 0xaf, 0x9d, 0xa4, 0x7f, 0x26, 0xed, 0x7b, 0xe9, 0x36, 0xaf, 0x2f, 0x49, 0xdf, 0xab, 0x22,
0x73, 0x09, 0x08, 0xb9, 0x22, 0x15, 0x52, 0x05, 0x08, 0x89, 0x90, 0x50, 0x71, 0x28, 0x54, 0x8e,
0x84, 0xb8, 0x6e, 0xe3, 0x25, 0xb1, 0xea, 0xec, 0x9a, 0xf5, 0x26, 0x52, 0x24, 0x2e, 0x9c, 0xb8,
0x22, 0xf1, 0x2d, 0xb8, 0xf2, 0x59, 0x38, 0xf0, 0x21, 0xf8, 0x04, 0x5c, 0x90, 0xd7, 0x6b, 0xc7,
0xb1, 0x93, 0xb4, 0x55, 0x5b, 0x2e, 0x96, 0x77, 0x66, 0x76, 0x66, 0x7e, 0xb3, 0xbf, 0x99, 0x5d,
0xf8, 0xdb, 0xc6, 0x1e, 0x3f, 0x08, 0x3e, 0xa6, 0xc7, 0x99, 0x60, 0x28, 0x1f, 0xfc, 0xd7, 0xaa,
0x7d, 0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0x09, 0xd5, 0x42,
0x04, 0xf3, 0xe6, 0x54, 0x6d, 0x37, 0xe3, 0xb9, 0x13, 0x3c, 0xa7, 0x8c, 0x15, 0xd4, 0x85, 0xad,
0x99, 0x39, 0x8a, 0xf6, 0x96, 0x0c, 0xd7, 0xda, 0x9d, 0x4b, 0x3c, 0x7d, 0x8c, 0x15, 0xf4, 0x22,
0x72, 0xaa, 0x2e, 0xa3, 0x59, 0xa7, 0xa9, 0x1b, 0x6a, 0x49, 0x72, 0x6d, 0x58, 0x8f, 0x2e, 0x67,
0xa4, 0x0e, 0x28, 0xfd, 0x24, 0xa8, 0xed, 0xcf, 0xca, 0xe7, 0x64, 0xf3, 0x14, 0x36, 0xe2, 0xb7,
0x0a, 0xfa, 0x57, 0x9d, 0x73, 0xfa, 0xf1, 0xb2, 0x24, 0x8b, 0x16, 0x14, 0x13, 0x8f, 0x2e, 0xa4,
0xb8, 0x3f, 0xe7, 0x1d, 0xb6, 0xd8, 0x47, 0xab, 0x01, 0x6b, 0x0e, 0x93, 0x1b, 0x5b, 0x10, 0x9c,
0xde, 0x69, 0x60, 0xe0, 0x7f, 0xd5, 0x4b, 0xc1, 0xc2, 0x7c, 0xee, 0x3a, 0x84, 0x0a, 0xf3, 0x98,
0x7b, 0xbd, 0xb3, 0x55, 0xb9, 0xf7, 0xf0, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x14, 0xb7,
0x8c, 0x33, 0x0b, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -957,6 +984,29 @@ type DaprServer interface {
DeleteState(context.Context, *DeleteStateEnvelope) (*empty.Empty, error)
}
// UnimplementedDaprServer can be embedded to have forward compatible implementations.
type UnimplementedDaprServer struct {
}
func (*UnimplementedDaprServer) PublishEvent(ctx context.Context, req *PublishEventEnvelope) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method PublishEvent not implemented")
}
func (*UnimplementedDaprServer) InvokeService(ctx context.Context, req *InvokeServiceEnvelope) (*InvokeServiceResponseEnvelope, error) {
return nil, status.Errorf(codes.Unimplemented, "method InvokeService not implemented")
}
func (*UnimplementedDaprServer) InvokeBinding(ctx context.Context, req *InvokeBindingEnvelope) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method InvokeBinding not implemented")
}
func (*UnimplementedDaprServer) GetState(ctx context.Context, req *GetStateEnvelope) (*GetStateResponseEnvelope, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented")
}
func (*UnimplementedDaprServer) SaveState(ctx context.Context, req *SaveStateEnvelope) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SaveState not implemented")
}
func (*UnimplementedDaprServer) DeleteState(ctx context.Context, req *DeleteStateEnvelope) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteState not implemented")
}
func RegisterDaprServer(s *grpc.Server, srv DaprServer) {
s.RegisterService(&_Dapr_serviceDesc, srv)
}
@ -1099,5 +1149,5 @@ var _Dapr_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "dapr.proto",
Metadata: "dapr/dapr.proto",
}

View File

@ -1,102 +1,108 @@
package main
import (
"context"
"fmt"
"os"
pb "github.com/dapr/go-sdk/dapr"
"github.com/golang/protobuf/ptypes/any"
"google.golang.org/grpc"
)
func main() {
// Get the Dapr port and create a connection
daprPort := os.Getenv("DAPR_GRPC_PORT")
daprAddress := fmt.Sprintf("localhost:%s", daprPort)
conn, err := grpc.Dial(daprAddress, grpc.WithInsecure())
if err != nil {
fmt.Println(err)
return
}
defer conn.Close()
// Create the client
client := pb.NewDaprClient(conn)
// Invoke a method called MyMethod on another Dapr enabled service with id client
resp, err := client.InvokeService(context.Background(), &pb.InvokeServiceEnvelope{
Id: "client",
Data: &any.Any{Value: []byte("Hello")},
Method: "MyMethod",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println(string(resp.Data.Value))
}
// Publish a message to the topic TopicA
_, err = client.PublishEvent(context.Background(), &pb.PublishEventEnvelope{
Topic: "TopicA",
Data: &any.Any{
Value: []byte("Hi from Pub Sub"),
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Published message!")
}
// Save state with the key myKey
_, err = client.SaveState(context.Background(), &pb.SaveStateEnvelope{
Requests: []*pb.StateRequest{
&pb.StateRequest{
Key: "myKey",
Value: &any.Any{
Value: []byte("My State"),
},
},
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Saved state!")
}
// Get state for key myKey
r, err := client.GetState(context.Background(), &pb.GetStateEnvelope{
Key: "myKey",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Got state!")
fmt.Println(string(r.Data.Value))
}
// Delete state for key myKey
_, err = client.DeleteState(context.Background(), &pb.DeleteStateEnvelope{
Key: "myKey",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("State deleted")
}
// Invoke output binding named storage. Make sure you set up a Dapr binding, otherwise this will fail
_, err = client.InvokeBinding(context.Background(), &pb.InvokeBindingEnvelope{
Name: "storage",
Data: &any.Any{
Value: []byte("some data"),
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Binding invoked")
}
}
package main
import (
"context"
"fmt"
"os"
pb "github.com/dapr/go-sdk/dapr"
"github.com/golang/protobuf/ptypes/any"
"google.golang.org/grpc"
)
func main() {
// Get the Dapr port and create a connection
daprPort := os.Getenv("DAPR_GRPC_PORT")
daprAddress := fmt.Sprintf("localhost:%s", daprPort)
conn, err := grpc.Dial(daprAddress, grpc.WithInsecure())
if err != nil {
fmt.Println(err)
return
}
defer conn.Close()
// Create the client
client := pb.NewDaprClient(conn)
// Invoke a method called MyMethod on another Dapr enabled service with id client
resp, err := client.InvokeService(context.Background(), &pb.InvokeServiceEnvelope{
Id: "client",
Data: &any.Any{Value: []byte("Hello")},
Method: "MyMethod",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println(string(resp.Data.Value))
}
// Publish a message to the topic TopicA
_, err = client.PublishEvent(context.Background(), &pb.PublishEventEnvelope{
Topic: "TopicA",
Data: &any.Any{
Value: []byte("Hi from Pub Sub"),
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Published message!")
}
// Save state with the key myKey
_, err = client.SaveState(context.Background(), &pb.SaveStateEnvelope{
// statestore is the name of the default redis state store , set up by Dapr CLI
StoreName: "statestore",
Requests: []*pb.StateRequest{
&pb.StateRequest{
Key: "myKey",
Value: &any.Any{
Value: []byte("My State"),
},
},
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Saved state!")
}
// Get state for key myKey
r, err := client.GetState(context.Background(), &pb.GetStateEnvelope{
// statestore is the name of the default redis state store , set up by Dapr CLI
StoreName: "statestore",
Key: "myKey",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Got state!")
fmt.Println(string(r.Data.Value))
}
// Delete state for key myKey
_, err = client.DeleteState(context.Background(), &pb.DeleteStateEnvelope{
// statestore is the name of the default redis state store , set up by Dapr CLI
StoreName: "statestore",
Key: "myKey",
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("State deleted")
}
// Invoke output binding named storage. Make sure you set up a Dapr binding, otherwise this will fail
_, err = client.InvokeBinding(context.Background(), &pb.InvokeBindingEnvelope{
Name: "storage",
Data: &any.Any{
Value: []byte("some data"),
},
})
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Binding invoked")
}
}