GithubHelp home page GithubHelp logo

hugomsilvam / go-micro-service-todolist Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8.91 MB

Create a microservice using go micro framework and toolkit

Dockerfile 2.58% Makefile 9.22% Go 88.20%
go-micro protobuf

go-micro-service-todolist's Introduction

Todo.List.Micro Service

This is the Todo.List.Micro service (Go micro) sample with CRUD operations.

  • You can create a new Todo.
  • Get a specific Todo by Id.
  • Get a list of all Todos.
  • Update a Todo.
  • Delete a Todo.

Generated with

micro new github.com/hugomsilvam/todo.list.micro --namespace=go.micro --type=srv

If you want change the protobuf example you will need to generate using proto-gen-go inside your project directory

cd /home/<user>/go/src/github.com/hugomsilvam/todo.list.micro
protoc --proto_path=. --go_out=. --micro_out=. proto/example/example.proto

Getting Started

Configuration

  • FQDN: go.micro.srv.todo.list.micro
  • Type: srv
  • Alias: todo.list.micro

Dependencies

Micro services depend on service discovery. The default is multicast DNS, a zeroconf system.

In the event you need a resilient multi-host setup we recommend consul.

# install consul
brew install consul

# run consul
consul agent -dev

Usage

To run and to test this project

go run main.go

Use micro web dashboard for getting more information about yours micro services on the browser (always better than on the console ๐Ÿ˜ƒ)

go web

To call the Service, the web dashboard should work but in my case isn't working, so I run the command on the console

micro call <service-name> <endpoint> <request-parameters>
micro call go.micro.srv.todo.list.micro TodoService.Create '{"todo":{"id":1,"title":"bananas","description":"apples + bananas","completed":true}}'

A Makefile is included for convenience

Build the binary

make build

Run the service

./todo.list.micro-srv

Build a docker image

make docker

go-micro-service-todolist's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.