mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
完善包注释,便于godoc管理
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// from https://github.com/google/btree
|
||||
|
||||
|
||||
// B+ Tree
|
||||
package gbtree
|
||||
|
||||
import (
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
//
|
||||
|
||||
// 并发安全的双向链表
|
||||
package glist
|
||||
|
||||
import (
|
||||
|
||||
8
g/container/gmap/gmap.go
Normal file
8
g/container/gmap/gmap.go
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2017 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 并发安全的MAP
|
||||
package gmap
|
||||
8
g/container/gset/gset.go
Normal file
8
g/container/gset/gset.go
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2017 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 并发安全的SET
|
||||
package gset
|
||||
@ -3,9 +3,8 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
// 对常用关系数据库的封装管理包
|
||||
|
||||
// 关系数据库操作
|
||||
package gdb
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// BASE64
|
||||
package gbase64
|
||||
|
||||
import (
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 二进制及byte操作管理包
|
||||
|
||||
package gbinary
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 数据压缩/解压
|
||||
package gcompress
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// CRC32
|
||||
package gcrc32
|
||||
|
||||
import (
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 封装常用的hash函数
|
||||
|
||||
// 常用的hash函数
|
||||
package ghash
|
||||
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// HTML编码
|
||||
package ghtml
|
||||
|
||||
import "strings"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 强大的JSON解析/封装包
|
||||
package gjson
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// MD5
|
||||
package gmd5
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// SHA1
|
||||
package gsha1
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// URL编码
|
||||
package gurl
|
||||
|
||||
import "net/url"
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 全局配置管理对象,配置文件为json文件
|
||||
|
||||
package gcfg
|
||||
|
||||
import (
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
// 单例对象管理工具
|
||||
// 框架内置了一些核心对象,并且可以通过Set和Get方法实现IoC以及对内置核心对象的自定义替换
|
||||
|
||||
package gins
|
||||
|
||||
import (
|
||||
@ -53,7 +52,7 @@ func View() *gview.View {
|
||||
path = gfile.SelfDir()
|
||||
}
|
||||
}
|
||||
view := gview.GetView(path)
|
||||
view := gview.Get(path)
|
||||
Set(FRAME_CORE_COMPONENT_NAME_VIEW, view)
|
||||
return view
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// MVC控制器基类
|
||||
|
||||
package gmvc
|
||||
|
||||
import (
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 模型基类
|
||||
|
||||
// MVC模型基类
|
||||
package gmvc
|
||||
|
||||
type Model struct {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// MVC视图基类
|
||||
package gmvc
|
||||
|
||||
import (
|
||||
|
||||
8
g/net/ghttp/ghttp.go
Normal file
8
g/net/ghttp/ghttp.go
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2017 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 强大的HTTP Client及Server管理包
|
||||
package ghttp
|
||||
@ -4,7 +4,6 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
package ghttp
|
||||
|
||||
import (
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
|
||||
// IPv4管理
|
||||
package gipv4
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// IPv6管理
|
||||
package gipv6
|
||||
|
||||
import "gitee.com/johng/gf/g/util/gregx"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
|
||||
// 路由管理
|
||||
package grouter
|
||||
|
||||
import (
|
||||
@ -27,7 +28,6 @@ type Router struct {
|
||||
prules *gmap.StringStringMap // 打包规则
|
||||
}
|
||||
|
||||
|
||||
func New() *Router {
|
||||
return &Router{
|
||||
drules : gmap.NewStringStringMap(),
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 局域网端口扫描
|
||||
|
||||
package gscanner
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// SMTP
|
||||
package gsmtp
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// TCP服务端
|
||||
package gtcp
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// UDP服务端
|
||||
package gudp
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 单进程缓存管理
|
||||
package gcache
|
||||
|
||||
import (
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
|
||||
// 命令行管理
|
||||
package gcmd
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 环境变量管理
|
||||
package genv
|
||||
|
||||
import "os"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 文件管理
|
||||
package gfile
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 文件指针池
|
||||
package gfilepool
|
||||
|
||||
import (
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 文件空间管理, 可用于文件碎片空间维护及再利用,支持自动合并连续碎片空间
|
||||
|
||||
|
||||
package gfilespace
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 时间管理
|
||||
package gtime
|
||||
|
||||
import (
|
||||
@ -25,9 +25,8 @@ func SetInterval(t time.Duration, callback func() bool) {
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(t)
|
||||
r := callback()
|
||||
if !r {
|
||||
break;
|
||||
if !callback() {
|
||||
break
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 视图管理
|
||||
package gview
|
||||
|
||||
import (
|
||||
@ -38,7 +38,7 @@ type Template struct {
|
||||
var viewMap = gmap.NewStringInterfaceMap()
|
||||
|
||||
// 获取或者创建一个视图对象
|
||||
func GetView(path string) *View {
|
||||
func Get(path string) *View {
|
||||
if r := viewMap.Get(path); r != nil {
|
||||
return r.(*View)
|
||||
}
|
||||
@ -49,7 +49,7 @@ func GetView(path string) *View {
|
||||
|
||||
// 生成一个视图对象
|
||||
func New(path string) *View {
|
||||
return &View{
|
||||
return &View {
|
||||
path : path,
|
||||
tpls : gmap.NewStringInterfaceMap(),
|
||||
suffix : "tpl",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 随机数管理
|
||||
package grand
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 正则表达式
|
||||
package gregx
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
|
||||
// 其他工具包
|
||||
package gutil
|
||||
|
||||
// 便利数组查找字符串索引位置,如果不存在则返回-1
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
//
|
||||
|
||||
// 通用数据验证工具
|
||||
// 本来打算取名gvalidator的,名字太长了,缩写一下
|
||||
/*
|
||||
@ -50,7 +50,6 @@ in 格式:in:value1,value2,... 说明:参
|
||||
not-in 格式:not-in:value1,value2,... 说明:参数值不应该在value1,value2,...中(字符串匹配)
|
||||
regex 格式:regex:pattern 说明:参数值应当满足正则匹配规则pattern
|
||||
*/
|
||||
|
||||
package gvalid
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user