Firmeve
1.0.0
1.0.0
  • Firmeve
  • [核心组件]
    • 应用
    • 容器
    • 配置
    • 提供者
    • 事件
    • 日志
    • 命令
  • [基础组件]
    • Http服务
    • 数据验证
    • 数据库
    • 缓存
    • JWT
    • Redis
    • 辅助函数
    • 队列
    • 计划任务
Powered by GitBook
On this page
  • Quick start
  • Docs
  • Example
  • Feature list

Was this helpful?

Firmeve

Next[核心组件]

Last updated 4 years ago

Was this helpful?

Firmeve = Firm + Believe

Be firm in your will and believe in your ideals.(坚定自己的意志,相信自己的理想。)

Those who have achieved nothing can always tell you that you can't make a big deal. If you have an ideal, you have to defend it.(那些一事无成的人总是告诉你,你也成不了大器,如果你有理想的话,就要去捍卫它。)

Quick start

go get -u github.com/firmeve/firmeve@develop

Docs

Example

package main

import (
    "fmt"
    "github.com/firmeve/firmeve"
    "github.com/firmeve/firmeve/http"
    "github.com/firmeve/firmeve/kernel/contract"
    "github.com/firmeve/firmeve/render"
)

func main() {
    firmeve.RunWithSupportFunc(
        application,
        firmeve.WithConfigPath("./config.yaml"),
        firmeve.WithProviders([]contract.Provider{
            new(http.Provider),
        }),
        firmeve.WithCommands([]contract.Command{
            new(http.HttpCommand),
        }),
    )
}

func application(application contract.Application) {
    router := application.Resolve(`http.router`).(contract.HttpRouter)
    router.GET("/", func(c contract.Context) {
        fmt.Printf("%t", c.Firmeve() == firmeve.Application)
        c.RenderWith(200, render.JSON, map[string]string{
            "ctx_application":    fmt.Sprintf("%p", c.Firmeve()),
            "global_application": fmt.Sprintf("%p", firmeve.Application),
        })

        c.Next()
    })

    v1 := router.Group("/api/v1")
    {
        v1.GET(`/ping`, func(c contract.Context) {
            c.RenderWith(200, render.JSON, map[string]string{
                "message": "pong",
            })
            c.Next()
        })
    }
}

Bootstrap command

go run main.go http:serve

Feature list

  • Core

  • Base

  • Extension

https://docs.firmeve.com/v/develop/
Kernel
Container
Application
Config
Provider
Event
Logger
Command
Http
Database
Cache
Queue
Cron
Build Status
codecov
GitHub license
base
Go Report Card