tricorder-observability / Starship

Starship: next-generation Observability platform built with eBPF+WASM
GNU Affero General Public License v3.0
163 stars 23 forks source link

CLI use the new response type from API Server codebase #125

Open nascentcore-eng opened 1 year ago

nascentcore-eng commented 1 year ago

Is your feature request related to a problem? Please describe. Right now src/cli defines its own Response

We want it to be unified with the response types in src/api-server/http/module_manager.go

Describe the solution you'd like Use the corresponding types

type CreateModuleReq struct {
    ID   string        `json:"id"`
    Name string        `json:"name"`
    Wasm *wasm.Program `json:"wasm"`
    Ebpf *ebpf.Program `json:"ebpf"`
}

type HTTPResp struct {
    Code    int    `json:"code"`
    Message string `json:"message"`
    Success bool   `json:"success"`
}

type CreateModuleResp struct {
    HTTPResp
}

type ListModuleResp struct {
    HTTPResp
    Data []dao.ModuleGORM `json:"data"`
}

type DeployModuleResp struct {
    HTTPResp
    UID string `json:"uid"`
}

Are you on Kubernetes N/A

Kernel version N/A

Describe alternatives you've considered None

Additional context None