# Firmeve

```
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.(那些一事无成的人总是告诉你，你也成不了大器，如果你有理想的话，就要去捍卫它。)

[![Build Status](https://travis-ci.com/firmeve/firmeve.svg?branch=develop)](https://travis-ci.com/firmeve/firmeve) [![codecov](https://codecov.io/gh/firmeve/firmeve/branch/develop/graph/badge.svg)](https://codecov.io/gh/firmeve/firmeve) [![GitHub license](https://img.shields.io/github/license/firmeve/firmeve.svg)](https://github.com/firmeve/firmeve/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/firmeve/firmeve)](https://goreportcard.com/report/github.com/firmeve/firmeve)

## Quick start

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

![base](https://2239516904-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ly4c0RRnYSeNX1-cTeP%2F-M3svcj5H9b4yNBljWlq%2F-M3svmMNOUhv54ioMHGJ%2Fbase.png?generation=1585798130029685\&alt=media)

## Docs

<https://docs.firmeve.com/v/develop/>

## Example

```go
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

```bash
go run main.go http:serve
```

## Feature list

* **Core**
  * [x] [Kernel](https://github.com/firmeve/firmeve/tree/ca7880f5acc65367859ecc848bc0a9826b513107/docs/zh-CN/kernel.md)
  * [x] [Container](https://docs.firmeve.com/he-xin-zu-jian/container)
  * [x] [Application](https://docs.firmeve.com/he-xin-zu-jian/app)
  * [x] [Config](https://docs.firmeve.com/he-xin-zu-jian/config)
  * [x] [Provider](https://docs.firmeve.com/he-xin-zu-jian/provider)
  * [x] [Event](https://docs.firmeve.com/he-xin-zu-jian/event)
  * [x] [Logger](https://docs.firmeve.com/he-xin-zu-jian/logger)
  * [x] [Command](https://docs.firmeve.com/he-xin-zu-jian/command)
* **Base**
  * [x] [Http](https://docs.firmeve.com/ji-chu-zu-jian/http)
  * [x] [Database](https://github.com/firmeve/firmeve/tree/ca7880f5acc65367859ecc848bc0a9826b513107/docs/zh-CN/databases.md)
  * [x] [Cache](https://docs.firmeve.com/ji-chu-zu-jian/cache)
  * [ ] [Queue](https://docs.firmeve.com/ji-chu-zu-jian/queue)
  * [ ] [Cron](https://docs.firmeve.com/ji-chu-zu-jian/cron)
* **Extension**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firmeve.com/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
