biz

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 7 Imported by: 0

README

Biz 层

Biz 目录下包含了 v1v2 这类版本化的目录及每个资源独占一个目录,原因如下:

  1. 随着产品功能的迭代,业务逻辑可能会出现不兼容变更,也即可能会出现 v2 版本,所以 Biz 目录下包含了v1v2 这类版本化目录;
  2. Biz 层用来处理业务逻辑,代码量大,为了便于维护代码,在 Biz 层,将不同资源存放在单独的目录中,例如:v1/postv1/user

Documentation

Overview

Package biz is the place where you can implements more complex business logic.

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewBiz, wire.Bind(new(IBiz), new(*biz)))

ProviderSet is a Wire provider set used to declare dependency injection rules. Includes the NewBiz constructor to create a biz instance. wire.Bind binds the IBiz interface to the concrete implementation *biz, so places that depend on IBiz will automatically inject a *biz instance.

Functions

func NewBiz

func NewBiz(store store.IStore, authn authn.Authenticator, auth auth.AuthProvider) *biz

NewBiz creates an instance of IBiz.

Types

type IBiz

type IBiz interface {
	// UserV1 returns the UserBiz business interface.
	UserV1() userv1.UserBiz
	// SecretV1 returns the SecretBiz business interface.
	SecretV1() secretv1.SecretBiz
	// AuthV1 returns the AuthBiz business interface.
	AuthV1() authv1.AuthBiz
}

IBiz defines the methods that must be implemented by the business layer.

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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