scaffold

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scaffold 实现 appkit new / appkit dev: 生成域仓库与组合仓库骨架(embed 模板 + text/template), 以及本地多仓联调的 go.work 维护。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dev

func Dev(dir, root string, out io.Writer) error

Dev 维护本地多仓联调工作区(appkit dev):

  • 在 dir 下 go work init(已有 go.work 则跳过,幂等);
  • 扫描 root 下含 go.mod 的一级子目录,连同 dir 自身逐个 go work use。

go.work 不提交(骨架 .gitignore 已忽略);发版联动走 require + Renovate。

func Domain

func Domain(o Options, out io.Writer) error

Domain 生成业务域仓库骨架。out 承接进度输出(可为 nil)。

func System

func System(o Options, out io.Writer) error

System 生成组合仓库骨架。out 承接进度输出(可为 nil)。

Types

type Options

type Options struct {
	// Name 是域名/系统名,须匹配 ^[a-z][a-z0-9]*$(业务包名 = Postgres schema)。
	Name string
	// Module 是生成仓库的 module path,空则默认 github.com/forgeplex/<name>。
	Module string
	// Dir 是输出目录,空则默认 ./<name>。目录已存在且非空时报错。
	Dir string
	// AppkitVersion 是写进 go.mod 的 appkit 版本(取 cli.Version());
	// "(devel)" 表示源码构建:go.mod 不 require appkit(对不存在版本的
	// require 会让 go 命令去代理拉取而失败),改由 appkit dev 的 go.work 提供。
	AppkitVersion string
	// Partitioned 生成「分区域域」形态(仅 domain):一套代码、N 份数据分区,
	// 迁移与查询全部无 schema 前缀,落位由组合根注入的分区映射(租户 → schema)
	// 经事务级 search_path 路由确定。分区映射的定义放组合根自己的配置文件。
	Partitioned bool
}

Options 是 appkit new 的输入。

Jump to

Keyboard shortcuts

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