Skip to content

Commit

Permalink
chore: bump kcl lib to 0.8.4 (#283)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy authored Apr 12, 2024
1 parent ecac045 commit 3fc0d64
Show file tree
Hide file tree
Showing 10 changed files with 868 additions and 502 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module kcl-lang.io/kcl-go
go 1.21

require (
github.com/BurntSushi/toml v1.2.1
github.com/chai2010/jsonv v1.1.3
github.com/chai2010/protorpc v1.1.4
github.com/getkin/kin-openapi v0.124.0
Expand All @@ -22,7 +23,7 @@ require (
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
kcl-lang.io/kpm v0.8.4
kcl-lang.io/lib v0.8.3
kcl-lang.io/lib v0.8.4
)

require (
Expand All @@ -34,7 +35,6 @@ require (
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1295,8 +1295,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
kcl-lang.io/kpm v0.8.4 h1:UbU5EKdojWWLTwzmb0f1QNeAZSPZAbYRMRSzYaKnq8g=
kcl-lang.io/kpm v0.8.4/go.mod h1:3atE1tEbsSPaAuKslkADH1HTDi7SMWlDWllmuk2XsBA=
kcl-lang.io/lib v0.8.3 h1:Ft6Ti81PrSMpyJ1b/akKwMwtRcO7k7+Clwv0fMECZ+k=
kcl-lang.io/lib v0.8.3/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
kcl-lang.io/lib v0.8.4 h1:uQPNLqZe3abaW++90kYhCSEmTEi2DE0yf/xLM/Q9S2c=
kcl-lang.io/lib v0.8.4/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
oras.land/oras-go v1.2.3 h1:v8PJl+gEAntI1pJ/LCrDgsuk+1PKVavVEPsYIHFE5uY=
oras.land/oras-go v1.2.3/go.mod h1:M/uaPdYklze0Vf3AakfarnpoEckvw0ESbRdN8Z1vdJg=
oras.land/oras-go/v2 v2.3.0 h1:lqX1aXdN+DAmDTKjiDyvq85cIaI4RkIKp/PghWlAGIU=
Expand Down
4 changes: 4 additions & 0 deletions pkg/native/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ func (c *NativeServiceClient) ListOptions(in *gpyrpc.ParseProgram_Args) (*gpyrpc
return cApiCall[*gpyrpc.ParseProgram_Args, *gpyrpc.ListOptions_Result](c, "KclvmService.ListOptions", in)
}

func (c *NativeServiceClient) ListVariables(in *gpyrpc.ListVariables_Args) (*gpyrpc.ListVariables_Result, error) {
return cApiCall[*gpyrpc.ListVariables_Args, *gpyrpc.ListVariables_Result](c, "KclvmService.ListVariables", in)
}

func (c *NativeServiceClient) LoadPackage(in *gpyrpc.LoadPackage_Args) (*gpyrpc.LoadPackage_Result, error) {
return cApiCall[*gpyrpc.LoadPackage_Args, *gpyrpc.LoadPackage_Result](c, "KclvmService.LoadPackage", in)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/service/client_kclvm_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ func (p *KclvmServiceClient) ListOptions(args *gpyrpc.ParseProgram_Args) (resp *
return
}

func (p *KclvmServiceClient) ListVariables(args *gpyrpc.ListVariables_Args) (resp *gpyrpc.ListVariables_Result, err error) {
p.Runtime.DoTask(func(c *rpc.Client, stderr io.Reader) {
resp, err = p.getClient(c).ListVariables(args)
err = p.wrapErr(err, stderr)
})
return
}

func (p *KclvmServiceClient) LoadPackage(args *gpyrpc.LoadPackage_Args) (resp *gpyrpc.LoadPackage_Result, err error) {
p.Runtime.DoTask(func(c *rpc.Client, stderr io.Reader) {
resp, err = p.getClient(c).LoadPackage(args)
Expand Down
3 changes: 3 additions & 0 deletions pkg/service/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func (p *_KclvmServiceImpl) ParseProgram(ctx context.Context, args *gpyrpc.Parse
func (p *_KclvmServiceImpl) ListOptions(ctx context.Context, args *gpyrpc.ParseProgram_Args) (*gpyrpc.ListOptions_Result, error) {
return p.c.ListOptions(args)
}
func (p *_KclvmServiceImpl) ListVariables(ctx context.Context, args *gpyrpc.ListVariables_Args) (*gpyrpc.ListVariables_Result, error) {
return p.c.ListVariables(args)
}
func (p *_KclvmServiceImpl) LoadPackage(ctx context.Context, args *gpyrpc.LoadPackage_Args) (*gpyrpc.LoadPackage_Result, error) {
return p.c.LoadPackage(args)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/service/kclvm_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type KclvmService interface {
ParseFile(in *gpyrpc.ParseFile_Args) (out *gpyrpc.ParseFile_Result, err error)
ParseProgram(in *gpyrpc.ParseProgram_Args) (out *gpyrpc.ParseProgram_Result, err error)
ListOptions(in *gpyrpc.ParseProgram_Args) (out *gpyrpc.ListOptions_Result, err error)
ListVariables(in *gpyrpc.ListVariables_Args) (out *gpyrpc.ListVariables_Result, err error)
LoadPackage(in *gpyrpc.LoadPackage_Args) (out *gpyrpc.LoadPackage_Result, err error)
FormatCode(in *gpyrpc.FormatCode_Args) (out *gpyrpc.FormatCode_Result, err error)
FormatPath(in *gpyrpc.FormatPath_Args) (out *gpyrpc.FormatPath_Result, err error)
Expand Down
9 changes: 9 additions & 0 deletions pkg/service/rest_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (p *restServer) initHttpRrouter() {
p.router.GET("/api:protorpc/KclvmService.ParseFile", p.handle_ParseFile)
p.router.GET("/api:protorpc/KclvmService.ParseProgram", p.handle_ParseProgram)
p.router.GET("/api:protorpc/KclvmService.ListOptions", p.handle_ListOptions)
p.router.GET("/api:protorpc/KclvmService.ListVariables", p.handle_ListVariables)
p.router.GET("/api:protorpc/KclvmService.LoadPackage", p.handle_LoadPackage)
p.router.GET("/api:protorpc/KclvmService.FormatCode", p.handle_FormatCode)
p.router.GET("/api:protorpc/KclvmService.FormatPath", p.handle_FormatPath)
Expand All @@ -82,6 +83,7 @@ func (p *restServer) initHttpRrouter() {
p.router.POST("/api:protorpc/KclvmService.ParseFile", p.handle_ParseFile)
p.router.POST("/api:protorpc/KclvmService.ParseProgram", p.handle_ParseProgram)
p.router.POST("/api:protorpc/KclvmService.ListOptions", p.handle_ListOptions)
p.router.POST("/api:protorpc/KclvmService.ListVariables", p.handle_ListVariables)
p.router.POST("/api:protorpc/KclvmService.LoadPackage", p.handle_LoadPackage)
p.router.POST("/api:protorpc/KclvmService.FormatCode", p.handle_FormatCode)
p.router.POST("/api:protorpc/KclvmService.FormatPath", p.handle_FormatPath)
Expand Down Expand Up @@ -187,6 +189,13 @@ func (p *restServer) handle_ListOptions(w http.ResponseWriter, r *http.Request,
})
}

func (p *restServer) handle_ListVariables(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
var args = new(gpyrpc.ListVariables_Args)
p.handle(w, r, args, func() (proto.Message, error) {
return p.c.ListVariables(args)
})
}

func (p *restServer) handle_LoadPackage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
var args = new(gpyrpc.LoadPackage_Args)
p.handle(w, r, args, func() (proto.Message, error) {
Expand Down
Loading

0 comments on commit 3fc0d64

Please sign in to comment.