code.oscarkilo.com/klex-git

Hash:
95d00209738edd7dcedb8e3ae46e2f1a040ddc43
Author:
Igor Naverniouk <[email protected]>
Date:
Mon Sep 30 11:28:09 2024 -0700
Message:
function tags
diff --git a/api/funcs.go b/api/funcs.go
index f91096b..c27d1a2 100644
--- a/api/funcs.go
+++ b/api/funcs.go
@@ -2,8 +2,9 @@ package api

type NewFuncRequest struct {
Name string `json:"name"` // no need to be unique
- JsCode string `json:"js_code"` // Llm must be ""
- Llm string `json:"llm"` // JsCode must be ""
+ JsCode string `json:"js_code,omitempty"` // Llm must be ""
+ Llm string `json:"llm,omitempty"` // JsCode must be ""
+ Tags []string `json:"tags,omitempty"`
}

type NewFuncResponse struct {
@@ -21,8 +22,9 @@ type DeleteFuncResponse struct {
type FuncVersion struct {
Hash string `json:"hash"`
Date string `json:"date"`
- JS string `json:"js"`
- LLM string `json:"llm"`
+ JS string `json:"js,omitempty"`
+ LLM string `json:"llm,omitempty"`
+ Tags []string `json:"tags,omitempty"`
}

type Func struct {
a/api/funcs.go
b/api/funcs.go
1
package api
1
package api
2
2
3
type NewFuncRequest struct {
3
type NewFuncRequest struct {
4
Name string `json:"name"` // no need to be unique
4
Name string `json:"name"` // no need to be unique
5
JsCode string `json:"js_code"` // Llm must be ""
5
JsCode string `json:"js_code,omitempty"` // Llm must be ""
6
Llm string `json:"llm"` // JsCode must be ""
6
Llm string `json:"llm,omitempty"` // JsCode must be ""
7
Tags []string `json:"tags,omitempty"`
7
}
8
}
8
9
9
type NewFuncResponse struct {
10
type NewFuncResponse struct {
10
Name string `json:"name"`
11
Name string `json:"name"`
11
DateCreated string `json:"date_created"` // RFC8601 with millis
12
DateCreated string `json:"date_created"` // RFC8601 with millis
12
}
13
}
13
14
14
type DeleteFuncRequest struct {
15
type DeleteFuncRequest struct {
15
Name string `json:"name"`
16
Name string `json:"name"`
16
}
17
}
17
18
18
type DeleteFuncResponse struct {
19
type DeleteFuncResponse struct {
19
}
20
}
20
21
21
type FuncVersion struct {
22
type FuncVersion struct {
22
Hash string `json:"hash"`
23
Hash string `json:"hash"`
23
Date string `json:"date"`
24
Date string `json:"date"`
24
JS string `json:"js"`
25
JS string `json:"js,omitempty"`
25
LLM string `json:"llm"`
26
LLM string `json:"llm,omitempty"`
27
Tags []string `json:"tags,omitempty"`
26
}
28
}
27
29
28
type Func struct {
30
type Func struct {
29
Name string `json:"name"`
31
Name string `json:"name"`
30
Versions []FuncVersion `json:"versions"`
32
Versions []FuncVersion `json:"versions"`
31
}
33
}
32
34
33
type ListFuncsResponse struct {
35
type ListFuncsResponse struct {
34
Funcs []Func `json:"funcs"`
36
Funcs []Func `json:"funcs"`
35
}
37
}