GithubHelp home page GithubHelp logo

gopherconuk's Introduction

Go micro-service in ~30 minutes

This is a Go micro-service written from scratch.

It shows how to use net/http, and how to structure a Go project.

It relies on Go 1.11 Beta 2 and the upcoming "Go modules" (formerly known as "vgo") support.

Dependency injection is used to insert a logger instance into the handler.

You can also notice how the test is constructed in order to provide testing for the handler.

A Docker container is available, thanks to the Dockerfile. It shows how to construct such containers.

How to use

Because this project uses go modules, as long as you are using Go 1.11 Beta 2+ or Go 1.10 with vgo support, you should be ok.

Clone this anywhere in your computer and create a project in your editor. I'm using GoLand IDE in order to work on the project during the presentation as well as have support for go modules.

The bundled, self-signed, certificates are bound to either dev.localhost:8080 or docker.localhost:8080. I obviously do not recommend using these in production.

Presentation link

I created this as part of the presentation at GopherCon UK 18.

The link for the video will be updated here when the presentation is out.

References

Structuring Go applications

In order to learn how to approach package design in Go, you can read the following resources:

Once done, this article will help you understand the Design Philosophy On Packaging by William Kennedy.

Exposing Go applications to the Internet

This article describes how you can start approaching

Thank you

I would like to thank you William "Bill" Kennedy for the inspiration he provided on getting me to do this talk.

License

This project is under the MIT license. Please see the LICENSE file for more details.

gopherconuk's People

Contributors

dlsniper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gopherconuk's Issues

tcp:443 bind: Permission denied

How to set up the workspace to allow ports less than 1000 to be used.

gcuk 2019/12/07 12:19:52 main.go:30: server failed to start: listen tcp :443: bind: permission denied

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.