Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit d044e3a

Browse files
committed
comments
1 parent 8e18483 commit d044e3a

10 files changed

Lines changed: 56 additions & 3 deletions

File tree

‎common/auth.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB common/auth.go -- define auth algorithm
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
import (
@@ -11,8 +16,10 @@ import (
1116
"github.com/astaxie/beego/context"
1217
)
1318

19+
//AuthExpireDuration is 10 minutes
1420
const AuthExpireDuration = 10 * time.Minute
1521

22+
//Auth whether http request is valid.
1623
func AuthWithKey(ctx *context.Context) error {
1724
key := beego.AppConfig.String("loginkey")
1825
sTime := ctx.Input.Header("Date")

‎common/consts.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
/*ModuleAB common/auth.go -- define auth algorithm
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
const (
9+
//RelDepth is defined for query in database.
410
RelDepth = 5
511
)

‎common/oas.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB common/oas.go -- Aliyun OAS instance
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
import (
@@ -7,10 +12,12 @@ import (
712
"github.com/tonychee7000/oas"
813
)
914

15+
//OasClient is encapsulation for Aliyun OAS instance.
1016
type OasClient struct {
1117
*oas.OasClient
1218
}
1319

20+
//GetOasVaultId get OAS Vault ID
1421
func (o *OasClient) GetOasVaultId(name string) (string, error) {
1522
v := new(oas.VaultsList)
1623
for {
@@ -32,6 +39,7 @@ func (o *OasClient) GetOasVaultId(name string) (string, error) {
3239
}
3340
}
3441

42+
//NewOasClient make a new OAS instance.
3543
func NewOasClient(endpoint string) (*OasClient, error) {
3644
oasPort := beego.AppConfig.DefaultInt("aliapi::oasport", 80)
3745
oasUseSSL := beego.AppConfig.DefaultBool("aliapi::oasusessl", false)

‎common/oss.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB common/oss.go -- Aliyun OSS instance.
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
import (

‎common/password.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB common/password.go -- encrypt password with sha1.
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
import (

‎common/redis.go‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
/*ModuleAB common/redis.go -- connect to redis.
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package common
27

38
import (
49
"encoding/json"
510

611
"github.com/astaxie/beego"
712
"github.com/astaxie/beego/cache"
8-
_ "github.com/astaxie/beego/cache/redis"
13+
_ "github.com/astaxie/beego/cache/redis" // redis driver
914
)
1015

1116
const DefaultRedisKey = "ModuleAB"

‎main.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/* ModulesAB server
2-
* TonyChyi <[email protected]>
1+
/*ModuleAB server
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
34
*/
45
package main
56

‎policies/policies.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB policies/policies.go -- Running policies.
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package policies
27

38
import (

‎routers/router.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB routers/router.go -- all http router here.
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
// @APIVersion 1.0.0
27
// @Title ModuleAB API
38
// @Description ModuleAB server API

‎version/version.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*ModuleAB version/version.go -- define version
2+
* Copyright (C) 2016 TonyChyi <[email protected]>
3+
* License: GPL v3 or later.
4+
*/
5+
16
package version
27

38
import (
@@ -23,6 +28,7 @@ func (v version) String() string {
2328
return fmt.Sprintf("%s-%s", v.GetVersion(), v.GetCode())
2429
}
2530

31+
//Version is global version instance.
2632
var Version version
2733

2834
func init() {

0 commit comments

Comments
 (0)