types

package
v0.0.0-...-65546df Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadParams = statuserr.Errorf("bad parameters").SetCode(400_001).SetStatus(status.BadRequest)

	ErrInternal = statuserr.Errorf("internal server error").SetCode(500_000).SetStatus(status.InternalServerError)
)
View Source
var Provider = wire.NewSet(
	wire.FieldsOf(new(Injector), "Config"),
	wire.FieldsOf(new(Injector), "Router"),
	wire.FieldsOf(new(Injector), "EntDB"),
	wire.FieldsOf(new(Injector), "Redis"),
	wire.FieldsOf(new(Injector), "Token"),
	wire.FieldsOf(new(Injector), "Email"),
	wire.FieldsOf(new(Injector), "MQ"),

	wire.FieldsOf(new(*conf.App), "Jwt"),
	wire.FieldsOf(new(*conf.App), "Email"),
	wire.FieldsOf(new(*conf.App), "Meta"),
)

Functions

This section is empty.

Types

type Injector

type Injector struct {
	// app configuration
	Config *conf.App
	// root router for http internal
	Router *ginx.RouterGroup
	// ent db client
	EntDB *ent.Client
	// redis client
	Redis *redis.Client
	// token resolver
	Token *token.Resolver
	// email client
	Email *email.Sender
	// message queue
	MQ mq.Queue
}

Injector holds all needed object for initializing app

type Response

type Response struct {
	Code  int    `json:"code"`
	Msg   string `json:"msg"`
	Data  any    `json:"data"`
	Error string `json:"error"`
}

Response is a basic http json response, just for document.

Jump to

Keyboard shortcuts

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