Help us shape the future of Go! Take the 2026 Go Developer Survey

projectaccess

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeGuard

type ChangeGuard func(context.Context, []ProjectKey, func(context.Context) error) error

ChangeGuard 由业务模块持有业务锁并完成校验,再执行公共项目变更及其事务提交。

type Lifecycle

type Lifecycle struct {
	// contains filtered or unexported fields
}

Lifecycle 收集宿主业务模块对项目停用和删除的约束。

func NewLifecycle

func NewLifecycle() *Lifecycle

NewLifecycle 创建宿主共享的项目生命周期注册器。

func (*Lifecycle) Change

func (l *Lifecycle) Change(ctx context.Context, keys []ProjectKey, apply func(context.Context) error) error

Change 按稳定顺序持有各模块的业务锁,直到公共项目变更事务完成。

func (*Lifecycle) Register

func (l *Lifecycle) Register(name string, guard ChangeGuard) error

Register 在服务启动前注册具名业务校验,避免同一模块重复注册。

type ProjectKey

type ProjectKey struct {
	TenantID  int64
	ProjectID int64
}

ProjectKey 唯一标识所属租户下的公共项目。

Jump to

Keyboard shortcuts

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