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"` // Llm must be ""
6
Llm string `json:"llm"` // JsCode must be ""
6
Llm string `json:"llm"` // 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"`
25
LLM string `json:"llm"`
26
LLM string `json:"llm"`
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
}