Skip to content

aaqaishtyaq/bookmark-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bookmark Service

Golang Server gRPC CRUD App

Table of Contents

Overview

Basic Go Client/Server CRUD app using gRPC.

Features

Requirements

Configuration

Runtime environment variables that need to be in your Shell.

Parameter Example Description
GOPATH $HOME/$USER/go
GOROOT /usr/local/go
GOBIN $HOME/$USER/go/bin

Quickstart

1. Download and Install The Protobuf Compiler (Protoc)

  • Place the binary somewhere in your $PATH
$ which protoc

  /usr/local/bin/protoc

2. Compile the Proto Files

$ ./hack/proto-gen.sh

./pkg
|── api
    └── v1
        └── bookmark-service.pb.go

3. Start the Server

  • Build the server
  % pushd cmd/server && go build && popd
  • Run the server
% ./cmd/server/server --grpc-port 55521
  • Add Bookmark
% grpcurl -d '{"api" : "v1", "bookmark" : {"url" : "aaqa.dev"} }' -plaintext localhost:55521 v1.BookmarkService/CreateBookmark
  • List Bookmarks
% grpcurl -plaintext localhost:55521 v1.BookmarkService/ListBookmarks

Architecture

.
├── README.md
├── api
│   └── proto
│       └── v1
│           └── bookmark-service.proto           - V1 Proto Description
├── cmd
│   └── server
│       └── main.go                              - Server entrypoint
├── go.mod
├── go.sum
├── hack
│   └── proto-gen.sh
└── pkg
    ├── api
    │   └── v1
    │       ├── bookmark-service.pb.go           - Compiled Protobuf TodoService Package (Autogenerated by protoc-gen-go)
    │       └── bookmark-service_grpc.pb.go
    ├── logger
    │   └── log.go
    └── service
        └── v1
            └── bookmark-service.go              - CRUD functionality using compiled protobuf API and PB definitions

Todo

  • CLI Client.
  • Add Remaining methods for CRUD ops.
  • Add REST Server and Swagger Files.

Credits

About

CRUD application for managing bookmarks using gRPC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published