common

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

magefile-common

Magefile Common Targets

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientDirs []string
View Source
var DirsToCleanUp []string
View Source
var DockerfileSettings []*DockerfileParams
View Source
var GobinPkgs []*GobinPkgParams
View Source
var LoadEnv = func() {}
View Source
var MainPackage string

Functions

func Air

func Air() error

Air launches the server process and keeps it live-reloading.

func Bufgen

func Bufgen() error

Bufgen generates protocol buffer binding code.

func Clean

func Clean()

Clean cleans up generated files.

func Dev

func Dev()

Dev is an alias for 'air'.

func Dockerfiles

func Dockerfiles() error

Dockerfiles generates dockerfiles from the template.

func Exec

func Exec(command string) error

Exec (command string) executes the given command prioritizing binaries in .gobin/ directory.

func Gen

func Gen() error

Gen generates binding codes.

func Gobin

func Gobin(name string) error

Gobin installs the Go binary with the given command name or package name.

func Gobins

func Gobins()

Gobins installs necessary Go binaries.

func Lint

func Lint() error

Lint analyses.

func Pbgen

func Pbgen()

Pbgen is an alias of 'bufgen'.

func Psql

func Psql() error

Psql executes psql(1) command on the database defined in .env* file

func Pwhash

func Pwhash(password string)

Pwhash (password string) prints the bcrypt hash of the specified argument.

func RunWith

func RunWith(env map[string]string, cmd string, args ...string) error

RunWith runs the given command prioritizing binaries in .gobin/ directory. It is not a task function.

func Start

func Start()

Start is an alias for 'air'.

Types

type AirInfoParams

type AirInfoParams struct {
	BuildPackage string
	TargetEnv    string
	ExcludeDirs  []string
}
var AirInfo *AirInfoParams

type Build

type Build mg.Namespace

func (Build) Cross

func (Build) Cross(goarch string) error

Cross (goarch string) builds a binary for a specified architecture.

func (Build) Native

func (Build) Native() error

Native builds the main binary for the current environment.

type Client

type Client mg.Namespace

func (Client) Build

func (Client) Build() error

Build builds web client application.

type Db

type Db mg.Namespace

func (Db) Converge

func (Db) Converge() error

Converge converges a PostgreSQL database.

func (Db) Create

func (Db) Create() error

Create creates a new PostgreSQL database.

func (Db) Down

func (Db) Down() error

Down rolls back the database version by 1.

func (Db) Drop

func (Db) Drop() error

Drop drops a PostgreSQL database if exists.

func (Db) Dump

func (Db) Dump() error

Dump dumps a database.

func (Db) Fix

func (Db) Fix() error

Fix applies sequential ordering to migrations.

func (Db) Migrate

func (db Db) Migrate() error

Migrate migrates the database to the most recent version available.

func (Db) New

func (Db) New(name string) error

New (name string) creates a new migration file with the current timestamp.

func (Db) Reset

func (Db) Reset() error

Reset rolls back all migrations.

func (Db) Seed

func (Db) Seed() error

Seed inserts seed data into the database.

func (Db) Up

func (Db) Up() error

Up migrates the database up by 1.

type DockerfileParams

type DockerfileParams struct {
	Filename string
	Goarch   string
	Prebuilt bool
}

type Env

type Env mg.Namespace

func (Env) Compose

func (Env) Compose()

Compose prints text in the .env format that references the Docker Compose configuration.

func (Env) Print

func (Env) Print(host string, port int, user, password, database string)

Print (host string, port int, user, password, database string) prints text in the .env format that references the CDK configuration.

type GobinPkgParams

type GobinPkgParams struct {
	Name    string
	Version string
	Tags    string
}

type Sqlc

type Sqlc mg.Namespace

func (Sqlc) Gen

func (Sqlc) Gen() error

Gen generates sqlc queries code.

func (Sqlc) Vet

func (Sqlc) Vet() error

Vet runs queries through a set of lint rules.

Jump to

Keyboard shortcuts

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