Code Monkey home page Code Monkey logo

todo-go's Introduction

Todo-Go

Table of Contents

Overview

  • This is a web server for creating, listing, updating, and deleting tasks.

  • Data storage uses an in-memory mechanism, meaning it will only exist during runtime.

  • For the API documentation, please refer to Swagger

Project Structure

.
├── cmd                   # Applications
│   └── todo
│       ├── config        # Config files for the application
│       └── docs          # Documents for the application
├── internal              # Private application and library code. only use for specific cases
│   ├── controller        # Put business log here
│   │   └── mock
│   ├── db                # Implement in-memory storage mechanism
│   │   └── mock
│   ├── https
│   │   ├── server        # Server instance and middleware
│   │   │   └── handler   # Handle converting data from request
│   │   └── test          # HTTP Server integration tests
│   ├── models            # Data types
│   └── store             # Handle converting data from db
│       └── mock
└── pkg                   # Library code that's ok to use by external applications
    ├── config            # Reading config from env, file and default values.
    ├── http
    │   └── server        # HTTP Server Middleware
    ├── logger
    └── validator

How to Run

Pull image from DockerHub

docker run -p 8080 dragon0huang/todo-go:latest

Docker Compose

docker compose up

Local Run

make todo

Environments

  1. Set Env
export HTTP_SERVER__ADDR_PORT=127.0.0.1:8080
  1. Using toml config file

How to Build

make build

How to Test

go test ./...

How to Release

  • Create a git tag with ${component}-v${version} and push. Example:
git tag todo-v1.0.0
git push origin todo-v1.0.0

Note

  • Env will override variables from the config file
  • Set OPERATION__LOG_LEVEL to debug will also set logger to debug mode.

GitHub Actions

  • When you push to specified branches or create a pull request, two workflows are triggered:
    1. Validate the code by running linter checks, tests, and builds.
    2. Build two types of Docker images: distroless and alpine for debugging.

Contact

For any questions or suggestions, feel free to contact me at [email protected].

todo-go's People

Contributors

dragon-huang0403 avatar

Watchers

 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.