-
Notifications
You must be signed in to change notification settings - Fork 0
REFACTOR: consolidate core logic into the 'internal' package and upda… #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
06f9323 to
ad0373d
Compare
internal/memcached/memcached.go
Outdated
| return ssh.RunSSHCommand(ip, command) | ||
| } | ||
|
|
||
| func StatMemcachedProcess(server string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 어디서 사용하는 함수인가요?
- 에러 발생할 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위 PR에서 zooekeepr stat명령을 위한 함수입니다.
해당함수는 zookeeper모듈로 이동시키고, StatZKProcess()로 함수명을 변경하겠습니다. 해당 함수가 정상동작하는 것은 PR올리기 전 확인했습니다.
#19 의 zookeeper stat 출력
$ ZK_ADDR="127.0.0.1:2181" ARCUS_PATH="~/arcus" ZK_PATH="~/arcus/zookeeper" ./arcus-cli zookeeper stat
Zookeeper version: 3.5.9-SNAPSHOT-69f59e0bbb22e7cbc0f3518e1a52342a6c7eb1ff, built on 07/31/2025 02:19 GMT
Clients:
/127.0.0.1:53162[0](queued=0,recved=1,sent=0)
/127.0.0.1:53163[0](queued=0,recved=1,sent=0)
/[0:0:0:0:0:0:0:1]:49663[1](queued=0,recved=1947,sent=1947)
Latency min/avg/max: 0/1/357
Received: 2121
Sent: 2119
Connections: 3
Outstanding: 1
Zxid: 0x200000066
Mode: leader
Node count: 21
Proposal sizes last/min/max: 36/32/430
| OfflineServers []string | ||
| } | ||
|
|
||
| func (s *Status) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
출력 형식도 인터페이스에 따라 달라질 부분으로 보이기는 한데, 우선은 PR 구현 유지하는 것으로 하겠습니다.
ad0373d to
cb04c8b
Compare
namsic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 구현으로 반영하겠습니다.
이후 제가 코드 구조를 전반적으로 변경할 것이므로, cli 외 다른 작업 우선 진행해주기 바랍니다.
|
네 알겠습니다 다른작업 먼저 진행하고 있겠습니다. |
…te callers
🔗 Related Issue
⌨️ What I did
배경
arcus-cli의 로직은cmd패키지 하위의 각 명령어 파일 내부에 구현되어 있었습니다. 이는 명령형 인터페이스(CLI)만을 고려한 초기 설계였으나, 인터페이스 설계 #26 에서 논의된 바와 같이 향후 선언형 인터페이스(예: YAML 기반)의 도입 가능성이 제기되었습니다.internal패키지로 추출 및 재구성하고, 기존cmd패키지는 단순히 사용자 입력을 받아 핵심 로직을 호출하는 역할만 하도록 변경하는 작업을 담고 있습니다.변경 사항
internal패키지로 분리acl,memcached,zookeeper등 각 명령어에 종속되어 있던 비즈니스 로직을 모두internal패키지로 이전했습니다.cmd패키지의 역할은 이제 사용자 입력(flags, args)을 파싱하여internal의 함수를 호출하고 결과를 출력하는 역할만 담당합니다.internal패키지 구조 전면 개편internal구조는 여러 로직을 담기에 불충분하다고 판단하여, 각 책임에 따라 패키지를 세분화했습니다.Before:
After:
세부 구현 내용 (Implementation Details)
각 패키지별 주요 함수 및 메서드
internal/aclinternal/memcachedinternal/sshinternal/zookeeperinternal/types