Documentation
¶
Overview ¶
package generation provides the ability to generate resource, handler, and typescript permissions and metadata code from a resource file.
Index ¶
- type Client
- type ClientOption
- func CaserInitialismOverrides(overrides map[string]bool) ClientOption
- func GenerateHandlers(targetDir string, overrides map[string][]HandlerType) ClientOption
- func GenerateTypescriptMetadata(rc *resource.Collection, targetDir string) ClientOption
- func GenerateTypescriptPermission(rc *resource.Collection, targetDir string) ClientOption
- func WithPluralOverrides(overrides map[string]string) ClientOption
- type ConstraintType
- type FieldMetadata
- type GeneratedFileDeleteMethod
- type HandlerType
- type InformationSchemaResult
- type OptionType
- type PatchType
- type TableMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.0.10
type Client struct {
// contains filtered or unexported fields
}
func (*Client) RunGeneration ¶ added in v0.0.10
type ClientOption ¶ added in v0.0.10
func CaserInitialismOverrides ¶ added in v0.0.10
func CaserInitialismOverrides(overrides map[string]bool) ClientOption
func GenerateHandlers ¶ added in v0.0.10
func GenerateHandlers(targetDir string, overrides map[string][]HandlerType) ClientOption
func GenerateTypescriptMetadata ¶ added in v0.0.10
func GenerateTypescriptMetadata(rc *resource.Collection, targetDir string) ClientOption
func GenerateTypescriptPermission ¶ added in v0.0.10
func GenerateTypescriptPermission(rc *resource.Collection, targetDir string) ClientOption
func WithPluralOverrides ¶ added in v0.0.10
func WithPluralOverrides(overrides map[string]string) ClientOption
type ConstraintType ¶
type ConstraintType string
const ( PrimaryKey ConstraintType = "PRIMARY KEY" ForeignKey ConstraintType = "FOREIGN KEY" )
type FieldMetadata ¶
type FieldMetadata struct {
ConstraintType ConstraintType
ColumnName string
SpannerType string
IsNullable bool
IsIndex bool
}
type GeneratedFileDeleteMethod ¶ added in v0.0.9
type GeneratedFileDeleteMethod int
const ( // Used to remove files with the suffix "_generated.go" instead of reading the contents of the file. Suffix GeneratedFileDeleteMethod = iota // Used to remove files that contain the header comment "// Code generated by resourcegeneration. DO NOT EDIT." HeaderComment )
type HandlerType ¶
type HandlerType string
const ( List HandlerType = "list" Read HandlerType = "read" Patch HandlerType = "patch" )
type InformationSchemaResult ¶
type InformationSchemaResult struct {
TableName string `spanner:"TABLE_NAME"`
ColumnName string `spanner:"COLUMN_NAME"`
ConstraintName *string `spanner:"CONSTRAINT_NAME"`
ConstraintType *string `spanner:"CONSTRAINT_TYPE"`
SpannerType string `spanner:"SPANNER_TYPE"`
IsNullable bool `spanner:"IS_NULLABLE"`
IsView bool `spanner:"IS_VIEW"`
IsIndex bool `spanner:"IS_INDEX"`
OrdinalPosition int64 `spanner:"ORDINAL_POSITION"`
}
type OptionType ¶
type OptionType string
const ( Regenerate OptionType = "regenerate" NoGenerate OptionType = "nogenerate" )
type TableMetadata ¶
type TableMetadata struct {
Columns map[string]FieldMetadata
IsView bool
}
Click to show internal directories.
Click to hide internal directories.