boot

package
v0.0.0-...-4877f23 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(appName string, version string, args []string, enablers *Enablers, builder *BeanBuilder, fn InitDelegateFunc) error

Types

type ApplicationContext

type ApplicationContext struct {
	AppName                      string
	AppVersion                   string
	LogLevel                     string
	CmdArgs                      []string
	Enablers                     *Enablers
	HttpConfig                   *HttpConfig
	GrpcConfig                   *GrpcConfig
	SecurityConfig               *SecurityConfig
	DatabaseConfig               *DatabaseConfig
	Environment                  environment.Environment
	DatasourceContext            datasource.Context
	DatasourceConnection         datasource.Connection[*gorm.DB]
	DatasourceTransactionHandler datasource.TransactionHandler[*gorm.DB]
	PasswordEncoder              security.PasswordEncoder
	PasswordGenerator            security.PasswordGenerator
	PasswordManager              security.PasswordManager
	PrincipalManager             security.PrincipalManager
	TokenManager                 security.TokenManager
	AuthenticationService        security.AuthenticationService
	AuthenticationEndpoint       security.AuthenticationEndpoint
	AuthorizationService         security.AuthorizationService
	AuthorizationFilter          security.AuthorizationFilter
	PublicRouter                 *gin.Engine
	PrivateRouter                *gin.RouterGroup
	GrpcServiceDesc              *grpc.ServiceDesc
	GrpcServiceServer            any
}

func NewApplicationContext

func NewApplicationContext(appName string, version string, args []string, enablers *Enablers, builder *BeanBuilder) *ApplicationContext

func (*ApplicationContext) Stop

func (ctx *ApplicationContext) Stop()

type AuthenticationEndpointBuilderFunc

type AuthenticationEndpointBuilderFunc func(appCtx *ApplicationContext) security.AuthenticationEndpoint

type AuthenticationServiceBuilderFunc

type AuthenticationServiceBuilderFunc func(appCtx *ApplicationContext) security.AuthenticationService

type AuthorizationFilterBuilderFunc

type AuthorizationFilterBuilderFunc func(appCtx *ApplicationContext) security.AuthorizationFilter

type AuthorizationServiceBuilderFunc

type AuthorizationServiceBuilderFunc func(appCtx *ApplicationContext) security.AuthorizationService

type BeanBuilder

type BeanBuilder struct {
	Environment                  EnvironmentBuilderFunc
	Config                       ConfigLoaderFunc
	DatasourceContext            DatasourceContextBuilderFunc
	DatasourceConnection         DatasourceConnectionBuilderFunc
	DatasourceTransactionHandler DatasourceTransactionHandlerBuilderFunc
	PasswordEncoder              PasswordEncoderBuilderFunc
	PasswordGenerator            PasswordGeneratorBuilderFunc
	PasswordManager              PasswordManagerBuilderFunc
	PrincipalManager             PrincipalManagerBuilderFunc
	TokenManager                 TokenManagerBuilderFunc
	AuthenticationService        AuthenticationServiceBuilderFunc
	AuthorizationService         AuthorizationServiceBuilderFunc
	AuthenticationEndpoint       AuthenticationEndpointBuilderFunc
	AuthorizationFilter          AuthorizationFilterBuilderFunc
	HttpServer                   HttpServerBuilderFunc
	GrpcServer                   GrpcServerBuilderFunc
}

func NewBeanBuilder

func NewBeanBuilder(ctx context.Context) *BeanBuilder

type ConfigLoaderFunc

type ConfigLoaderFunc func(appCtx *ApplicationContext)

type DatabaseConfig

type DatabaseConfig struct {
	DatasourceUrl      *string
	DatasourceUsername *string
	DatasourcePassword *string
	DatasourceServer   *string
	DatasourceService  *string
}

type DatasourceConnectionBuilderFunc

type DatasourceConnectionBuilderFunc func(appCtx *ApplicationContext) datasource.Connection[*gorm.DB]

type DatasourceContextBuilderFunc

type DatasourceContextBuilderFunc func(appCtx *ApplicationContext) datasource.Context

type DatasourceTransactionHandlerBuilderFunc

type DatasourceTransactionHandlerBuilderFunc func(appCtx *ApplicationContext) datasource.TransactionHandler[*gorm.DB]

type Enablers

type Enablers struct {
	HttpServerEnabled bool
	GrpcServerEnabled bool
	DatabaseEnabled   bool
}

type EnvironmentBuilderFunc

type EnvironmentBuilderFunc func(appCtx *ApplicationContext) environment.Environment

type GrpcConfig

type GrpcConfig struct {
	Host *string
	Port *string
}

type GrpcServerBuilderFunc

type GrpcServerBuilderFunc func(appCtx *ApplicationContext) (*grpc.ServiceDesc, any)

type HttpConfig

type HttpConfig struct {
	Host            *string
	Port            *string
	SwaggerPort     *string
	CorsAllowOrigin *string
}

type HttpServerBuilderFunc

type HttpServerBuilderFunc func(appCtx *ApplicationContext) (*gin.Engine, *gin.RouterGroup)

type InitDelegateFunc

type InitDelegateFunc func(ctx ApplicationContext) error

type PasswordEncoderBuilderFunc

type PasswordEncoderBuilderFunc func(appCtx *ApplicationContext) security.PasswordEncoder

type PasswordGeneratorBuilderFunc

type PasswordGeneratorBuilderFunc func(appCtx *ApplicationContext) security.PasswordGenerator

type PasswordManagerBuilderFunc

type PasswordManagerBuilderFunc func(appCtx *ApplicationContext) security.PasswordManager

type PrincipalManagerBuilderFunc

type PrincipalManagerBuilderFunc func(appCtx *ApplicationContext) security.PrincipalManager

type SecurityConfig

type SecurityConfig struct {
	TokenSignatureKey       *string
	TokenVerificationKey    *string
	PasswordMinSpecialChars *string
	PasswordMinNumber       *string
	PasswordMinUpperCase    *string
	PasswordLength          *string
}

type TokenManagerBuilderFunc

type TokenManagerBuilderFunc func(appCtx *ApplicationContext) security.TokenManager

Jump to

Keyboard shortcuts

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