starter

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 15 Imported by: 37

README

Starter Framework

Starter 是一个用 Go(Golang) 实现的依赖注入应用框架。它通过代码生成的方式工作,避免了反射对性能的影响,以及在某些情况下产生的兼容性问题。

安装

在安装 Starter 包之前, 需要先安装Go开发环境并准备一个基本的Go工程。

  1. 首先安装 Go 开发环境 (需要 1.16 或更新的版本), 然后你就能通过下列命令来安装 Starter 了。

     $ go get -u github.com/bitwormhole/starter
    
  2. 把它导入到你的代码:

     import "github.com/bitwormhole/starter"
    

快速开始

在工程文件夹下新建一个源文件,例如:example.go, 然后输入下列代码。

package main

import "github.com/bitwormhole/starter"

func main() {
    i := starter.InitApp()
    i.Use(starter.Module())
    i.Run()
}

运行这个例子:

$ go run example.go

更多

要了解更多内容,请访问: https://bitwormhole.com/starter/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitApp

func InitApp() application.Initializer

InitApp 开始初始化应用程序

func Module

func Module() application.Module

Module 函数用于导出本模块

Types

This section is empty.

Directories

Path Synopsis
Package application 是starter的核心包之一,里面包含了大部分用来管理应用程序生命周期的组件。
Package application 是starter的核心包之一,里面包含了大部分用来管理应用程序生命周期的组件。
docs
io
fs
src
Package vlog (Virtual Logger) 是一组抽象的日志接口,为程序提供统一的日志调用方式。
Package vlog (Virtual Logger) 是一组抽象的日志接口,为程序提供统一的日志调用方式。
std

Jump to

Keyboard shortcuts

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