GithubHelp home page GithubHelp logo

eriklupander / go-microservice-eureka Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 15.0 9 KB

Sample golang project with a simple http service exposing itself by registering with Eureka.

License: MIT License

Shell 1.73% Go 98.27%

go-microservice-eureka's Introduction

A sample go microservice with Eureka integration

This very simplistic little http service provides hard-coded 'vendors' on /vendors/{id} and is used as an example project for a blog post on http://callistaenterprise.se/blogg/teknik/

Building

Go SDK 1.5+ installed.

Clone this repo, set your GOPATH / GOROOT to the folder you cloned into.

cd src/github.com/eriklupander/go-eureka/*.go
go get

The docker image can be built using the .sh script:

#!/usr/bin/env bash

export GOARCH=amd64
export GOOS=linux
go build -o bin/goeureka src/github.com/eriklupander/goeureka/*.go
docker build -t vendor .
export GOARCH=amd64
export GOOS=darwin

Update for your target OS accordingly.

Running

This microservice can be ran standalone, though it will keep trying to contact the Eureka server at http://192.168.99.100:8761 until exit or success. I.e - this code is meant to be executed in the context of the blog post.

Anyway - you can hopefully start it using go run:

 > go run src/github.com/eriklupander/go-eureka/*.go

Have fun!

This software uses the MIT license, see LICENSE.md

Uses gorilla/context and gorilla/mux Copyright (c) 2012 Rodrigo Moraes Uses twinj/uuid Copyright (C) 2011 by Krzysztof Kowalik [email protected], Copyright (C) 2014 by Daniel Kemp [email protected] Derivative work

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.