## Directory Structure

private service code, inspired by [onion architecture](https://pingcap.feishu.cn/docs/doccniBH2cTUuXw4lZd8TKLvXad).

```txt
internal:
├── config:         configurations
├── controller:     adapter to link services with infrastructures using dig
├── domain:         application core layer
│   ├── constant:       constant values
│   ├── entity:         core entities defined by ORM with gorm
│   ├── facade:         interface decoupled with third services
│   ├── repo:           interface decoupled with entity persistency
│   └── vo:             value objects
├── grpc:           grpc related
│   ├── grpcli:         grpc clients of third services
│   ├── http:           grpc http gateway
│   └── middlewares:    grpc server middleares
├── infra:          infrastructures
│   ├── eventbus:       eventbus publishers/subscribers
│   ├── facade_imp:     third services access
│   └── repo:           entity persistency 
├── metric:         prometheus metrics
├── service:        business services
│   ├── billing_svc:    dealing with metering/billing business
│   ├── event_svc:      dealing with events from eventbus
│   └── openapi_svc:    dealing with openapi business
├── storage:        storage related
│   ├── migrate:        db migration
│   └── mysql.go:       db initianlization
└── utils:          useful common snippets
```

#### Note:
In theory, we should seperate entitis with db schema definitions. But for now the entities are simple enough, we just use the ORM model as entity to avoid convertion.
