This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package v1; | |
import "google/protobuf/timestamp.proto"; | |
// Taks we have to do | |
message ToDo { | |
// Unique integer identifier of the todo task | |
int64 id = 1; | |
// Title of the task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 todo-service.proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package v1; | |
import "google/protobuf/timestamp.proto"; | |
// Taks we have to do | |
message ToDo { | |
// Unique integer identifier of the todo task | |
int64 id = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `ToDo` ( | |
`ID` bigint(20) NOT NULL AUTO_INCREMENT, | |
`Title` varchar(200) DEFAULT NULL, | |
`Description` varchar(1024) DEFAULT NULL, | |
`Reminder` timestamp NULL DEFAULT NULL, | |
PRIMARY KEY (`ID`), | |
UNIQUE KEY `ID_UNIQUE` (`ID`) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package v1 | |
import ( | |
"context" | |
"database/sql" | |
"fmt" | |
"time" | |
"github.com/golang/protobuf/ptypes" | |
"google.golang.org/grpc/codes" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package grpc | |
import ( | |
"context" | |
"log" | |
"net" | |
"os" | |
"os/signal" | |
"google.golang.org/grpc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/amsokol/go-grpc-http-rest-microservice-tutorial/pkg/cmd" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"time" | |
"github.com/golang/protobuf/ptypes" | |
"google.golang.org/grpc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cmd | |
import ( | |
"context" | |
"database/sql" | |
"flag" | |
"fmt" | |
// mysql driver | |
_ "github.com/go-sql-driver/mysql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package v1; | |
import "google/protobuf/timestamp.proto"; | |
import "google/api/annotations.proto"; | |
import "protoc-gen-swagger/options/annotations.proto"; | |
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { | |
info: { | |
title: "ToDo service"; |
OlderNewer