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,omitempty"` // Llm must be ""
5
JsCode string `json:"js_code,omitempty"` // Llm must be ""
6
Llm string `json:"llm,omitempty"` // JsCode must be ""
6
Llm string `json:"llm,omitempty"` // JsCode must be ""
7
Tags []string `json:"tags,omitempty"`
8
}
7
}
9
8
10
type NewFuncResponse struct {
9
type NewFuncResponse struct {
11
Name string `json:"name"`
10
Name string `json:"name"`
12
DateCreated string `json:"date_created"` // RFC8601 with millis
11
DateCreated string `json:"date_created"` // RFC8601 with millis
13
}
12
}
14
13
15
type DeleteFuncRequest struct {
14
type DeleteFuncRequest struct {
16
Name string `json:"name"`
15
Name string `json:"name"`
17
}
16
}
18
17
19
type DeleteFuncResponse struct {
18
type DeleteFuncResponse struct {
20
}
19
}
21
20
22
type FuncVersion struct {
21
type FuncVersion struct {
23
Hash string `json:"hash"`
22
Hash string `json:"hash"`
24
Date string `json:"date"`
23
Date string `json:"date"`
25
JS string `json:"js,omitempty"`
24
JS string `json:"js,omitempty"`
26
LLM string `json:"llm,omitempty"`
25
LLM string `json:"llm,omitempty"`
27
Tags []string `json:"tags,omitempty"`
28
}
26
}
29
27
30
type Func struct {
28
type Func struct {
31
Name string `json:"name"`
29
Name string `json:"name"`
32
Versions []FuncVersion `json:"versions"`
30
Versions []FuncVersion `json:"versions"`
33
}
31
}
34
32
35
type ListFuncsResponse struct {
33
type ListFuncsResponse struct {
36
Funcs []Func `json:"funcs"`
34
Funcs []Func `json:"funcs"`
37
}
35
}