gots cli
Generates TypeScript types, enums, constants and interfaces from Go source.
go install github.com/ubgo/gots/cmd/cli@latest
- Language
- Go
- Go version
- 1.24.2
- Core deps
- 2 direct
- Latest tag
- v0.1.0
- License
- Apache-2.0
- Go modules
- 1
Code from the README
type MessageRole string
const (
MessageRoleUser MessageRole = "user"
MessageRoleAssistant MessageRole = "assistant"
MessageRoleSystem MessageRole = "system"
)type LockType int
const (
_ LockType = iota
LockReadonly
LockUpdate
LockDelete
)type UserID int64
type Slug string
type Tags []string
type StringMap map[string]string
type IPv4 [4]byte
type Matrix3x3 [3][3]float64type Reducer func(accumulator, current int) int
type ErrorHandler func(err error)
type Callback func()
type Handler func(request string) (response string, err error)
type MultiReturn func(a, b int) (int, int, error)
type Comparator[T any] func(a, b T) intFrom the gots README.
At a glance (from the README)
| Key | Type | Required | Description |
|---|---|---|---|
file | string | yes | Path to Go source file (absolute or relative) |
output | string | yes | Path for generated .ts file |
style | string | no | Override default_style for this file |
include | string[] | no | Whitelist of type names (supports * wildcard) |
exclude | string[] | no | Blacklist of type names (supports * wildcard) |
struct_style | interface | type | interface | Struct output format |
embed_strategy | flatten | extends | intersection | extends | Embedded struct rendering |