opz

package
v0.0.0-...-66d1a48 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GraphQURL = &NodeTool{
		Packages: map[string]string{
			"graphqurl": "1.0.1",
		},
		Command: "graphqurl",
	}

	GraphQLCodeGen = &NodeTool{
		Packages: map[string]string{
			"@graphql-codegen/cli":                     "2.6.2",
			"@graphql-codegen/typescript":              "2.4.8",
			"@graphql-codegen/typescript-operations":   "2.3.5",
			"@graphql-codegen/typescript-react-apollo": "3.2.11",
			"graphql":     "15.8.0",
			"graphql-tag": "2.12.6",
		},
		Command: "graphql-codegen",
	}
)

Known node tools.

Functions

func ApplyPostgresHasuraMigrations

func ApplyPostgresHasuraMigrations(pgURL string, embedFS embed.FS, embedMigrationsDirPath string)

ApplyPostgresHasuraMigrations applies the Hasura migrations to the given Postgres database URL. Note that this is a partial implementation for testing purposes: - It does not check against nor update the "hdb_catalog.hdb_version" table. - It blindly applies all the migrations in a single transaction.

func NewSQLBoilerORMTypeReplace

func NewSQLBoilerORMTypeReplace(table, column string, nullable bool, fullType string) boilingcore.TypeReplace

NewSQLBoilerORMTypeReplace generates a new TypeReplace for th SQLBoiler ORM generator.

func RevertPostgresHasuraMigrations

func RevertPostgresHasuraMigrations(pgURL string, embedFS embed.FS, embedMigrationsDirPath string)

RevertPostgresHasuraMigrations reverts the Hasura migrations to the given Postgres database URL. Note that this is a partial implementation for testing purposes: - It does not check against nor update the "hdb_catalog.hdb_version" table. - It blindly reverts all the migrations in a single transaction.

Types

type GoTool

type GoTool string

GoTool describes a Go tool.

const (
	GoCov       GoTool = "github.com/axw/gocov/gocov@v1.0.0"
	GoCovHTML   GoTool = "github.com/matm/gocov-html@v0.0.0-20200509184451-71874e2e203b"
	GoLint      GoTool = "golang.org/x/lint/golint@v0.0.0-20210508222113-6edffad5e616"
	GoTest      GoTool = "github.com/rakyll/gotest@v0.0.6"
	StaticCheck GoTool = "honnef.co/go/tools/cmd/staticcheck@2022.1"
)

Known Go tools.

type NodeTool

type NodeTool struct {
	Packages map[string]string
	Command  string
}

NodeTool describes a Node tool.

type Operations

type Operations interface {
	GenerateCommitVersion() string
	GenerateTimestampAndCommitVersion() string
	GetGoToolCommand(goTool GoTool) *shellz.Command
	GetNodeToolCommand(nodeTool *NodeTool) *shellz.Command
	GoTest(rootDirPath string, packages []string, filter string, force, cover bool)
	GoCrossBuildForLinuxAMD64(workDirPath, packageName, binFilePath string, injectValues map[string]string)
	PackageLambdaFunctionHandler(handlerFilePath, functionHandlerFileName, packageFilePath string)

	UploadFile(bucketName, key, contentType string, body []byte)
	Decrypt(keyAlias string, ciphertext []byte) []byte
	Encrypt(keyAlias string, plaintext []byte) []byte
	CreateStack(name string, templateBody string, tagsMap map[string]string) *awscft.Stack
	DescribeStack(name string) *awscft.Stack
	UpdateStack(name string, templateBody string, tagsMap map[string]string) *awscft.Stack
	UpsertStack(name string, templateBody string, tagsMap map[string]string) *awscft.Stack
	DockerLoginToECR()

	GenerateHasuraGraphQLSchema(hsURL, adminSecret, role, outFilePath string)
	GenerateHasuraGraphQLEnumsGoBinding(schemaFilePath, outDirPath string)
	GenerateHasuraGraphQLEnumsJSONBinding(schemaFilePath, outFilePath string)
	GenerateHasuraGraphQLTypescriptBinding(schemaFilePath, queriesGlobPath, outFilePath string)

	GeneratePostgresSQLBoilerORM(pgURL string, outDirPath string, options ...SQLBoilerORMOption)
	GenerateSQLiteSQLBoilerORM(dbSpec string, outDirPath string, options ...SQLBoilerORMOption)
	ApplyPostgresHasuraMigrations(pgURL string, embedFS embed.FS, embedMigrationsDirPath string)
	RevertPostgresHasuraMigrations(pgURL string, embedFS embed.FS, embedMigrationsDirPath string)
}

Operations implements various ops-related tasks.

func NewOperations

func NewOperations(buildDirPath string, awsCfg *aws.Config) Operations

NewOperations initializes a new Operations.

type SQLBoilerORMOption

type SQLBoilerORMOption func(options *sqlBoilerORMOptions)

SQLBoilerORMOption describes an option for the SQLBoiler ORM generator.

func SQLBoilerORMOptionBlacklist

func SQLBoilerORMOptionBlacklist(blacklist ...string) SQLBoilerORMOption

SQLBoilerORMOptionBlacklist is a SQLBoiler ORM generator option.

func SQLBoilerORMOptionTableAliases

func SQLBoilerORMOptionTableAliases(tableAliases map[string]boilingcore.TableAlias) SQLBoilerORMOption

SQLBoilerORMOptionTableAliases is a SQLBoiler ORM generator option.

func SQLBoilerORMOptionTypeReplaces

func SQLBoilerORMOptionTypeReplaces(typeReplaces ...boilingcore.TypeReplace) SQLBoilerORMOption

SQLBoilerORMOptionTypeReplaces is a SQLBoiler ORM generator option.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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