-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
72 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
module github.com/alimy/mir/v2/examples | ||
module github.com/alimy/mir-example | ||
|
||
go 1.12 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/alimy/mir/v2 v2.7.0-alpha | ||
github.com/gin-gonic/gin v1.6.3 | ||
github.com/alimy/mir/v2 v2.7.2 | ||
github.com/gin-gonic/gin v1.7.7 | ||
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,11 @@ | ||
// Copyright 2019 Michael Li <alimy@gility.net>. All rights reserved. | ||
// Use of this source code is governed by Apache License 2.0 that | ||
// can be found in the LICENSE file. | ||
|
||
package servants | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/alimy/mir/v2/examples/mirc/auto/api" | ||
"github.com/gin-gonic/gin" | ||
) | ||
import "github.com/alimy/mir-example/mirc/auto/api" | ||
|
||
type emptySiteWithNoGroup struct { | ||
type siteSrv struct { | ||
api.UnimplementedSiteServant | ||
} | ||
|
||
func (emptySiteWithNoGroup) Chain() gin.HandlersChain { | ||
return gin.HandlersChain{gin.Logger()} | ||
} | ||
|
||
func (emptySiteWithNoGroup) Index(c *gin.Context) { | ||
c.String(http.StatusOK, "get index data") | ||
} | ||
|
||
func (emptySiteWithNoGroup) Articles(c *gin.Context) { | ||
c.String(http.StatusOK, "get articles data") | ||
} | ||
|
||
func newSiteSrv() api.Site { | ||
return &emptySiteWithNoGroup{} | ||
return &siteSrv{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,13 @@ | ||
// Copyright 2019 Michael Li <alimy@gility.net>. All rights reserved. | ||
// Use of this source code is governed by Apache License 2.0 that | ||
// can be found in the LICENSE file. | ||
|
||
package servants | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
|
||
api "github.com/alimy/mir/v2/examples/mirc/auto/api/v1" | ||
v1 "github.com/alimy/mir-example/mirc/auto/api/v1" | ||
) | ||
|
||
type emptySiteV1 struct { | ||
api.UnimplementedSiteServant | ||
} | ||
|
||
func (*emptySiteV1) Index(c *gin.Context) { | ||
c.String(http.StatusOK, "get index data (v1)") | ||
} | ||
|
||
func (*emptySiteV1) Articles(c *gin.Context) { | ||
c.String(http.StatusOK, "get articles data (v1)") | ||
type siteV1Srv struct { | ||
v1.UnimplementedSiteServant | ||
} | ||
|
||
func newSiteV1Srv() api.Site { | ||
return &emptySiteV1{} | ||
func newSiteV1Srv() v1.Site { | ||
return &siteV1Srv{} | ||
} |
Oops, something went wrong.