kora

command module
v0.0.0-...-38ac173 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 1 Imported by: 0

README

Kora

echo framework 기반의 go 스켈레톤 프로젝트입니다.

go 언어를 이용하여 backend api 서버를 빠르게 만들 수 있도록 하는 것이 목적입니다.

개발환경을 위한 설치프로그램 및 설정 (Mac OS X 기준)

  1. Docker Desktop

  2. Go

  3. Homebrew

  4. go-migrate

$ brew install golang-migrate
  1. sqlc
$ brew install sqlc

Makefile 구성

  • Postgresql Database 설치 (docker)
$ make postgresql
  • 데이터베이스 생성 / 삭제
# Makefile 에서 database 이름 수정필요
$ make createdb  # 생성
$ make dropdb    # 삭제
  • 마이그레이션 파일 생성
$ make migration
# 입력 프롬프트에서 마이그레이션 파일명 (ex, init_schema) 을 넣으면 자동으로 seq 부여
  • Migrate Up
$ make migrateup    # 전체 migration 파일을 일괄 적용할 때 사용
$ make migrateup1   # 최근 1개의 migration 파일만 적용할 때 사용
  • Migrate Down
$ make migratedown    # 전체 migration 파일을 일괄 적용할 때 사용
$ make migratedown1   # 최근 1개의 migration 파일만 적용할 때 사용
  • sqlc 를 이용한 코드 생성
$ make sqlc

프로그램 실행

  • 서버 구동
$ make server

Documentation

Overview

Copyright © 2021 Dante Jang <wecanooo@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL