refactor: rename examples/ directory to lib/ and update all path references

This commit is contained in:
2026-07-17 19:21:21 +09:00
parent 8f183d597e
commit 8bb11fe205
17 changed files with 49 additions and 49 deletions
+31
View File
@@ -0,0 +1,31 @@
package main
import (
"fmt"
entity "grpccanary/lib/grpcentity"
"grpccanary/lib/jsonexample"
"time"
)
var port = ":8080"
func main() {
// 1단계: JSON 파싱 예제 실행
jsonexample.JsonParsingExample()
// 3단계: gRPC 통신 예제 실행 (필요 시 주석 제거하여 활성화 가능)
// grpcSample()
}
func grpcSample() {
fmt.Println("--- starting gRPC IoT Simulation ---")
// 1. gRPC 서버를 백그라운드 고루틴으로 구동
go entity.ServerRun(port)
// 2. 서버 포트가 바인딩되어 통신 대기 상태에 들어갈 시간을 일시적으로 보장
time.Sleep(100 * time.Millisecond)
// 3. gRPC 클라이언트를 구동하여 원격 프로시저(RPC) 기동 시뮬레이션 집행
entity.ClientRun(port)
}