Documentation
¶
Index ¶
Constants ¶
View Source
const TEMPLATE_MAIN = `
package apogy
import (
openapi "github.com/aep/apogy/api/go"
)
type Mutation struct {
Add interface{} ` + "`json:\"add,omitempty\"`" + `
Sub interface{} ` + "`json:\"sub,omitempty\"`" + `
Mul interface{} ` + "`json:\"mul,omitempty\"`" + `
Div interface{} ` + "`json:\"div,omitempty\"`" + `
Min interface{} ` + "`json:\"min,omitempty\"`" + `
Max interface{} ` + "`json:\"max,omitempty\"`" + `
Set interface{} ` + "`json:\"set,omitempty\"`" + `
}
type Mutations map[string]Mutation
type Document[Val any] struct {
openapi.Document
Id string ` + "`json:\"id\"`" + `
Model string ` + "`json:\"model\"`" + `
Val Val ` + "`json:\"val\"`" + `
Mut Mutations ` + "`json:\"mut\",omitempty`" + `
}
type ValidationRequest[Doc any] struct {
Current *Doc ` + "`json:\"current,omitempty\"`" + `
Pending *Doc ` + "`json:\"pending,omitempty\"`" + `
}
{{range $t, $n := .Types}}
type {{$t}} Document[{{$t}}Val]
{{end}}
type Client struct {
openapi.ClientInterface
{{range $t, $n := .Types}}
{{$t}} *openapi.TypedClient[{{$t}}]
{{end}}
}
type ClientOption openapi.ClientOption
func NewClient(server string, opts ...ClientOption) (*Client, error) {
var optss []openapi.ClientOption
for _, o := range opts {
optss = append(optss, openapi.ClientOption(o))
}
client, err := openapi.NewClient(server, optss...)
if err != nil {
return nil, err
}
r := &Client{ClientInterface: client}
{{range $t,$n := .Types}}
r.{{$t}} = &openapi.TypedClient[{{$t}}]{client, "{{$n}}"}
{{end}}
return r, nil
}
`
View Source
const TEMPLATE_MODEL = `
package apogy
import (
)
`
Variables ¶
This section is empty.
Functions ¶
func RegisterCommands ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.