common

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DirsToCleanUp []string
View Source
var MainPackage string

Functions

func AddGenFn

func AddGenFn(fn any)

AddGenFn adds a function to the list of functions to generate something.

func AddLintFn

func AddLintFn(fn any)

AddLintFn adds a function to the list of functions to lint something.

func Air

func Air() error

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

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 Generate

func Generate() error

Generate is an alias for Gen.

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 Gogen

func Gogen(target string, _ ...any) error

Gogen generates code using go-generate-fast.

func Lint

func Lint() error

Lint analyses.

func Pwhash

func Pwhash(password string)

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

func RunWith

func RunWith(dir string, 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 SetClientDirBases

func SetClientDirBases(dirBases ...string)

func SetDockerfiles

func SetDockerfiles(dockerfiles_ ...*Dockerfile)

func SetGobinPkgs

func SetGobinPkgs(pkgs ...*GobinPkg)

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: such as “amd64”, “arm64”) builds a binary for a specified architecture. Known architectures: https://github.com/golang/go/blob/105ac94486f243fc478c3a146d836302a95cdbbc/src/go/build/syslist.go#L54

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() (err error)

Build builds web client application.

type Dockerfile

type Dockerfile 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 GobinPkg

type GobinPkg struct {
	Name    string
	Version string
	Tags    string
}

type Pb

type Pb mg.Namespace

func (Pb) Gen

func (Pb) Gen() (err error)

Gen generates protocol buffer binding code.

type Sqlc

type Sqlc mg.Namespace

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