-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocstoregen.go
40 lines (40 loc) · 995 Bytes
/
docstoregen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Package docstoregen provides a code generator for the [go-cloud.dev/docstore] package.
//
// The generator creates a query code file for the go-cloud.dev/docstore package.
//
// The generator's basic configuration is defined in the Config struct.
//
// The generator's main function is Execute, which generates the query code file.
//
// Example:
//
// package main
//
// import (
// "github.com/bartventer/docstore-gen"
// )
//
// type User struct {
// ID string `docstore:"id"`
// Name string `docstore:"name"`
// }
//
// func (User) TableName() string { return "user" }
//
// type Copmany struct {
// ID string `docstore:"id"`
// Name string `docstore:"name"`
// }
//
// func (Copmany) TableName() string { return "company" }
//
// func main() {
// g := docstoregen.NewGenerator(docstoregen.Config{
// OutPath: "query",
// })
// g.ApplyInterface(&User{}, &Copmany{})
// g.Execute()
// }
//
// [go-cloud.dev/docstore]: https://gocloud.dev/howto/docstore/
package docstoregen