From d3632fe6b583d82dd6c64f79ea2e636434b16893 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Sat, 8 May 2021 17:58:58 +0100 Subject: [PATCH] update readmes --- blog/comments/proto/comments.proto | 35 -- .../services/comments/proto/comments.pb.go | 461 ------------------ .../comments/proto/comments.pb.micro.go | 110 ----- datastore/README.md | 6 +- feeds/README.md | 59 --- feeds/usage.md | 65 +++ files/README.md | 4 +- groups/README.md | 27 - location/README.md | 19 - mail/README.md | 47 +- mail/usage.md | 49 ++ notes/README.md | 40 +- notes/usage.md | 42 ++ otp/README.md | 2 + places/README.md | 14 - places/usage.md | 20 + posts/README.md | 86 ---- posts/usage.md | 92 ++++ sentiment/README.md | 10 +- sentiment/usage.md | 12 + streams/README.md | 2 + threads/README.md | 21 - users/README.md | 24 +- 23 files changed, 300 insertions(+), 947 deletions(-) delete mode 100644 blog/comments/proto/comments.proto delete mode 100644 comments/github.com/micro/services/comments/proto/comments.pb.go delete mode 100644 comments/github.com/micro/services/comments/proto/comments.pb.micro.go create mode 100644 feeds/usage.md create mode 100644 mail/usage.md create mode 100644 notes/usage.md create mode 100644 places/usage.md create mode 100644 posts/usage.md create mode 100644 sentiment/usage.md diff --git a/blog/comments/proto/comments.proto b/blog/comments/proto/comments.proto deleted file mode 100644 index 37c3da9..0000000 --- a/blog/comments/proto/comments.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package comments; -option go_package = "proto;comments"; - -service Comments { - rpc New(NewRequest) returns (NewResponse) {} - rpc List(ListRequest) returns (ListResponse) {} -} - -message Comment { - string id = 1; - string post = 2; - string author = 3; - string message = 4; - int64 created = 5; -} - -message NewRequest { - // post id - string post = 1; - // message to leave - string author = 2; - string message = 3; -} - -message NewResponse {} - -message ListRequest{ - string post = 1; -} - -message ListResponse{ - repeated Comment comments = 1; -} diff --git a/comments/github.com/micro/services/comments/proto/comments.pb.go b/comments/github.com/micro/services/comments/proto/comments.pb.go deleted file mode 100644 index 4548b55..0000000 --- a/comments/github.com/micro/services/comments/proto/comments.pb.go +++ /dev/null @@ -1,461 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.6.1 -// source: proto/comments.proto - -package comments - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type Comment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Post string `protobuf:"bytes,2,opt,name=post,proto3" json:"post,omitempty"` - Author string `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - Created int64 `protobuf:"varint,5,opt,name=created,proto3" json:"created,omitempty"` -} - -func (x *Comment) Reset() { - *x = Comment{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_comments_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Comment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Comment) ProtoMessage() {} - -func (x *Comment) ProtoReflect() protoreflect.Message { - mi := &file_proto_comments_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Comment.ProtoReflect.Descriptor instead. -func (*Comment) Descriptor() ([]byte, []int) { - return file_proto_comments_proto_rawDescGZIP(), []int{0} -} - -func (x *Comment) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Comment) GetPost() string { - if x != nil { - return x.Post - } - return "" -} - -func (x *Comment) GetAuthor() string { - if x != nil { - return x.Author - } - return "" -} - -func (x *Comment) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *Comment) GetCreated() int64 { - if x != nil { - return x.Created - } - return 0 -} - -type NewRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // post id - Post string `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` - // message to leave - Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *NewRequest) Reset() { - *x = NewRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_comments_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NewRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NewRequest) ProtoMessage() {} - -func (x *NewRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_comments_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NewRequest.ProtoReflect.Descriptor instead. -func (*NewRequest) Descriptor() ([]byte, []int) { - return file_proto_comments_proto_rawDescGZIP(), []int{1} -} - -func (x *NewRequest) GetPost() string { - if x != nil { - return x.Post - } - return "" -} - -func (x *NewRequest) GetAuthor() string { - if x != nil { - return x.Author - } - return "" -} - -func (x *NewRequest) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type NewResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NewResponse) Reset() { - *x = NewResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_comments_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NewResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NewResponse) ProtoMessage() {} - -func (x *NewResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_comments_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NewResponse.ProtoReflect.Descriptor instead. -func (*NewResponse) Descriptor() ([]byte, []int) { - return file_proto_comments_proto_rawDescGZIP(), []int{2} -} - -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Post string `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_comments_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_comments_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_proto_comments_proto_rawDescGZIP(), []int{3} -} - -func (x *ListRequest) GetPost() string { - if x != nil { - return x.Post - } - return "" -} - -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Comments []*Comment `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_comments_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_comments_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_proto_comments_proto_rawDescGZIP(), []int{4} -} - -func (x *ListResponse) GetComments() []*Comment { - if x != nil { - return x.Comments - } - return nil -} - -var File_proto_comments_proto protoreflect.FileDescriptor - -var file_proto_comments_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x22, 0x79, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x52, 0x0a, 0x0a, 0x4e, - 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x0d, 0x0a, 0x0b, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x73, - 0x74, 0x22, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x32, 0x79, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x03, - 0x4e, 0x65, 0x77, 0x12, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4e, - 0x65, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x37, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_comments_proto_rawDescOnce sync.Once - file_proto_comments_proto_rawDescData = file_proto_comments_proto_rawDesc -) - -func file_proto_comments_proto_rawDescGZIP() []byte { - file_proto_comments_proto_rawDescOnce.Do(func() { - file_proto_comments_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_comments_proto_rawDescData) - }) - return file_proto_comments_proto_rawDescData -} - -var file_proto_comments_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_proto_comments_proto_goTypes = []interface{}{ - (*Comment)(nil), // 0: comments.Comment - (*NewRequest)(nil), // 1: comments.NewRequest - (*NewResponse)(nil), // 2: comments.NewResponse - (*ListRequest)(nil), // 3: comments.ListRequest - (*ListResponse)(nil), // 4: comments.ListResponse -} -var file_proto_comments_proto_depIdxs = []int32{ - 0, // 0: comments.ListResponse.comments:type_name -> comments.Comment - 1, // 1: comments.Comments.New:input_type -> comments.NewRequest - 3, // 2: comments.Comments.List:input_type -> comments.ListRequest - 2, // 3: comments.Comments.New:output_type -> comments.NewResponse - 4, // 4: comments.Comments.List:output_type -> comments.ListResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proto_comments_proto_init() } -func file_proto_comments_proto_init() { - if File_proto_comments_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_comments_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Comment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_comments_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NewRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_comments_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NewResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_comments_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_comments_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_comments_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_comments_proto_goTypes, - DependencyIndexes: file_proto_comments_proto_depIdxs, - MessageInfos: file_proto_comments_proto_msgTypes, - }.Build() - File_proto_comments_proto = out.File - file_proto_comments_proto_rawDesc = nil - file_proto_comments_proto_goTypes = nil - file_proto_comments_proto_depIdxs = nil -} diff --git a/comments/github.com/micro/services/comments/proto/comments.pb.micro.go b/comments/github.com/micro/services/comments/proto/comments.pb.micro.go deleted file mode 100644 index ccff854..0000000 --- a/comments/github.com/micro/services/comments/proto/comments.pb.micro.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/comments.proto - -package comments - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - api "github.com/micro/micro/v3/service/api" - client "github.com/micro/micro/v3/service/client" - server "github.com/micro/micro/v3/service/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Comments service - -func NewCommentsEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Comments service - -type CommentsService interface { - New(ctx context.Context, in *NewRequest, opts ...client.CallOption) (*NewResponse, error) - List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) -} - -type commentsService struct { - c client.Client - name string -} - -func NewCommentsService(name string, c client.Client) CommentsService { - return &commentsService{ - c: c, - name: name, - } -} - -func (c *commentsService) New(ctx context.Context, in *NewRequest, opts ...client.CallOption) (*NewResponse, error) { - req := c.c.NewRequest(c.name, "Comments.New", in) - out := new(NewResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *commentsService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) { - req := c.c.NewRequest(c.name, "Comments.List", in) - out := new(ListResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Comments service - -type CommentsHandler interface { - New(context.Context, *NewRequest, *NewResponse) error - List(context.Context, *ListRequest, *ListResponse) error -} - -func RegisterCommentsHandler(s server.Server, hdlr CommentsHandler, opts ...server.HandlerOption) error { - type comments interface { - New(ctx context.Context, in *NewRequest, out *NewResponse) error - List(ctx context.Context, in *ListRequest, out *ListResponse) error - } - type Comments struct { - comments - } - h := &commentsHandler{hdlr} - return s.Handle(s.NewHandler(&Comments{h}, opts...)) -} - -type commentsHandler struct { - CommentsHandler -} - -func (h *commentsHandler) New(ctx context.Context, in *NewRequest, out *NewResponse) error { - return h.CommentsHandler.New(ctx, in, out) -} - -func (h *commentsHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error { - return h.CommentsHandler.List(ctx, in, out) -} diff --git a/datastore/README.md b/datastore/README.md index 1dcae7f..214352d 100644 --- a/datastore/README.md +++ b/datastore/README.md @@ -1,4 +1,6 @@ +Document data storage + # Datastore Service -The Datastore service is a document store with simple querying capabilities. -Tutorial coming soon. \ No newline at end of file +The Datastore service is a document store with a simplified query model for everyone. + diff --git a/feeds/README.md b/feeds/README.md index 70b4d43..4389316 100644 --- a/feeds/README.md +++ b/feeds/README.md @@ -4,62 +4,3 @@ A single uniform API for crawling and indexing RSS feeds Designed to populate the posts service with RSS feeds from other blogs. Useful for migration or just to get outside content into the posts service. -## Creating a feed - -### cURL - -```bash -> curl 'https://api.m3o.com/feeds/New' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"name":"a16z", "url": "http://a16z.com/feed/"}'; -{} -``` - -### CLI - -```shell -micro feeds add --name="a16z" --url=http://a16z.com/feed/ -``` - -## Querying feeded posts - -```shell -$ micro posts query -{ - "posts": [ - { - "id": "39cdfbd6e7534bcd868be9eebbf43f8f", - "title": "Anthony Albanese: From the NYSE to Crypto", - "slug": "anthony-albanese-from-the-nyse-to-crypto", - "created": "1605104742", - "updated": "1605105364", - "metadata": { - "domain": "a16z.com", - "link": "https://a16z.com/2020/10/28/anthony-albanese-from-the-nyse-to-crypto/" - } - }, - { - "id": "5e9285c01311704e204322ba564cd99e", - "title": "Journal Club: From Insect Eyes to Nanomaterials", - "slug": "journal-club-from-insect-eyes-to-nanomaterials", - "created": "1605104741", - "updated": "1605105363", - "metadata": { - "domain": "a16z.com", - "link": "https://a16z.com/2020/10/29/journal-club-insect-eyes-nanomaterials/" - } - }, - ] -} -``` - -``` -make proto -``` - -Run the service - -``` -micro run . -``` diff --git a/feeds/usage.md b/feeds/usage.md new file mode 100644 index 0000000..70b4d43 --- /dev/null +++ b/feeds/usage.md @@ -0,0 +1,65 @@ +A single uniform API for crawling and indexing RSS feeds + +# Feeds Service + +Designed to populate the posts service with RSS feeds from other blogs. Useful for migration or just to get outside content into the posts service. + +## Creating a feed + +### cURL + +```bash +> curl 'https://api.m3o.com/feeds/New' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"name":"a16z", "url": "http://a16z.com/feed/"}'; +{} +``` + +### CLI + +```shell +micro feeds add --name="a16z" --url=http://a16z.com/feed/ +``` + +## Querying feeded posts + +```shell +$ micro posts query +{ + "posts": [ + { + "id": "39cdfbd6e7534bcd868be9eebbf43f8f", + "title": "Anthony Albanese: From the NYSE to Crypto", + "slug": "anthony-albanese-from-the-nyse-to-crypto", + "created": "1605104742", + "updated": "1605105364", + "metadata": { + "domain": "a16z.com", + "link": "https://a16z.com/2020/10/28/anthony-albanese-from-the-nyse-to-crypto/" + } + }, + { + "id": "5e9285c01311704e204322ba564cd99e", + "title": "Journal Club: From Insect Eyes to Nanomaterials", + "slug": "journal-club-from-insect-eyes-to-nanomaterials", + "created": "1605104741", + "updated": "1605105363", + "metadata": { + "domain": "a16z.com", + "link": "https://a16z.com/2020/10/29/journal-club-insect-eyes-nanomaterials/" + } + }, + ] +} +``` + +``` +make proto +``` + +Run the service + +``` +micro run . +``` diff --git a/files/README.md b/files/README.md index 84d73be..6ccdeae 100644 --- a/files/README.md +++ b/files/README.md @@ -1,3 +1,5 @@ +Store, list and retrieve text files + # Files Service -Save and list text files by project and path. \ No newline at end of file +Save, list and retrieve text files by project and path. diff --git a/groups/README.md b/groups/README.md index 0dcec5b..bd94aaa 100644 --- a/groups/README.md +++ b/groups/README.md @@ -4,30 +4,3 @@ Manage group memberships The group service is a basic CRUD service for group membership management. Create groups, add members and lookup which groups a user is a member of. -Example usage: - -```bash -$ micro groups create --name=Micro -{ - "group": { - "id": "e35562c9-b6f6-459a-b52d-7e6159465fd6", - "name": "Micro" - } -} -$ micro groups addMember --group_id=e35562c9-b6f6-459a-b52d-7e6159465fd6 --member_id=Asim -{} -$ micro groups list --member_id=Asim -{ - "groups": [ - { - "id": "e35562c9-b6f6-459a-b52d-7e6159465fd6", - "name": "Micro", - "member_ids": [ - "Asim" - ] - } - ] -} -$ micro groups list --member_id=Boris -{} -``` diff --git a/location/README.md b/location/README.md index f897182..86c97cd 100644 --- a/location/README.md +++ b/location/README.md @@ -5,22 +5,3 @@ Real time GPS location tracking and search Send, store and search real time gps point data and tracking info using the location API. Build powerful map rendered views with up to the second updated points on the map. -Generated with - -``` -micro new location -``` - -## Usage - -Generate the proto code - -``` -make proto -``` - -Run the service - -``` -micro run . -``` diff --git a/mail/README.md b/mail/README.md index 802508e..f579feb 100644 --- a/mail/README.md +++ b/mail/README.md @@ -1,49 +1,6 @@ -The mail service is a simplified service for sending mail, much like email. +An inbox for your messages # Mail Service -## Send a message +The mail service is a simplified service for sending mail, much like email where the messages stay on the server. -### CLI - -```bash -> micro mail send --to=John --from=Barry --subject=HelloWorld --text="Hello John" -``` - -## List the mail a user has received - -### CLI - -```bash -> micro mail list --user=John -{ - "mail": [ - { - "id": "78efd836-ca51-4163-af43-65985f7c6587", - "to": "John", - "from": "Barry", - "subject": "HelloWorld", - "text": "Hello John", - "sent_at": "1602777240" - } - ] -} -``` - -## Lookup an individual email by ID - -### CLI - -```bash -> micro mail read --id=78efd836-ca51-4163-af43-65985f7c6587 -{ - "message": { - "id": "78efd836-ca51-4163-af43-65985f7c6587", - "to": "John", - "from": "Barry", - "subject": "HelloWorld", - "text": "Hello John", - "sent_at": "1602777240" - } -} -``` \ No newline at end of file diff --git a/mail/usage.md b/mail/usage.md new file mode 100644 index 0000000..802508e --- /dev/null +++ b/mail/usage.md @@ -0,0 +1,49 @@ +The mail service is a simplified service for sending mail, much like email. + +# Mail Service + +## Send a message + +### CLI + +```bash +> micro mail send --to=John --from=Barry --subject=HelloWorld --text="Hello John" +``` + +## List the mail a user has received + +### CLI + +```bash +> micro mail list --user=John +{ + "mail": [ + { + "id": "78efd836-ca51-4163-af43-65985f7c6587", + "to": "John", + "from": "Barry", + "subject": "HelloWorld", + "text": "Hello John", + "sent_at": "1602777240" + } + ] +} +``` + +## Lookup an individual email by ID + +### CLI + +```bash +> micro mail read --id=78efd836-ca51-4163-af43-65985f7c6587 +{ + "message": { + "id": "78efd836-ca51-4163-af43-65985f7c6587", + "to": "John", + "from": "Barry", + "subject": "HelloWorld", + "text": "Hello John", + "sent_at": "1602777240" + } +} +``` \ No newline at end of file diff --git a/notes/README.md b/notes/README.md index 1fa74ee..803ca03 100644 --- a/notes/README.md +++ b/notes/README.md @@ -1,42 +1,6 @@ -Notes service is an RPC service which offers CRUD for notes. It demonstrates usage of the store, errors and logger pacakges. +Store your notes and todos # Notes Service -## Create a note +The notes service offers basic storage of notes and todo lists. -```bash -micro notes create --title="HelloWorld" --text="MyFirstNote" -{ - "id": "6d3fa5c0-6e79-4418-a72a-c1650efb65d2" -} -``` - -## Update a note - -```bash -micro notes update --id=6d3fa5c0-6e79-4418-a72a-c1650efb65d2 --title="HelloWorld" --text="MyFirstNote (v2)" -{} -``` - -## List notes - -```bash -micro notes list -{ - "notes": [ - { - "id": "6d3fa5c0-6e79-4418-a72a-c1650efb65d2", - "created": "1602849877", - "title": "HelloWorld", - "text": "MyFirstNote (v2)" - } - ] -} -``` - -## Delete a note - -```bash -micro notes delete --id=6d3fa5c0-6e79-4418-a72a-c1650efb65d2 -{} -``` diff --git a/notes/usage.md b/notes/usage.md new file mode 100644 index 0000000..1fa74ee --- /dev/null +++ b/notes/usage.md @@ -0,0 +1,42 @@ +Notes service is an RPC service which offers CRUD for notes. It demonstrates usage of the store, errors and logger pacakges. + +# Notes Service + +## Create a note + +```bash +micro notes create --title="HelloWorld" --text="MyFirstNote" +{ + "id": "6d3fa5c0-6e79-4418-a72a-c1650efb65d2" +} +``` + +## Update a note + +```bash +micro notes update --id=6d3fa5c0-6e79-4418-a72a-c1650efb65d2 --title="HelloWorld" --text="MyFirstNote (v2)" +{} +``` + +## List notes + +```bash +micro notes list +{ + "notes": [ + { + "id": "6d3fa5c0-6e79-4418-a72a-c1650efb65d2", + "created": "1602849877", + "title": "HelloWorld", + "text": "MyFirstNote (v2)" + } + ] +} +``` + +## Delete a note + +```bash +micro notes delete --id=6d3fa5c0-6e79-4418-a72a-c1650efb65d2 +{} +``` diff --git a/otp/README.md b/otp/README.md index 0555464..38c1a3a 100644 --- a/otp/README.md +++ b/otp/README.md @@ -1,3 +1,5 @@ +One time password service + # OTP Service Generate one time passwords (OTP) for any unique id, email or user. Codes are valid for up to 60 seconds. diff --git a/places/README.md b/places/README.md index ac4703b..cada39e 100644 --- a/places/README.md +++ b/places/README.md @@ -4,17 +4,3 @@ Store and search for points of interest The places API stores points of interest and enables you to search for places nearby or last visited. - -## Usage - -Places makes use of postgres. Set the config for the database - -``` -micro user config set places.database "postgresql://postgres@localhost:5432/locations?sslmode=disable" -``` - -Run the service - -``` -micro run . -``` diff --git a/places/usage.md b/places/usage.md new file mode 100644 index 0000000..ac4703b --- /dev/null +++ b/places/usage.md @@ -0,0 +1,20 @@ +Store and search for points of interest + +# Places Service + +The places API stores points of interest and enables you to search for places nearby or last visited. + + +## Usage + +Places makes use of postgres. Set the config for the database + +``` +micro user config set places.database "postgresql://postgres@localhost:5432/locations?sslmode=disable" +``` + +Run the service + +``` +micro run . +``` diff --git a/posts/README.md b/posts/README.md index 256cca4..6704a8c 100644 --- a/posts/README.md +++ b/posts/README.md @@ -4,89 +4,3 @@ Build a blog or the foundations of a headless CMS with posts Posts is the foundation of a headless CMS, storing blog posts with their metadata and enabling simple retrieval and querying. -## Create a post - -### cURL - -```shell -> curl 'https://api.m3o.com/posts/Save' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"post":{"id":"1","title":"How to Micro","content":"Simply put, Micro is awesome."}}'; - -> curl 'https://api.m3o.com/chat/Save' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"post":{"id":"2","title":"Fresh posts are fresh","content":"This post is fresher than the How to Micro one"}}'; -``` - -### CLI - -```shell -micro call posts Posts.Save '{"post":{"id":"1","title":"How to Micro","content":"Simply put, Micro is awesome."}}' - -micro call posts Posts.Save '{"post":{"id":"2","title":"Fresh posts are fresh","content":"This post is fresher than the How to Micro one"}}' -``` - -## Create a post with tags - - -### cURL - -```shell -> curl 'https://api.m3o.com/posts/Save' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"post":{"id":"3","title":"How to do epic things with Micro","content":"Everything is awesome.","tagNames":["a","b"]}}'; -``` - -### CLI - -```shell -micro call posts Posts.Save '{"post":{"id":"3","title":"How to do epic things with Micro","content":"Everything is awesome.","tagNames":["a","b"]}}' -``` - -## Query posts - -### cURL - -```shell -# Query all -> curl 'https://api.m3o.com/posts/Query' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{}'; - -# Query by slug -> curl 'https://api.m3o.com/posts/Query' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"slug":"how-to-micro"}'; - -# Limit and offset -> curl 'https://api.m3o.com/posts/Query' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"offset": 10, "limit": 10}'; -``` - -### CLI - -```shell -micro call posts Posts.Query '{}' -micro call posts Posts.Query '{"slug":"how-to-micro"}' -micro call posts Posts.Query '{"offset": 10, "limit": 10}' -``` - -## Delete posts - -```shell -> curl 'https://api.m3o.com/posts/Delete' \ - -H 'micro-namespace: $yourNamespace' \ - -H 'authorization: Bearer $yourToken' \ - -d '{"id": "3c9ea66c"}'; -``` - -```shell -micro call posts Posts.Delete '{"id": "3c9ea66c"}' -``` diff --git a/posts/usage.md b/posts/usage.md new file mode 100644 index 0000000..256cca4 --- /dev/null +++ b/posts/usage.md @@ -0,0 +1,92 @@ +Build a blog or the foundations of a headless CMS with posts + +# Post Service + +Posts is the foundation of a headless CMS, storing blog posts with their metadata and enabling simple retrieval and querying. + +## Create a post + +### cURL + +```shell +> curl 'https://api.m3o.com/posts/Save' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"post":{"id":"1","title":"How to Micro","content":"Simply put, Micro is awesome."}}'; + +> curl 'https://api.m3o.com/chat/Save' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"post":{"id":"2","title":"Fresh posts are fresh","content":"This post is fresher than the How to Micro one"}}'; +``` + +### CLI + +```shell +micro call posts Posts.Save '{"post":{"id":"1","title":"How to Micro","content":"Simply put, Micro is awesome."}}' + +micro call posts Posts.Save '{"post":{"id":"2","title":"Fresh posts are fresh","content":"This post is fresher than the How to Micro one"}}' +``` + +## Create a post with tags + + +### cURL + +```shell +> curl 'https://api.m3o.com/posts/Save' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"post":{"id":"3","title":"How to do epic things with Micro","content":"Everything is awesome.","tagNames":["a","b"]}}'; +``` + +### CLI + +```shell +micro call posts Posts.Save '{"post":{"id":"3","title":"How to do epic things with Micro","content":"Everything is awesome.","tagNames":["a","b"]}}' +``` + +## Query posts + +### cURL + +```shell +# Query all +> curl 'https://api.m3o.com/posts/Query' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{}'; + +# Query by slug +> curl 'https://api.m3o.com/posts/Query' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"slug":"how-to-micro"}'; + +# Limit and offset +> curl 'https://api.m3o.com/posts/Query' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"offset": 10, "limit": 10}'; +``` + +### CLI + +```shell +micro call posts Posts.Query '{}' +micro call posts Posts.Query '{"slug":"how-to-micro"}' +micro call posts Posts.Query '{"offset": 10, "limit": 10}' +``` + +## Delete posts + +```shell +> curl 'https://api.m3o.com/posts/Delete' \ + -H 'micro-namespace: $yourNamespace' \ + -H 'authorization: Bearer $yourToken' \ + -d '{"id": "3c9ea66c"}'; +``` + +```shell +micro call posts Posts.Delete '{"id": "3c9ea66c"}' +``` diff --git a/sentiment/README.md b/sentiment/README.md index 501f251..7d3b374 100644 --- a/sentiment/README.md +++ b/sentiment/README.md @@ -1,12 +1,6 @@ +Real time sentiment analysis + # Sentiment Service The sentiment service provides rudimentary sentiment analysis on text -## Usage - -``` -$ micro sentiment analyze --text "This is great" -{ - "score": 1 -} -``` diff --git a/sentiment/usage.md b/sentiment/usage.md new file mode 100644 index 0000000..501f251 --- /dev/null +++ b/sentiment/usage.md @@ -0,0 +1,12 @@ +# Sentiment Service + +The sentiment service provides rudimentary sentiment analysis on text + +## Usage + +``` +$ micro sentiment analyze --text "This is great" +{ + "score": 1 +} +``` diff --git a/streams/README.md b/streams/README.md index 3ff166d..4e68eea 100644 --- a/streams/README.md +++ b/streams/README.md @@ -1,3 +1,5 @@ +PubSub streaming and websockets + # Streams Service The streams service provides an event stream, designed for sending messages from a server to mutliple diff --git a/threads/README.md b/threads/README.md index 67fc0c7..8063519 100644 --- a/threads/README.md +++ b/threads/README.md @@ -4,24 +4,3 @@ Threaded conversations Threads provides threaded conversations as a service grouped by topics. -## Usage - -Generated with - -``` -micro new threads -``` - -## Usage - -Generate the proto code - -``` -make proto -``` - -Run the service - -``` -micro run . -``` diff --git a/users/README.md b/users/README.md index 3690034..160b2a1 100644 --- a/users/README.md +++ b/users/README.md @@ -1,23 +1,5 @@ +Usage management and authentication + # Users Service -This is the Users service - -Generated with - -``` -micro new users -``` - -## Usage - -Generate the proto code - -``` -make proto -``` - -Run the service - -``` -micro run . -``` \ No newline at end of file +The user service provides user management, storage and authentication.