pike

package
v0.0.0-...-e403533 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoCamelCase

func GoCamelCase(s string) string

GoCamelCase camel-cases a protobuf name for use as a Go identifier.

If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case.

Types

type Entity

type Entity struct {
	Name   string  `yaml:"name"`
	Fields []Field `yaml:"fields"`

	SQLTableOverride string `yaml:"sql_table_name"`
}

func (Entity) FieldsForInsert

func (e Entity) FieldsForInsert() (fields []Field)

func (Entity) NonPrimaryKeyFields

func (e Entity) NonPrimaryKeyFields() (fields []Field)

func (Entity) PrimaryKeyField

func (e Entity) PrimaryKeyField() Field

func (Entity) ProtoCapsName

func (e Entity) ProtoCapsName() string

func (Entity) SQLTableName

func (e Entity) SQLTableName() string

func (Entity) Validate

func (e Entity) Validate() error

type Field

type Field struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`

	SQLTypeOverride string `yaml:"sql_type"`

	IsPrimaryKey bool `yaml:"primary_key"`
}

func (Field) GoName

func (f Field) GoName() string

func (Field) GoType

func (f Field) GoType() string

func (Field) SQLType

func (f Field) SQLType() string

type Project

type Project struct {
	Name     string   `yaml:"name"`
	Entities []Entity `yaml:"entities"`

	GoImportPath string `yaml:"go_import_path"`

	OverrideConfigEnvVar string `yaml:"config_env_var"`
}

func ProjectFromYAMLString

func ProjectFromYAMLString(yamlStr string) (proj Project, err error)

func (Project) AbsolutePath

func (p Project) AbsolutePath() string

func (Project) CheckDirectoryNotPresent

func (p Project) CheckDirectoryNotPresent()

func (Project) CompileProtobuf

func (p Project) CompileProtobuf()

func (Project) ConfigEnvVariable

func (p Project) ConfigEnvVariable() string

func (Project) CreateDirectories

func (p Project) CreateDirectories()

func (Project) GenerateBinScripts

func (p Project) GenerateBinScripts(path string)

func (Project) GenerateConfigFiles

func (p Project) GenerateConfigFiles(path string)

func (Project) GenerateGoFiles

func (p Project) GenerateGoFiles(path string)

func (Project) GenerateLauncher

func (p Project) GenerateLauncher(path string)

func (Project) GenerateProto

func (p Project) GenerateProto(path string)

func (Project) GenerateSQLMigrations

func (p Project) GenerateSQLMigrations(path string)

func (Project) PrintOutro

func (p Project) PrintOutro()

func (Project) ProtoCapsName

func (p Project) ProtoCapsName() string

func (Project) RunGoModInit

func (p Project) RunGoModInit()

func (Project) RunGoModTidy

func (p Project) RunGoModTidy()

func (Project) Validate

func (p Project) Validate()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL