buttonsapi

package module
v0.0.0-...-79ce300 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 5 Imported by: 0

README

buttons-api

설계 UMLs

UMLs.md

gettings started

go run cmd/main.go server start # 5001 grpc - 5002 http

package structue?

  📂 git@sundaytycoon/buttons-api
   ┣📂 cmd
   ┃ ┗ 📜 main.go # [server, entd]가 있음
   ┣📂 doc
   ┃ ┗ 📂 OpenAPI # swagger.json들어오는곳/ swagger-ui 다운받는 곳
   ┣📂 edge # 비지니스로직 상세하게 타지 않으면서, 외부 서버랑 최종적으로 통신하는 코드들
   ┣📂 ent # entd.go 의 generated된 파일들 한 뭉텅이
   ┣📂 gen/go/buttons/api/v1 # protobuf로 generated된 golang파일
   ┣📂 internal # 내부 비지니스로직 담는곳 # 똥같은 코드들 두는 곳
   ┣📂 pkg
   ┣📂 proto # protobuf 파일들이 있음.
make generate-docs # 요거하면 코드 dependency graph가 바뀌어요

code dependency graph

wiki

ent.go 유용한 스크립트 모음
# add model
go run entgo.io/ent/cmd/ent init User

# sync schema
### First, should to modify ent/schema/*.go before synchronizing schema
vi ./ent/schema/*.go # step 1
go generate ./ent # step 2
go run cmd/main.go ent migration # step 3


개발 셋팅 관련 문서

scripts

protobuf generating
make protosetup # For set up protobuf using `buf`

make protogen # For generating protobuf

References

Documentation

Index

Constants

View Source
const (
	ValueEnvLocal = "local"
	ValueEnvAlpha = "alpha"
	ValueEnvProd  = "prod"
)
View Source
const (
	Google   = "google"
	Facebook = "facebook"
)

Variables

View Source
var (
	// client side error
	ErrInvalidRequest = errors.New("error, invalid request")
	ErrRequestTimeout = errors.New("error, request timeout")

	// server side error
	ErrInternalServer                     = errors.New("error, internal server error")
	ErrGoogleOAuthCallbackInternalError   = errors.New("google authentication has an error")
	ErrGoogleOAuthCallbackEmailIsNotValid = errors.New("requested user's email is not valid")

	ErrRefreshTokenIsNotValid = errors.New("google oauth2: refresh_token is not loaded")
	ErrEmailIsNotVerified     = errors.New("google oauth2: email is not verified")
)
View Source
var OAPISpecYAML embed.FS

OAPISpecYAML is the Open API Specifications Manifest document that defines golive HTTP API.

View Source
var PublicUI embed.FS

PublicUI is the Open API Specifications Manifest document that defines golive HTTP API.

View Source
var StaticSwaggerUI embed.FS

StaticSwaggerUI is a collection of pre-built static files for swagger web ui.

Functions

func HTTPErrorToStatusCode

func HTTPErrorToStatusCode(err error) int

Types

type Service

type Service string
const (
	ButtonsAPI   Service = "buttons-api"
	ButtonsAdmin Service = "buttons-admin"
	ButtonsWeb   Service = "buttons-web"
)

Jump to

Keyboard shortcuts

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