application

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	UrlPrefix string `json:"url_prefix" yaml:"url_prefix"`
	Port      string `json:"port" yaml:"port"`
}

type App

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

func New

func New(api *api.Api, i *infrastructure.Infrastructure) *App

New 创建Application

func (*App) Api

func (app *App) Api() *api.Api

Api 获取api实例

func (*App) ChooseRouter

func (app *App) ChooseRouter(routerType string, version string) api.Router

ChooseRouter 选择Router

func (*App) Finish

func (app *App) Finish() error

Finish 终止应用

func (*App) Infrastructure

func (app *App) Infrastructure() *infrastructure.Infrastructure

Infrastructure 获取Infrastructure实例

func (*App) Logger

func (app *App) Logger() *logger.Logger

Logger 获取logger实例

func (*App) Start

func (app *App) Start() error

Start 运行应用

type Config

type Config struct {
	ApiConfig            `json:"api" yaml:"api"`
	InfrastructureConfig `json:"infrastructure" yaml:"infrastructure"`
}

func LoadFromJson

func LoadFromJson(jsonStr string) (Config, error)

func LoadFromJsonFile

func LoadFromJsonFile(jsonFilePath string) (Config, error)

func LoadFromYaml

func LoadFromYaml(yamlStr string) (Config, error)

func LoadFromYamlFile

func LoadFromYamlFile(yamlFilePath string) (Config, error)

type InfoIDField

type InfoIDField struct {
	ID string `json:"id" sqlresult:"column:id"`
}

type InfoTenantIDField

type InfoTenantIDField struct {
	TenantID string `json:"tenantId" sqlresult:"column:tenant_id"`
}

type InfoTimeFields

type InfoTimeFields struct {
	CreatedTime     string `json:"createdTime" sqlresult:"column:created_time;parseTime:'2006-01-02 15:04:05'"`
	LastUpdatedTime string `json:"lastUpdatedTime" sqlresult:"column:last_updated_time;parseTime:'2006-01-02 15:04:05'"`
}

type InfoUserIDFields

type InfoUserIDFields struct {
	CreateUserID     string `json:"createUserId" sqlresult:"column:create_user_id;"`
	LastUpdateUserID string `json:"lastUpdateUserId" sqlresult:"column:last_update_user_id;"`
}

type InfrastructureConfig

type InfrastructureConfig struct {
	Database infrastructure.DatabaseConfig `json:"database" yaml:"database"`
}

Jump to

Keyboard shortcuts

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