Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Always validate the PR title AND all the commits
titleAndCommits: true
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.18', '1.22', '1.25']
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}

- name: Check out code
uses: actions/checkout@v5

- name: Install dependencies
run: |
go mod download
- name: Run Unit tests
run: |
go test -race -covermode atomic -coverprofile=covprofile ./...
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=covprofile -service=github

semantic-release:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'

- name: Run semantic-release
if: github.repository == 'go-think/think' && github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
<strong>ThinkGo is a lightweight MVC framework written in Go (Golang).</strong>
</p>
<p align="center">
<a href="https://www.travis-ci.org/forgoer/thinkgo">
<a href="https://www.travis-ci.org/go-think/think">
<img src="https://www.travis-ci.org/forgoer/thinkgo.svg?branch=master" alt="Build Status">
</a>
<a href="https://coveralls.io/github/forgoer/thinkgo">
<img src="https://coveralls.io/repos/github/forgoer/thinkgo/badge.svg" alt="Coverage Status">
<a href="https://coveralls.io/github/go-think/think">
<img src="https://coveralls.io/repos/github/go-think/think/badge.svg" alt="Coverage Status">
</a>
</p>
<p align="center">
<a href="https://goreportcard.com/report/github.com/forgoer/thinkgo">
<img src="https://goreportcard.com/badge/github.com/forgoer/thinkgo" alt="Go Report Card">
<a href="https://goreportcard.com/report/github.com/go-think/think">
<img src="https://goreportcard.com/badge/github.com/go-think/think" alt="Go Report Card">
</a>
<a href="https://codeclimate.com/github/forgoer/thinkgo/maintainability">
<a href="https://codeclimate.com/github/go-think/think/maintainability">
<img src="https://api.codeclimate.com/v1/badges/c315fda3b07b5aef3529/maintainability" />
</a>
<a href="https://godoc.org/github.com/forgoer/thinkgo">
<img src="https://godoc.org/github.com/forgoer/thinkgo?status.svg" alt="GoDoc">
<a href="https://godoc.org/github.com/go-think/think">
<img src="https://godoc.org/github.com/go-think/think?status.svg" alt="GoDoc">
</a>
<a href="https://www.codetriage.com/forgoer/thinkgo">
<img src="https://www.codetriage.com/forgoer/thinkgo/badges/users.svg" alt="Open Source Helpers">
<a href="https://www.codetriage.com/go-think/think">
<img src="https://www.codetriage.com/go-think/think/badges/users.svg" alt="Open Source Helpers">
</a>
<a href="https://gitter.im/think-go/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
<img src="https://badges.gitter.im/think-go/community.svg" alt="Join the chat">
</a>
<a href="https://github.com/forgoer/thinkgo/releases">
<img src="https://img.shields.io/github/release/forgoer/thinkgo.svg" alt="Latest Stable Version">
<a href="https://github.com/go-think/think/releases">
<img src="https://img.shields.io/github/release/go-think/think.svg" alt="Latest Stable Version">
</a>
<a href="LICENSE">
<img src="https://img.shields.io/github/license/forgoer/thinkgo.svg" alt="License">
<img src="https://img.shields.io/github/license/go-think/think.svg" alt="License">
</a>
</p>

Expand All @@ -43,7 +43,7 @@
The only requirement is the [Go Programming Language](https://golang.org/dl/)

```
go get -u github.com/forgoer/thinkgo
go get -u github.com/go-think/think
```

## Quick start
Expand All @@ -54,8 +54,8 @@ package main
import (
"fmt"

"github.com/forgoer/thinkgo"
"github.com/forgoer/thinkgo/think"
"github.com/go-think/think"
"github.com/go-think/think/think"
)

func main() {
Expand Down Expand Up @@ -248,8 +248,8 @@ Below is an example of a basic controller class.
package controller

import (
"github.com/forgoer/thinkgo"
"github.com/forgoer/thinkgo/context"
"github.com/go-think/think"
"github.com/go-think/think/context"
)

func Index(req *context.Request) *context.Response {
Expand Down Expand Up @@ -426,7 +426,7 @@ type Handler interface {
Once your driver has been implemented, you are ready to register it:

```go
import "github.com/forgoer/thinkgo/session"
import "github.com/go-think/think/session"

session.Extend("my_session", MySessionHandler)
```
Expand All @@ -438,7 +438,7 @@ The logger provides the eight logging levels defined in [RFC 5424]( https://tool
#### Basic Usage

```go
import "github.com/forgoer/thinkgo/log"
import "github.com/go-think/log"

log.Debug("log with Debug")
log.Info("log with Info")
Expand All @@ -458,12 +458,12 @@ For example, if you wish to use `daily` log files, you can do this:

```go
import (
"github.com/forgoer/thinkgo/log"
"github.com/forgoer/thinkgo/log/handler"
"github.com/forgoer/thinkgo/log/record"
"github.com/go-think/log"
"github.com/go-think/log/handler"
"github.com/go-think/log/record"
)

fh := handler.NewFileHandler("path/to/thinkgo.log", record.INFO)
fh := handler.NewFileHandler("path/to/think.log", record.INFO)

log.GetLogger().PushHandler(fh)
```
Expand All @@ -476,18 +476,18 @@ ThinkGo Cache Currently supports redis, memory, and can customize the store adap

```go
import (
"github.com/forgoer/thinkgo/cache"
"github.com/go-think/cache"
"time"
)


var foo string

// Create a cache with memory store
c, _ := cache.Cache(cache.NewMemoryStore("thinkgo"))
c, _ := cache.Cache(cache.NewMemoryStore("think go"))

// Set the value
c.Put("foo", "thinkgo", 10 * time.Minute)
c.Put("foo", "think go", 10 * time.Minute)

// Get the string associated with the key "foo" from the cache
c.Get("foo", &foo)
Expand All @@ -506,11 +506,11 @@ cache.Remember("foo", &a, 1*time.Minute, func() interface{} {
})
```

refer to [ThinkGo Cache]( https://github.com/forgoer/thinkgo/tree/master/cache )
refer to [ThinkGo Cache]( https://github.com/go-think/think/tree/master/cache )

## ORM

refer to [ThinkORM]( https://github.com/forgoer/thinkorm )
refer to [ThinkORM]( https://github.com/go-think/think )

## License

Expand All @@ -519,5 +519,5 @@ This project is licensed under the [Apache 2.0 license](LICENSE).
## Contact

If you have any issues or feature requests, please contact us. PR is welcomed.
- https://github.com/forgoer/thinkgo/issues
- techqiang@gmail.com
- https://github.com/go-think/think/issues
- leeqvip@gmail.com
10 changes: 5 additions & 5 deletions think/app.go → app.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package think
package thinkgo

import (
"github.com/forgoer/thinkgo/log"
"github.com/forgoer/thinkgo/router"
"github.com/forgoer/thinkgo/view"
"github.com/go-think/think/contract"
"github.com/go-think/think/router"
"github.com/go-think/think/view"
)

// Application the ThinkGo Application
type Application struct {
Env string
Debug bool
Logger *log.Logger
Logger contract.Logger
view *view.View
route *router.Route
}
Expand Down
49 changes: 0 additions & 49 deletions cache/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions cache/cache.go

This file was deleted.

Loading
Loading