├── data └── .gitignore ├── static ├── upload │ └── .gitignore ├── img │ ├── go.ico │ ├── gold.png │ ├── new.png │ ├── top.gif │ ├── top.png │ ├── go_top.png │ ├── gold_48.png │ ├── logo1.png │ ├── logo2.png │ ├── logo3.png │ ├── copper_48.png │ ├── rank_num1.png │ ├── rank_num2.png │ ├── rank_num3.png │ ├── silver_48.png │ ├── text_logo.png │ ├── admin │ │ ├── list.png │ │ ├── quote.png │ │ ├── thead.png │ │ ├── calarrow.png │ │ ├── line.ccc.png │ │ ├── icons │ │ │ ├── call.png │ │ │ ├── mail.png │ │ │ ├── users.png │ │ │ ├── sprites.png │ │ │ ├── calendar.png │ │ │ ├── settings.png │ │ │ └── sprites.white.png │ │ ├── line.dashed.png │ │ ├── menuarrow.png │ │ ├── noise.white.png │ │ ├── sliderhor.png │ │ ├── sliderver.png │ │ ├── topheaderbg.png │ │ ├── icons_sprite.png │ │ ├── icons_sprite2.png │ │ ├── menucollapsed.png │ │ ├── treetable │ │ │ ├── new.gif │ │ │ ├── blank.gif │ │ │ ├── fopen.gif │ │ │ ├── fshut.gif │ │ │ ├── minus.gif │ │ │ ├── plus.gif │ │ │ ├── tv-item.gif │ │ │ ├── vertline.gif │ │ │ ├── tv-expandable.gif │ │ │ ├── tv-item-last.gif │ │ │ ├── tv-collapsable.gif │ │ │ ├── tv-expandable-last.gif │ │ │ └── tv-collapsable-last.gif │ │ ├── userinfoarrow.png │ │ └── uniform │ │ │ ├── bg-input.png │ │ │ ├── sprite.png │ │ │ └── bg-input-focus.png │ ├── dock_shadow.png │ ├── logo-width.png │ ├── rank_medal1.png │ ├── rank_medal2.png │ ├── rank_medal3.png │ ├── wmd-buttons.png │ ├── activity │ │ ├── 1024-0.jpg │ │ └── 1024-1.jpg │ └── loaders │ │ ├── loader1.gif │ │ ├── loader10.gif │ │ ├── loader2.gif │ │ ├── loader3.gif │ │ ├── loader4.gif │ │ ├── loader5.gif │ │ ├── loader6.gif │ │ ├── loader7.gif │ │ ├── loader8.gif │ │ └── loader9.gif ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── css │ ├── admin │ │ ├── style.custombg.css │ │ └── jquery.timepicker.css │ ├── inner │ │ └── table.css │ ├── libs │ │ ├── jquery.atwho.min.css │ │ ├── jquery.cftoaster.1.0.1.css │ │ └── zoom.css │ ├── search.css │ ├── md_toolbar.css │ ├── message.css │ └── resources.css ├── js │ ├── install │ │ └── password-strength-meter.js │ ├── libs │ │ └── jquery.timeago.zh-CN.js │ ├── admin │ │ ├── authority │ │ │ ├── modify.js │ │ │ └── new.js │ │ └── jquery.equalHeight.js │ ├── account.js │ ├── base │ │ └── upload.js │ └── wiki.js ├── dist │ ├── css │ │ ├── table.min.css │ │ └── table_data.min.css │ └── js │ │ ├── account.min.js │ │ ├── wiki.min.js │ │ ├── preview.min.js │ │ ├── message.min.js │ │ ├── books.min.js │ │ ├── projects.min.js │ │ └── topics.min.js └── ckeditor │ └── plugins │ ├── autosave │ └── lang │ │ ├── zh.js │ │ ├── zh-cn.js │ │ └── en.js │ └── prism │ └── Creating and Editing Code Snippets.txt ├── middleware ├── README.md └── auth.go ├── db └── nosql │ └── README.md ├── template ├── admin │ ├── common_query.html │ ├── index.html │ ├── tool │ │ └── sitemap.html │ ├── 403.html │ └── 50x.html ├── wr.html ├── cssjs │ ├── prism.css.html │ ├── publish.js.html │ └── ckeditor.js.html ├── sitemapindex.xml ├── sidebar │ ├── stat.html │ ├── hot_node.html │ ├── friend_link.html │ ├── comment.html │ ├── topic.html │ ├── reading.html │ ├── article.html │ ├── project.html │ ├── resource.html │ ├── active_user.html │ ├── new_user.html │ ├── view_rank.html │ └── concern.html ├── wide │ └── playground.html ├── notfound.html ├── 500.html ├── 403.html ├── gctt │ └── apply.html ├── common │ └── view_stat.html ├── 404.html └── link.html ├── util ├── echoutils │ └── README.md ├── slice.go ├── form.go └── convert_test.go ├── vendor ├── github.com │ ├── labstack │ │ ├── gommon │ │ │ ├── gommon.go │ │ │ ├── log │ │ │ │ └── README.md │ │ │ ├── glide.yaml │ │ │ ├── bytes │ │ │ │ └── README.md │ │ │ ├── README.md │ │ │ └── glide.lock │ │ └── echo │ │ │ ├── glide.yaml │ │ │ └── log │ │ │ └── logger.go │ ├── polaris1119 │ │ ├── keyword │ │ │ ├── README.md │ │ │ └── word.go │ │ ├── goutils │ │ │ ├── README.md │ │ │ ├── bool.go │ │ │ ├── security.go │ │ │ ├── rand.go │ │ │ ├── ip.go │ │ │ ├── convert.go │ │ │ └── float.go │ │ ├── slices │ │ │ └── README.md │ │ └── times │ │ │ └── README.md │ ├── go-xorm │ │ ├── core │ │ │ ├── benchmark.sh │ │ │ ├── go.mod │ │ │ ├── error.go │ │ │ ├── converstion.go │ │ │ ├── pk.go │ │ │ ├── driver.go │ │ │ └── ilogger.go │ │ ├── builder │ │ │ ├── go.mod │ │ │ ├── builder_delete.go │ │ │ ├── error.go │ │ │ ├── builder_union.go │ │ │ └── cond_expr.go │ │ └── xorm │ │ │ ├── test_mymysql.sh │ │ │ ├── test_mysql.sh │ │ │ ├── test_mysql_cache.sh │ │ │ ├── test_sqlite.sh │ │ │ ├── test_mymysql_cache.sh │ │ │ ├── test_postgres.sh │ │ │ ├── test_sqlite_cache.sh │ │ │ ├── test_postgres_cache.sh │ │ │ ├── test_mssql.sh │ │ │ ├── test_mssql_cache.sh │ │ │ ├── gen_reserved.sh │ │ │ ├── go.mod │ │ │ ├── types.go │ │ │ ├── helpler_time.go │ │ │ ├── engine_maxlife.go │ │ │ └── context.go │ ├── mattn │ │ ├── go-isatty │ │ │ ├── doc.go │ │ │ ├── isatty_others.go │ │ │ ├── isatty_solaris.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_appengine.go │ │ │ ├── isatty_bsd.go │ │ │ └── isatty_linux_ppc64x.go │ │ ├── go-runewidth │ │ │ ├── runewidth_js.go │ │ │ ├── runewidth_windows.go │ │ │ └── README.mkd │ │ └── go-colorable │ │ │ ├── colorable_appengine.go │ │ │ └── colorable_others.go │ ├── tidwall │ │ ├── gjson │ │ │ ├── logo.png │ │ │ └── gjson_gae.go │ │ └── match │ │ │ └── README.md │ ├── andybalholm │ │ └── cascadia │ │ │ ├── go.mod │ │ │ └── README.md │ ├── gorilla │ │ ├── sessions │ │ │ └── go.mod │ │ ├── feeds │ │ │ ├── to-implement.md │ │ │ └── uuid.go │ │ ├── securecookie │ │ │ ├── fuzz.go │ │ │ └── AUTHORS │ │ └── context │ │ │ └── README.md │ ├── dgrijalva │ │ └── jwt-go │ │ │ └── doc.go │ ├── garyburd │ │ └── redigo │ │ │ └── redis │ │ │ └── go18.go │ ├── facebookgo │ │ └── stats │ │ │ ├── readme.md │ │ │ ├── stopper.go │ │ │ └── aggregation.go │ ├── twinj │ │ └── uuid │ │ │ ├── glide.yaml │ │ │ ├── glide.lock │ │ │ └── appveyor.yml │ ├── valyala │ │ ├── fasttemplate │ │ │ ├── unsafe_gae.go │ │ │ └── unsafe.go │ │ └── bytebufferpool │ │ │ └── doc.go │ ├── qiniu │ │ ├── bytes │ │ │ └── README.md │ │ ├── rpc │ │ │ ├── README.md │ │ │ └── CHANGELOG.md │ │ └── api.v6 │ │ │ └── conf │ │ │ └── conf.go │ ├── robfig │ │ └── cron │ │ │ └── README.md │ ├── tylerb │ │ └── graceful │ │ │ ├── signal_appengine.go │ │ │ ├── signal.go │ │ │ └── keepalive_listener.go │ ├── adamzy │ │ └── cedar-go │ │ │ ├── errors.go │ │ │ └── doc.go │ ├── ssor │ │ └── bom │ │ │ ├── README.md │ │ │ └── bom.go │ ├── meission │ │ └── log4go │ │ │ └── README │ ├── huichen │ │ └── sego │ │ │ ├── segment.go │ │ │ ├── license.txt │ │ │ └── test_utils.go │ ├── go-sql-driver │ │ └── mysql │ │ │ ├── appengine.go │ │ │ ├── result.go │ │ │ └── transaction.go │ ├── lunny │ │ └── html2md │ │ │ └── core.go │ ├── fatih │ │ └── structs │ │ │ └── tags.go │ └── jmcvetta │ │ └── randutil │ │ └── README.md ├── golang.org │ └── x │ │ ├── oauth2 │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ └── internal │ │ │ ├── doc.go │ │ │ └── client_appengine.go │ │ ├── sys │ │ └── unix │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── constants.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── aliases.go │ │ │ ├── pagesize_unix.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── race0.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── dirent.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── str.go │ │ │ ├── race.go │ │ │ ├── env_unix.go │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── dev_darwin.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ └── mksysnum_darwin.pl │ │ ├── text │ │ ├── language │ │ │ ├── go1_2.go │ │ │ └── go1_1.go │ │ ├── encoding │ │ │ ├── japanese │ │ │ │ └── all.go │ │ │ └── simplifiedchinese │ │ │ │ └── all.go │ │ └── internal │ │ │ └── language │ │ │ ├── common.go │ │ │ ├── coverage.go │ │ │ └── compact.go │ │ └── net │ │ ├── websocket │ │ └── dial.go │ │ └── context │ │ └── go19.go └── google.golang.org │ └── appengine │ ├── internal │ ├── main.go │ ├── identity.go │ ├── base │ │ └── api_base.proto │ └── app_id.go │ └── cloudsql │ ├── cloudsql_classic.go │ └── cloudsql_vm.go ├── robots.txt ├── config ├── reload_windows.go ├── reload_unix.go └── changelogs │ └── 1.0 │ └── studygolang.xml ├── docs ├── api.docx ├── README.md ├── qiniu.md └── gctt.md ├── liquibase ├── liquibase.jar ├── lib │ ├── snakeyaml-1.17.jar │ └── mysql-connector-java-5.1.25-bin.jar └── liquibase.bat ├── logic ├── data_test.go ├── user_rich_test.go ├── observer_test.go ├── email_test.go ├── user_test.go ├── topic_test.go ├── topic_node_test.go ├── rank_test.go ├── download.go ├── dynamic.go ├── learning_material.go ├── commenter.go └── friend_link.go ├── http ├── controller │ ├── app │ │ ├── doc.go │ │ └── routes.go │ ├── install_windows.go │ ├── admin │ │ ├── index.go │ │ ├── tool.go │ │ └── routes.go │ ├── install_unix.go │ ├── wide.go │ ├── link.go │ └── captcha.go └── middleware │ └── admin.go ├── cmd ├── main │ ├── graceful_windows.go │ ├── graceful_unix.go │ └── pprof.go ├── migrator │ └── main.go ├── crawler │ └── main.go └── indexer │ └── main.go ├── .gitignore ├── .travis.yml ├── docker-compose.yml ├── CHANGELOG.md ├── model ├── image.go ├── default_avatar.go ├── search_stat.go ├── view_record.go ├── view_source.go ├── favorite.go ├── auto_tag.go ├── friend_link.go ├── wechat.go ├── dynamic.go ├── user_setting.go ├── github_user.go ├── learning_material.go ├── authority.go ├── like.go ├── download.go ├── wiki.go └── ad.go ├── Dockerfile └── global └── chan.go /data/.gitignore: -------------------------------------------------------------------------------- 1 | max_online_num -------------------------------------------------------------------------------- /static/upload/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /middleware/README.md: -------------------------------------------------------------------------------- 1 | # middleware 2 | web中间件 3 | -------------------------------------------------------------------------------- /db/nosql/README.md: -------------------------------------------------------------------------------- 1 | # nosql 2 | nosql client and cache 3 | -------------------------------------------------------------------------------- /template/admin/common_query.html: -------------------------------------------------------------------------------- 1 | {{template "querylist" .}} -------------------------------------------------------------------------------- /util/echoutils/README.md: -------------------------------------------------------------------------------- 1 | # echoutils 2 | echo 框架辅助库 3 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/gommon.go: -------------------------------------------------------------------------------- 1 | package gommon 2 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/keyword/README.md: -------------------------------------------------------------------------------- 1 | # keyword 2 | 中文关键词提取 3 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | Sitemap: 4 | Disallow:/dl/golang/ -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/benchmark.sh: -------------------------------------------------------------------------------- 1 | go test -v -bench=. -run=XXX 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/go-xorm/core" 2 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/README.md: -------------------------------------------------------------------------------- 1 | # goutils 2 | Go语言常用工具类封装 3 | -------------------------------------------------------------------------------- /config/reload_windows.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | func signalReload() { 4 | } 5 | -------------------------------------------------------------------------------- /docs/api.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/docs/api.docx -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/go-xorm/builder" 2 | -------------------------------------------------------------------------------- /static/img/go.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/go.ico -------------------------------------------------------------------------------- /static/img/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/gold.png -------------------------------------------------------------------------------- /static/img/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/new.png -------------------------------------------------------------------------------- /static/img/top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/top.gif -------------------------------------------------------------------------------- /static/img/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/top.png -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mymysql.sh: -------------------------------------------------------------------------------- 1 | go test -db=mymysql -conn_str="xorm_test/root/" -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mysql.sh: -------------------------------------------------------------------------------- 1 | go test -db=mysql -conn_str="root:@/xorm_test" -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | studygolang 文档 2 | =============== 3 | 本文的旨在让大家更好地了解 studygolang 源码,方便参与到社区的开发中来。 -------------------------------------------------------------------------------- /static/img/go_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/go_top.png -------------------------------------------------------------------------------- /static/img/gold_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/gold_48.png -------------------------------------------------------------------------------- /static/img/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/logo1.png -------------------------------------------------------------------------------- /static/img/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/logo2.png -------------------------------------------------------------------------------- /static/img/logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/logo3.png -------------------------------------------------------------------------------- /liquibase/liquibase.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/liquibase/liquibase.jar -------------------------------------------------------------------------------- /static/img/copper_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/copper_48.png -------------------------------------------------------------------------------- /static/img/rank_num1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_num1.png -------------------------------------------------------------------------------- /static/img/rank_num2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_num2.png -------------------------------------------------------------------------------- /static/img/rank_num3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_num3.png -------------------------------------------------------------------------------- /static/img/silver_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/silver_48.png -------------------------------------------------------------------------------- /static/img/text_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/text_logo.png -------------------------------------------------------------------------------- /static/img/admin/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/list.png -------------------------------------------------------------------------------- /static/img/admin/quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/quote.png -------------------------------------------------------------------------------- /static/img/admin/thead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/thead.png -------------------------------------------------------------------------------- /static/img/dock_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/dock_shadow.png -------------------------------------------------------------------------------- /static/img/logo-width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/logo-width.png -------------------------------------------------------------------------------- /static/img/rank_medal1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_medal1.png -------------------------------------------------------------------------------- /static/img/rank_medal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_medal2.png -------------------------------------------------------------------------------- /static/img/rank_medal3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/rank_medal3.png -------------------------------------------------------------------------------- /static/img/wmd-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/wmd-buttons.png -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mysql_cache.sh: -------------------------------------------------------------------------------- 1 | go test -db=mysql -conn_str="root:@/xorm_test" -cache=true -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_sqlite.sh: -------------------------------------------------------------------------------- 1 | go test -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" -------------------------------------------------------------------------------- /static/img/admin/calarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/calarrow.png -------------------------------------------------------------------------------- /static/img/admin/line.ccc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/line.ccc.png -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mymysql_cache.sh: -------------------------------------------------------------------------------- 1 | go test -db=mymysql -conn_str="xorm_test/root/" -cache=true -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_postgres.sh: -------------------------------------------------------------------------------- 1 | go test -db=postgres -conn_str="dbname=xorm_test sslmode=disable" -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /liquibase/lib/snakeyaml-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/liquibase/lib/snakeyaml-1.17.jar -------------------------------------------------------------------------------- /static/img/activity/1024-0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/activity/1024-0.jpg -------------------------------------------------------------------------------- /static/img/activity/1024-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/activity/1024-1.jpg -------------------------------------------------------------------------------- /static/img/admin/icons/call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/call.png -------------------------------------------------------------------------------- /static/img/admin/icons/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/mail.png -------------------------------------------------------------------------------- /static/img/admin/icons/users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/users.png -------------------------------------------------------------------------------- /static/img/admin/line.dashed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/line.dashed.png -------------------------------------------------------------------------------- /static/img/admin/menuarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/menuarrow.png -------------------------------------------------------------------------------- /static/img/admin/noise.white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/noise.white.png -------------------------------------------------------------------------------- /static/img/admin/sliderhor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/sliderhor.png -------------------------------------------------------------------------------- /static/img/admin/sliderver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/sliderver.png -------------------------------------------------------------------------------- /static/img/admin/topheaderbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/topheaderbg.png -------------------------------------------------------------------------------- /static/img/loaders/loader1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader1.gif -------------------------------------------------------------------------------- /static/img/loaders/loader10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader10.gif -------------------------------------------------------------------------------- /static/img/loaders/loader2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader2.gif -------------------------------------------------------------------------------- /static/img/loaders/loader3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader3.gif -------------------------------------------------------------------------------- /static/img/loaders/loader4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader4.gif -------------------------------------------------------------------------------- /static/img/loaders/loader5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader5.gif -------------------------------------------------------------------------------- /static/img/loaders/loader6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader6.gif -------------------------------------------------------------------------------- /static/img/loaders/loader7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader7.gif -------------------------------------------------------------------------------- /static/img/loaders/loader8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader8.gif -------------------------------------------------------------------------------- /static/img/loaders/loader9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/loaders/loader9.gif -------------------------------------------------------------------------------- /static/img/admin/icons/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/sprites.png -------------------------------------------------------------------------------- /static/img/admin/icons_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons_sprite.png -------------------------------------------------------------------------------- /static/img/admin/icons_sprite2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons_sprite2.png -------------------------------------------------------------------------------- /static/img/admin/menucollapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/menucollapsed.png -------------------------------------------------------------------------------- /static/img/admin/treetable/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/new.gif -------------------------------------------------------------------------------- /static/img/admin/userinfoarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/userinfoarrow.png -------------------------------------------------------------------------------- /static/img/admin/icons/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/calendar.png -------------------------------------------------------------------------------- /static/img/admin/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/settings.png -------------------------------------------------------------------------------- /static/img/admin/treetable/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/blank.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/fopen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/fopen.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/fshut.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/fshut.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/minus.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/plus.gif -------------------------------------------------------------------------------- /static/img/admin/uniform/bg-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/uniform/bg-input.png -------------------------------------------------------------------------------- /static/img/admin/uniform/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/uniform/sprite.png -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_sqlite_cache.sh: -------------------------------------------------------------------------------- 1 | go test -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" -cache=true -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/log/README.md: -------------------------------------------------------------------------------- 1 | ## WORK IN PROGRESS 2 | 3 | ### Usage 4 | 5 | [log_test.go](log_test.go) 6 | -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-item.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-item.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/vertline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/vertline.gif -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_postgres_cache.sh: -------------------------------------------------------------------------------- 1 | go test -db=postgres -conn_str="dbname=xorm_test sslmode=disable" -cache=true -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/slices/README.md: -------------------------------------------------------------------------------- 1 | # slices 2 | Utilities for Go slice http://godoc.org/github.com/polaris1119/slices 3 | -------------------------------------------------------------------------------- /static/img/admin/icons/sprites.white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/icons/sprites.white.png -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/vendor/github.com/tidwall/gjson/logo.png -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-expandable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-expandable.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-item-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-item-last.gif -------------------------------------------------------------------------------- /static/img/admin/uniform/bg-input-focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/uniform/bg-input-focus.png -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mssql.sh: -------------------------------------------------------------------------------- 1 | go test -db=mssql -conn_str="server=192.168.1.58;user id=sa;password=123456;database=xorm_test" -------------------------------------------------------------------------------- /logic/data_test.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import "testing" 4 | 5 | func TestLoadRecommendNodes(t *testing.T) { 6 | loadRecommendNodes() 7 | } 8 | -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-collapsable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-collapsable.gif -------------------------------------------------------------------------------- /liquibase/lib/mysql-connector-java-5.1.25-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/liquibase/lib/mysql-connector-java-5.1.25-bin.jar -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-expandable-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-expandable-last.gif -------------------------------------------------------------------------------- /static/img/admin/treetable/tv-collapsable-last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studygolang/sander/HEAD/static/img/admin/treetable/tv-collapsable-last.gif -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/test_mssql_cache.sh: -------------------------------------------------------------------------------- 1 | go test -db=mssql -conn_str="server=192.168.1.58;user id=sa;password=123456;database=xorm_test" -cache=true -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/cascadia/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/andybalholm/cascadia" 2 | 3 | require "golang.org/x/net" v0.0.0-20180218175443-cbe0f9307d01 4 | -------------------------------------------------------------------------------- /logic/user_rich_test.go: -------------------------------------------------------------------------------- 1 | package logic_test 2 | 3 | import "testing" 4 | 5 | func TestAwardCooper(t *testing.T) { 6 | // logic.DefaultUserRich.AwardCooper() 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/gen_reserved.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -f $1 ];then 3 | cat $1| awk '{printf("\""$1"\":true,\n")}' 4 | else 5 | echo "argument $1 if not a file!" 6 | fi 7 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/sessions/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/gorilla/sessions" 2 | 3 | require ( 4 | "github.com/gorilla/context" v1.1.1 5 | "github.com/gorilla/securecookie" v1.1.1 6 | ) 7 | -------------------------------------------------------------------------------- /template/admin/index.html: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 | 6 | {{end}} -------------------------------------------------------------------------------- /template/wr.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}首页{{end}} 2 | {{define "content"}} 3 | 4 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html 2 | // 3 | // See README.md for more info. 4 | package jwt 5 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/go-xorm/xorm" 2 | 3 | require ( 4 | "github.com/go-xorm/builder" v0.0.0-20180322150003-a9b7ffcca3f0 5 | "github.com/go-xorm/core" v0.0.0-20180322150003-0177c08cee88 6 | ) 7 | -------------------------------------------------------------------------------- /vendor/github.com/facebookgo/stats/readme.md: -------------------------------------------------------------------------------- 1 | stats [![Build Status](https://secure.travis-ci.org/facebookgo/stats.png)](https://travis-ci.org/facebookgo/stats) 2 | ===== 3 | 4 | Documentation: https://godoc.org/github.com/facebookgo/stats 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/error.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrNoMapPointer = errors.New("mp should be a map's pointer") 7 | ErrNoStructPointer = errors.New("mp should be a struct's pointer") 8 | ) 9 | -------------------------------------------------------------------------------- /template/cssjs/prism.css.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/types.go: -------------------------------------------------------------------------------- 1 | package xorm 2 | 3 | import ( 4 | "reflect" 5 | 6 | "github.com/go-xorm/core" 7 | ) 8 | 9 | var ( 10 | ptrPkType = reflect.TypeOf(&core.PK{}) 11 | pkType = reflect.TypeOf(core.PK{}) 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package runewidth 4 | 5 | func IsEastAsian() bool { 6 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/twinj/uuid/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/twinj/uuid 2 | licence: MIT 3 | owners: 4 | - name: Daniel Kemp 5 | email: daniel.kemp@live.com.au 6 | import: 7 | - package: github.com/stretchr/testify 8 | subpackages: 9 | - assert 10 | 11 | -------------------------------------------------------------------------------- /template/sitemapindex.xml: -------------------------------------------------------------------------------- 1 | 2 | {{range .sitemapFiles}} 3 | 4 | {{$.home.loc}}/sitemap/{{.}} 5 | {{end}} 6 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasttemplate/unsafe_gae.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package fasttemplate 4 | 5 | func unsafeBytes2String(b []byte) string { 6 | return string(b) 7 | } 8 | 9 | func unsafeString2Bytes(s string) []byte { 10 | return []byte(s) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/qiniu/bytes/README.md: -------------------------------------------------------------------------------- 1 | bytes 2 | ===== 3 | 4 | [![Build Status](https://drone.io/github.com/qiniu/bytes/status.png)](https://drone.io/github.com/qiniu/bytes/latest) 5 | 6 | ![logo](http://qiniutek.com/images/logo-2.png) 7 | 8 | Extension module of golang bytes processing 9 | -------------------------------------------------------------------------------- /vendor/github.com/qiniu/rpc/README.md: -------------------------------------------------------------------------------- 1 | rpc 2 | === 3 | 4 | [![Build Status](https://drone.io/github.com/qiniu/rpc/status.png)](https://drone.io/github.com/qiniu/rpc/latest) 5 | 6 | [![Qiniu Logo](http://qiniutek.com/images/logo-2.png)](http://qiniu.com/) 7 | 8 | Golang rpc client based on http 9 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/gjson_gae.go: -------------------------------------------------------------------------------- 1 | //+build appengine 2 | 3 | package gjson 4 | 5 | func getBytes(json []byte, path string) Result { 6 | return Get(string(json), path) 7 | } 8 | func fillIndex(json string, c *parseContext) { 9 | // noop. Use zero for the Index value. 10 | } 11 | -------------------------------------------------------------------------------- /http/controller/app/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package app 8 | -------------------------------------------------------------------------------- /template/cssjs/publish.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/labstack/gommon 2 | import: 3 | - package: github.com/valyala/fasttemplate 4 | - package: github.com/mattn/go-colorable 5 | - package: github.com/mattn/go-isatty 6 | - package: github.com/stretchr/testify 7 | subpackages: 8 | - assert 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/converstion.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | // Conversion is an interface. A type implements Conversion will according 4 | // the custom method to fill into database and retrieve from database. 5 | type Conversion interface { 6 | FromDB([]byte) error 7 | ToDB() ([]byte, error) 8 | } 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | -------------------------------------------------------------------------------- /cmd/main/graceful_windows.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "time" 6 | 7 | "github.com/labstack/echo/engine/standard" 8 | "github.com/tylerb/graceful" 9 | ) 10 | 11 | func gracefulRun(std *standard.Server) { 12 | log.Fatal(graceful.ListenAndServe(std.Server, 5*time.Second)) 13 | } 14 | -------------------------------------------------------------------------------- /template/cssjs/ckeditor.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cmd/main/graceful_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9 2 | 3 | package main 4 | 5 | import ( 6 | "log" 7 | 8 | "github.com/facebookgo/grace/gracehttp" 9 | "github.com/labstack/echo/engine/standard" 10 | ) 11 | 12 | func gracefulRun(std *standard.Server) { 13 | log.Fatal(gracehttp.Serve(std.Server)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /docs/qiniu.md: -------------------------------------------------------------------------------- 1 | Go 中文网静态资源托管在七牛云上,对于 js 和 css,如果有变化,需要更新对应的文件,通过 [qshell](https://developer.qiniu.com/kodo/tools/1302/qshel) 工具可以做到 2 | 3 | 按文档安装完后,需要设置 account,之后执行类似如下命令来替换 js 或 css: 4 | 5 | qshell fput studygolang static/dist/js/sg_base.min.js dist/js/sg_styles.min.css true 6 | 7 | 即:qshell fput [] 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /static/css/admin/style.custombg.css: -------------------------------------------------------------------------------- 1 | .bodywrapper { background: url(../images/headerbg/btl.png) repeat-x center top; } 2 | .topheader { background-image: url(../images/headerbg/bluetrans2.png); background-color: transparent; border-bottom: 0; } 3 | .header { background-image: url(../images/headerbg/bluetrans.png); background-color: transparent; } -------------------------------------------------------------------------------- /vendor/github.com/robfig/cron/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron) 2 | [![Build Status](https://travis-ci.org/robfig/cron.svg?branch=master)](https://travis-ci.org/robfig/cron) 3 | 4 | # cron 5 | 6 | Documentation here: https://godoc.org/github.com/robfig/cron 7 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 7 | // terminal. This is also always false on this environment. 8 | func IsCygwinTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # idea ignore 2 | .idea/ 3 | *.ipr 4 | *.iml 5 | *.iws 6 | .vscode/ 7 | *.swp 8 | 9 | # temp ignore 10 | *.log 11 | *.cache 12 | *.diff 13 | *.exe 14 | *.exe~ 15 | *.patch 16 | *.tmp 17 | *debug.test 18 | 19 | # system ignore 20 | .DS_Store 21 | Thumbs.db 22 | 23 | # project 24 | *.cert 25 | *.key 26 | .test 27 | ./bin/* 28 | ./log/* 29 | -------------------------------------------------------------------------------- /vendor/github.com/tylerb/graceful/signal_appengine.go: -------------------------------------------------------------------------------- 1 | //+build appengine 2 | 3 | package graceful 4 | 5 | import "os" 6 | 7 | func signalNotify(interrupt chan<- os.Signal) { 8 | // Does not notify in the case of AppEngine. 9 | } 10 | 11 | func sendSignalInt(interrupt chan<- os.Signal) { 12 | // Does not send in the case of AppEngine. 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/doc.go: -------------------------------------------------------------------------------- 1 | // Package bytebufferpool implements a pool of byte buffers 2 | // with anti-fragmentation protection. 3 | // 4 | // The pool may waste limited amount of memory due to fragmentation. 5 | // This amount equals to the maximum total size of the byte buffers 6 | // in concurrent use. 7 | package bytebufferpool 8 | -------------------------------------------------------------------------------- /http/controller/install_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package controller 8 | 9 | func (InstallController) reload() { 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.9.x 6 | - tip 7 | 8 | sudo: false 9 | 10 | install: 11 | - export GOPATH=$HOME/gopath/src/github.com/studygolang/studygolang 12 | - export PATH=$PATH:$HOME/gopath/src/github.com/studygolang/studygolang/bin/ 13 | - go get -v github.com/FiloSottile/gvt 14 | 15 | script: 16 | - sh getpkg.sh 17 | - sh install.sh -------------------------------------------------------------------------------- /config/reload_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9 2 | 3 | package config 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | ) 10 | 11 | func signalReload() { 12 | ch := make(chan os.Signal, 1) 13 | signal.Notify(ch, syscall.SIGUSR1) 14 | 15 | for { 16 | sig := <-ch 17 | switch sig { 18 | case syscall.SIGUSR1: 19 | ReloadConfigFile() 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /template/admin/tool/sitemap.html: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 | 5 | 6 |
7 |
生成成功!查看
8 |
9 |
10 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/tylerb/graceful/signal.go: -------------------------------------------------------------------------------- 1 | //+build !appengine 2 | 3 | package graceful 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | ) 10 | 11 | func signalNotify(interrupt chan<- os.Signal) { 12 | signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) 13 | } 14 | 15 | func sendSignalInt(interrupt chan<- os.Signal) { 16 | interrupt <- syscall.SIGINT 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine_internal" 11 | ) 12 | 13 | func Main() { 14 | appengine_internal.Main() 15 | } 16 | -------------------------------------------------------------------------------- /static/js/install/password-strength-meter.js: -------------------------------------------------------------------------------- 1 | function passwordStrength(f,i,d){var k=1,h=2,b=3,a=4,c=5,g=0,j,e;if((f!=d)&&d.length>0){return c}if(f.length<4){return k}if(f.toLowerCase()==i.toLowerCase()){return h}if(f.match(/[0-9]/)){g+=10}if(f.match(/[a-z]/)){g+=26}if(f.match(/[A-Z]/)){g+=26}if(f.match(/[^a-zA-Z0-9]/)){g+=31}j=Math.log(Math.pow(g,f.length));e=j/Math.LN2;if(e<40){return h}if(e<56){return b}return a}; -------------------------------------------------------------------------------- /template/sidebar/stat.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/adamzy/cedar-go/errors.go: -------------------------------------------------------------------------------- 1 | package cedar 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrInvalidDataType = errors.New("cedar: invalid datatype") 7 | ErrInvalidValue = errors.New("cedar: invalid value") 8 | ErrInvalidKey = errors.New("cedar: invalid key") 9 | ErrNoPath = errors.New("cedar: no path") 10 | ErrNoValue = errors.New("cedar: no value") 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /static/dist/css/table.min.css: -------------------------------------------------------------------------------- 1 | table tr td,table tr th{border:1px solid #ccc;margin:0;padding:6px 13px}table{padding:0;border-collapse:collapse}table tr{border-top:1px solid #ccc;background-color:#fff;margin:0;padding:0}table tr:nth-child(2n){background-color:#f8f8f8}table tr th{font-weight:700}table tr td :first-child,table tr th :first-child{margin-top:0}table tr td :last-child,table tr th :last-child{margin-bottom:0} -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import "google.golang.org/appengine/urlfetch" 10 | 11 | func init() { 12 | appengineClientHook = urlfetch.Client 13 | } 14 | -------------------------------------------------------------------------------- /template/sidebar/hot_node.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | redis: 4 | image: "redis:latest" 5 | 6 | mariadb: 7 | image: "mariadb:latest" 8 | ports: 9 | - "127.0.0.1:3306:3306" 10 | privileged: true 11 | volumes: 12 | - /data/mysql/data:/var/lib/mysql 13 | 14 | main: 15 | build: . 16 | depends_on: 17 | - redis 18 | - mariadb 19 | ports: 20 | - "127.0.0.1:8088:8088" -------------------------------------------------------------------------------- /static/dist/js/account.min.js: -------------------------------------------------------------------------------- 1 | (function(){SG.Register=function(){},SG.Register.prototype=new SG.Publisher,jQuery(document).ready(function(t){var e="";t("#captcha_img").on("click",function(i){i.preventDefault(),""==e&&(e=t(this).attr("src")),t(this).attr("src",e+"?reload="+(new Date).getTime())}),t("#register-submit").on("click",function(e){e.preventDefault();var i=t(".validate-form");if(!i.validate().form())return!1;i.submit()})})}).call(this); -------------------------------------------------------------------------------- /template/sidebar/friend_link.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/japanese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/github.com/ssor/bom/README.md: -------------------------------------------------------------------------------- 1 | # bom 2 | small tools for cleaning bom from byte array or reader 3 | 4 | 5 | ## Installation 6 | 7 | ```sh 8 | $ go get github.com/ssor/bom 9 | ``` 10 | 11 | ## How to Use 12 | 13 | 14 | ``` 15 | bs := []byte{bom0, bom1, bom2, 0x11} 16 | result := CleanBom(bs) 17 | ``` 18 | 19 | ``` 20 | bs := []byte{bom0, bom1, bom2, 0x11} 21 | result := NewReaderWithoutBom(bytes.NewReader(bs)) 22 | 23 | ``` -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/cascadia/README.md: -------------------------------------------------------------------------------- 1 | # cascadia 2 | 3 | [![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) 4 | 5 | The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. 6 | 7 | To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | #### sander 3 | 4 | ##### Version 0.0.2 5 | > 1.govendor fetch github.com/tylerb/graceful 6 | 7 | ##### Version 0.0.1 8 | > 1.log4go 9 | 10 | ##### Version 0.0.0 11 | > 1.Dockerfile docker-compose 12 | 13 | ##### Version 0.0.0 14 | > 1.迁移config,nosql,middleware 15 | 16 | ##### Version 0.0.0 17 | > 1.环境变化,项目默认基于开发着GOPATH环境 18 | > 2.vendor依赖库,默认自带,不需要重新下载 19 | > 3.项目目录发生变化,统一以sander为项目根目录 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /logic/observer_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import "testing" 10 | 11 | func TestNotifyObservers(t *testing.T) { 12 | // publishObservable.NotifyObservers(1, model.TypeTopic, 2665) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /template/wide/playground.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}Wide 团队开发,随时随地 {{end}} 2 | {{define "seo"}} 3 | {{end}} 4 | {{define "content"}} 5 | 7 |
8 | 9 |
10 | {{end}} -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "net" 11 | 12 | "appengine/cloudsql" 13 | ) 14 | 15 | func connect(instance string) (net.Conn, error) { 16 | return cloudsql.Dial(instance) 17 | } 18 | -------------------------------------------------------------------------------- /template/sidebar/comment.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/sidebar/topic.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/facebookgo/stats/stopper.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "time" 4 | 5 | // Stopper calls Client.BumpSum and Client.BumpHistogram when End'ed 6 | type Stopper struct { 7 | Key string 8 | Start time.Time 9 | Client Client 10 | } 11 | 12 | // End the Stopper 13 | func (s *Stopper) End() { 14 | since := time.Since(s.Start).Seconds() * 1000.0 15 | s.Client.BumpSum(s.Key+".total", since) 16 | s.Client.BumpHistogram(s.Key, since) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/twinj/uuid/glide.lock: -------------------------------------------------------------------------------- 1 | hash: f911e013eca32434aa211cdcf343b438bb417cbf31571d3d72c2c1f5cb960414 2 | updated: 2016-06-05T02:30:40.1280097+10:00 3 | imports: 4 | - name: github.com/stretchr/testify 5 | version: 8d64eb7173c7753d6419fd4a9caf057398611364 6 | subpackages: 7 | - assert 8 | - name: github.com/twinj/uuid 9 | version: 54014829338a362f3071461e05e890f51443520f 10 | subpackages: 11 | - github.com\twinj\uuid 12 | devImports: [] 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /model/image.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | // 图片 10 | type Image struct { 11 | Pid int `xorm:"pk autoincr"` 12 | Md5 string 13 | Path string 14 | Size int 15 | Width int 16 | Height int 17 | } 18 | -------------------------------------------------------------------------------- /template/sidebar/reading.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/sidebar/article.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/sidebar/project.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/sidebar/resource.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /template/notfound.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}请求的资源不存在或已经被删除 {{end}} 2 | {{define "content"}} 3 | 5 |
6 |
7 | 11 |
12 | 请求的资源不存在或已经被删除 13 |
14 |
15 |
16 | 17 |
18 |
19 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/labstack/echo 2 | import: 3 | - package: github.com/labstack/gommon 4 | subpackages: 5 | - color 6 | - log 7 | - package: github.com/valyala/fasthttp 8 | - package: golang.org/x/net 9 | subpackages: 10 | - context 11 | - websocket 12 | - package: github.com/valyala/fasttemplate 13 | - package: github.com/stretchr/testify 14 | subpackages: 15 | - assert 16 | - package: github.com/dgrijalva/jwt-go 17 | -------------------------------------------------------------------------------- /vendor/github.com/qiniu/rpc/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | #CHANGELOG 2 | 3 | ## v2.0.01 4 | 5 | 2013-09-10 Issue [#7](https://github.com/qiniu/rpc/pull/7): 6 | 7 | - support jsonrpc 8 | 9 | 10 | ## v2.0.00 11 | 12 | 2013-03-20 Issue [#5](https://github.com/qiniu/rpc/pull/5): 13 | 14 | - support X-Reqid, X-Log 15 | - support User-Agent 16 | - rpc error bugfix 17 | 18 | 19 | ## v1.0.00 20 | 21 | 2013-03-10 Issue [#2](https://github.com/qiniu/rpc/pull/2): 22 | 23 | - initial version 24 | -------------------------------------------------------------------------------- /template/sidebar/active_user.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /template/sidebar/new_user.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # base image 2 | FROM centos 3 | 4 | MAINTAINER meission@aliyun.com 5 | 6 | RUN mkdir -p /data/app/sander 7 | WORKDIR /data/app/sander 8 | COPY ./bin ./bin 9 | COPY ./config ./config 10 | COPY ./data ./data 11 | COPY ./static ./static 12 | COPY ./template ./template 13 | 14 | CMD ["./bin/main"] 15 | 16 | EXPOSE 8088 17 | 18 | # docker run -it sander:latest /bin/bash 19 | # docker run --name sander1 -p 127.0.0.1:8088:8088 -d sander 20 | # docker exec -it sander1 /bin/bash -------------------------------------------------------------------------------- /cmd/migrator/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: javasgl songganglin@gmail.com 6 | package main 7 | 8 | import ( 9 | "sander/cmd" 10 | "sander/config" 11 | "sander/logger" 12 | ) 13 | 14 | func main() { 15 | logger.Init(config.ROOT + "/log/migrator") 16 | server.MigratorServer() 17 | } 18 | -------------------------------------------------------------------------------- /http/controller/admin/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package admin 8 | 9 | import ( 10 | "github.com/labstack/echo" 11 | ) 12 | 13 | // AdminIndex . 14 | func AdminIndex(ctx echo.Context) error { 15 | return render(ctx, "index.html", nil) 16 | } 17 | -------------------------------------------------------------------------------- /model/default_avatar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | type DefaultAvatar struct { 12 | Id int `json:"-" xorm:"pk autoincr"` 13 | Filename string 14 | CreatedAt time.Time `json:"-" xorm:"<-"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/meission/log4go/README: -------------------------------------------------------------------------------- 1 | # This is an unmaintained fork, left only so it doesn't break imports. 2 | 3 | Please see http://log4go.googlecode.com/ 4 | 5 | Installation: 6 | - Run `goinstall log4go.googlecode.com/hg` 7 | 8 | Usage: 9 | - Add the following import: 10 | import l4g "log4go.googlecode.com/hg" 11 | 12 | Acknowledgements: 13 | - pomack 14 | For providing awesome patches to bring log4go up to the latest Go spec 15 | 16 | Update 17 | - runtime.Caller(3) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /logic/email_test.go: -------------------------------------------------------------------------------- 1 | package logic_test 2 | 3 | import ( 4 | "sander/logic" 5 | "testing" 6 | 7 | "sander/config" 8 | "sander/logger" 9 | ) 10 | 11 | func TestSendMail(t *testing.T) { 12 | logger.Init(ROOT+"/log", config.ConfigFile.MustValue("global", "log_level", "DEBUG")) 13 | 14 | err := logic.DefaultEmail.SendMail("中文test", "内容test content,收到?", []string{"xuxinhua@zhimadj.com"}) 15 | if err != nil { 16 | t.Error(err) 17 | } else { 18 | t.Log("successful") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | ) 13 | 14 | func connect(instance string) (net.Conn, error) { 15 | return nil, errors.New(`cloudsql: not supported in App Engine "flexible environment"`) 16 | } 17 | -------------------------------------------------------------------------------- /static/js/libs/jquery.timeago.zh-CN.js: -------------------------------------------------------------------------------- 1 | // Simplified Chinese 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: "从现在开始", 5 | suffixAgo: "之前", 6 | suffixFromNow: null, 7 | seconds: "不到1分钟", 8 | minute: "大约1分钟", 9 | minutes: "%d分钟", 10 | hour: "大约1小时", 11 | hours: "大约%d小时", 12 | day: "1天", 13 | days: "%d天", 14 | month: "大约1个月", 15 | months: "%d月", 16 | year: "大约1年", 17 | years: "%d年", 18 | numbers: [], 19 | wordSeparator: "" 20 | }; 21 | -------------------------------------------------------------------------------- /template/sidebar/view_rank.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /util/slice.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // https://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package util 8 | 9 | // InSlice 判断 i 是否在 slice 中 10 | func InSlice(i int, slice []int) bool { 11 | for _, val := range slice { 12 | if val == i { 13 | return true 14 | } 15 | } 16 | 17 | return false 18 | } 19 | -------------------------------------------------------------------------------- /http/controller/install_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | // +build !windows,!plan9 8 | 9 | package controller 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func (InstallController) reload() { 17 | syscall.Kill(os.Getpid(), syscall.SIGUSR2) 18 | } 19 | -------------------------------------------------------------------------------- /template/admin/403.html: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 |
3 |
4 |
5 |

Access Denied

6 |

Sorry, 您没有访问该页面的权限

7 |

您可以进行以下步骤

8 |
    9 |
  • 发邮件至studygolang@gmail.com,或联系站长(polaris),申请开通
  • 10 |
  • 权限开通后再次访问该页面
  • 11 |
12 |
13 |
14 |
15 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/huichen/sego/segment.go: -------------------------------------------------------------------------------- 1 | package sego 2 | 3 | // 文本中的一个分词 4 | type Segment struct { 5 | // 分词在文本中的起始字节位置 6 | start int 7 | 8 | // 分词在文本中的结束字节位置(不包括该位置) 9 | end int 10 | 11 | // 分词信息 12 | token *Token 13 | } 14 | 15 | // 返回分词在文本中的起始字节位置 16 | func (s *Segment) Start() int { 17 | return s.start 18 | } 19 | 20 | // 返回分词在文本中的结束字节位置(不包括该位置) 21 | func (s *Segment) End() int { 22 | return s.end 23 | } 24 | 25 | // 返回分词信息 26 | func (s *Segment) Token() *Token { 27 | return s.token 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasttemplate/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package fasttemplate 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | func unsafeBytes2String(b []byte) string { 11 | return *(*string)(unsafe.Pointer(&b)) 12 | } 13 | 14 | func unsafeString2Bytes(s string) []byte { 15 | sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) 16 | bh := reflect.SliceHeader{ 17 | Data: sh.Data, 18 | Len: sh.Len, 19 | Cap: sh.Len, 20 | } 21 | return *(*[]byte)(unsafe.Pointer(&bh)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine,!ppc64,!ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /logic/user_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package logic_test 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | func TestFindUserInfos(t *testing.T) { 14 | // usersMap := DefaultUser.FindUserInfos(nil, []int{1, 2, 3}) 15 | // if len(usersMap) == 0 { 16 | // t.Fatal(usersMap) 17 | // } 18 | } 19 | -------------------------------------------------------------------------------- /static/css/inner/table.css: -------------------------------------------------------------------------------- 1 | table { padding: 0; border-collapse: collapse; } 2 | table tr { border-top: 1px solid #cccccc; background-color: white; margin: 0; padding: 0; } 3 | table tr:nth-child(2n) { background-color: #f8f8f8; } 4 | table tr th { font-weight: bold; border: 1px solid #cccccc; margin: 0; padding: 6px 13px; } 5 | table tr td { border: 1px solid #cccccc; margin: 0; padding: 6px 13px; } 6 | table tr th :first-child, table tr td :first-child {margin-top: 0; } 7 | table tr th :last-child, table tr td :last-child { margin-bottom: 0; } -------------------------------------------------------------------------------- /static/dist/js/wiki.min.js: -------------------------------------------------------------------------------- 1 | (function(){SG.Wiki=function(){},SG.Wiki.prototype=new SG.Publisher,SG.Wiki.prototype.parseDesc=function(){var t=$(".page .content").text();marked=SG.markSettingNoHightlight();var e=marked(t);e=SG.replaceCodeChar(e),$(".page .content").html(e)},jQuery(document).ready(function(t){t("#submit").on("click",function(e){e.preventDefault();if(!t(".validate-form").validate().form())return!1;(new SG.Wiki).publish(this)}),t(document).keypress(function(e){!e.ctrlKey||10!=e.which&&13!=e.which||t("#submit").click()})})}).call(this); -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import netcontext "golang.org/x/net/context" 8 | 9 | // These functions are implementations of the wrapper functions 10 | // in ../appengine/identity.go. See that file for commentary. 11 | 12 | func AppID(c netcontext.Context) string { 13 | return appID(FullyQualifiedAppID(c)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/keyword/word.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 polaris. All rights reserved. 2 | // Use of l source code is governed by a MIT-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package keyword 8 | 9 | type word struct { 10 | w string 11 | frequency int 12 | dictFrequency int 13 | idf float64 14 | 15 | titleWeight float64 16 | } 17 | 18 | func (this *word) String() string { 19 | return this.w 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64 ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "unsafe" 8 | 9 | syscall "golang.org/x/sys/unix" 10 | ) 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var termios syscall.Termios 17 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 18 | return err == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/feeds/to-implement.md: -------------------------------------------------------------------------------- 1 | [Full iTunes list](https://help.apple.com/itc/podcasts_connect/#/itcb54353390) 2 | 3 | [Example of ideal iTunes RSS feed](https://help.apple.com/itc/podcasts_connect/#/itcbaf351599) 4 | 5 | ``` 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ``` -------------------------------------------------------------------------------- /model/search_stat.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | // 搜索词统计 12 | type SearchStat struct { 13 | Id int `json:"id" xorm:"pk autoincr"` 14 | Keyword string `json:"keyword"` 15 | Times int `json:"times"` 16 | Ctime time.Time `json:"ctime" xorm:"<-"` 17 | } 18 | -------------------------------------------------------------------------------- /util/form.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package util 8 | 9 | import ( 10 | "net/url" 11 | "strconv" 12 | ) 13 | 14 | // CheckInt 检测提交请求的参数是否是 int 类型 15 | func CheckInt(form url.Values, field string) bool { 16 | _, err := strconv.Atoi(form.Get(field)) 17 | if err != nil { 18 | return false 19 | } 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /model/view_record.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | type ViewRecord struct { 10 | Id int `json:"id" xorm:"pk autoincr"` 11 | Objid int `json:"objid"` 12 | Objtype int `json:"objtype"` 13 | Uid int `json:"uid"` 14 | CreatedAt OftenTime `json:"created_at" xorm:"<-"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/securecookie/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package securecookie 4 | 5 | var hashKey = []byte("very-secret12345") 6 | var blockKey = []byte("a-lot-secret1234") 7 | var s = New(hashKey, blockKey) 8 | 9 | type Cookie struct { 10 | B bool 11 | I int 12 | S string 13 | } 14 | 15 | func Fuzz(data []byte) int { 16 | datas := string(data) 17 | var c Cookie 18 | if err := s.Decode("fuzz", datas, &c); err != nil { 19 | return 0 20 | } 21 | if _, err := s.Encode("fuzz", c); err != nil { 22 | panic(err) 23 | } 24 | return 1 25 | } 26 | -------------------------------------------------------------------------------- /model/view_source.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | type ViewSource struct { 10 | Id int `xorm:"pk autoincr"` 11 | Objid int 12 | Objtype int 13 | Google int 14 | Baidu int 15 | Bing int 16 | Sogou int 17 | So int 18 | Other int 19 | UpdatedAt OftenTime `xorm:"<-"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/pk.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "bytes" 5 | "encoding/gob" 6 | ) 7 | 8 | type PK []interface{} 9 | 10 | func NewPK(pks ...interface{}) *PK { 11 | p := PK(pks) 12 | return &p 13 | } 14 | 15 | func (p *PK) ToString() (string, error) { 16 | buf := new(bytes.Buffer) 17 | enc := gob.NewEncoder(buf) 18 | err := enc.Encode(*p) 19 | return buf.String(), err 20 | } 21 | 22 | func (p *PK) FromString(content string) error { 23 | dec := gob.NewDecoder(bytes.NewBufferString(content)) 24 | err := dec.Decode(p) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/bytes/README.md: -------------------------------------------------------------------------------- 1 | # Bytes 2 | 3 | - Format bytes integer to human readable bytes string. 4 | - Parse human readable bytes string to bytes integer. 5 | 6 | ## Installation 7 | 8 | ```go 9 | go get github.com/labstack/gommon/bytes 10 | ``` 11 | 12 | ## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go) 13 | 14 | ### Format 15 | 16 | ```go 17 | println(bytes.Format(13231323)) 18 | ``` 19 | 20 | `12.62MB` 21 | 22 | ### Parse 23 | 24 | ```go 25 | b, _ = Parse("2M") 26 | println(b) 27 | ``` 28 | 29 | `2097152` 30 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | package runewidth 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | kernel32 = syscall.NewLazyDLL("kernel32") 9 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 10 | ) 11 | 12 | // IsEastAsian return true if the current locale is CJK 13 | func IsEastAsian() bool { 14 | r1, _, _ := procGetConsoleOutputCP.Call() 15 | if r1 == 0 { 16 | return false 17 | } 18 | 19 | switch int(r1) { 20 | case 932, 51932, 936, 949, 950: 21 | return true 22 | } 23 | 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /global/chan.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package global 8 | 9 | // AuthorityChan . 10 | var AuthorityChan = make(chan struct{}, 1) 11 | 12 | // RoleChan . 13 | var RoleChan = make(chan struct{}, 1) 14 | 15 | // RoleAuthChan . 16 | var RoleAuthChan = make(chan struct{}, 1) 17 | 18 | // UserSettingChan . 19 | var UserSettingChan = make(chan struct{}, 1) 20 | -------------------------------------------------------------------------------- /vendor/github.com/adamzy/cedar-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package cedar-go implements double-array trie. 2 | // 3 | // It is a golang port of cedar (http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/cedar) which is written in C++ by Naoki Yoshinaga. 4 | // Currently cedar-go implements the `reduced` verion of cedar. 5 | // This package is not thread safe if there is one goroutine doing 6 | // insertions or deletions. 7 | // 8 | // Note 9 | // 10 | // key must be `[]byte` without zero items, 11 | // while value must be integer in the range [0, 2<<63-2] or [0, 2<<31-2] depends on the platform. 12 | package cedar 13 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/bool.go: -------------------------------------------------------------------------------- 1 | package goutils 2 | 3 | import ( 4 | "log" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | func MustBool(s string, defaultVal ...bool) bool { 10 | getDefault := func() bool { 11 | if len(defaultVal) > 0 { 12 | return defaultVal[0] 13 | } 14 | return false 15 | } 16 | 17 | if s == "" { 18 | return getDefault() 19 | } 20 | 21 | b, err := strconv.ParseBool(strings.TrimSpace(s)) 22 | if err != nil { 23 | log.Println("goutils MustBool strconv.ParseBool error:", err) 24 | return getDefault() 25 | } 26 | 27 | return b 28 | } 29 | -------------------------------------------------------------------------------- /logic/topic_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package logic_test 8 | 9 | import "testing" 10 | 11 | func TestFindAll(t *testing.T) { 12 | // paginator := logic.NewPaginator(2) 13 | // topicsMap := logic.DefaultTopic.FindAll(nil, paginator, "", "") 14 | // if len(topicsMap) == 0 { 15 | // t.Fatal(topicsMap) 16 | // } 17 | // t.Fatal(topicsMap) 18 | } 19 | -------------------------------------------------------------------------------- /model/favorite.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | // 用户收藏(用户可以收藏文章、话题、资源等) 10 | type Favorite struct { 11 | Uid int `json:"uid"` 12 | Objtype int `json:"objtype"` 13 | Objid int `json:"objid"` 14 | Ctime string `json:"ctime" xorm:"<-"` 15 | } 16 | 17 | func (*Favorite) TableName() string { 18 | return "favorites" 19 | } 20 | -------------------------------------------------------------------------------- /static/css/admin/jquery.timepicker.css: -------------------------------------------------------------------------------- 1 | /* css for timepicker */ 2 | .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } 3 | .ui-timepicker-div dl { text-align: left; } 4 | .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } 5 | .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } 6 | .ui-timepicker-div td { font-size: 90%; } 7 | .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } 8 | 9 | .ui-timepicker-rtl{ direction: rtl; } 10 | .ui-timepicker-rtl dl { text-align: right; } 11 | .ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } -------------------------------------------------------------------------------- /static/css/libs/jquery.atwho.min.css: -------------------------------------------------------------------------------- 1 | .atwho-view{position:absolute;top:0;left:0;display:none;margin-top:18px;background:#fff;color:#000;border:1px solid #DDD;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.1);min-width:120px;z-index:11110!important}.atwho-view .cur{background:#36F;color:#fff}.atwho-view .cur small{color:#fff}.atwho-view strong{color:#36F}.atwho-view .cur strong{color:#fff;font:700}.atwho-view ul{list-style:none;padding:0;margin:auto}.atwho-view ul li{display:block;padding:5px 10px;border-bottom:1px solid #DDD;cursor:pointer}.atwho-view small{font-size:smaller;color:#777;font-weight:400} -------------------------------------------------------------------------------- /logic/topic_node_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package logic_test 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | func TestFindParallelTree(t *testing.T) { 14 | // treeNodes := logic.DefaultNode.FindParallelTree(nil) 15 | // for _, node := range treeNodes { 16 | // fmt.Printf("%+v\n", node) 17 | // } 18 | 19 | // fmt.Println(len(treeNodes)) 20 | } 21 | -------------------------------------------------------------------------------- /model/auto_tag.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import ( 10 | "strings" 11 | 12 | "github.com/polaris1119/keyword" 13 | ) 14 | 15 | // AutoTag 自动生成 tag 16 | func AutoTag(title, content string, num int) string { 17 | defer func() { 18 | recover() 19 | }() 20 | return strings.Join(keyword.ExtractWithTitle(title, content, num), ",") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/helpler_time.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package xorm 6 | 7 | import "time" 8 | 9 | const ( 10 | zeroTime0 = "0000-00-00 00:00:00" 11 | zeroTime1 = "0001-01-01 00:00:00" 12 | ) 13 | 14 | func formatTime(t time.Time) string { 15 | return t.Format("2006-01-02 15:04:05") 16 | } 17 | 18 | func isTimeZero(t time.Time) bool { 19 | return t.IsZero() || formatTime(t) == zeroTime0 || 20 | formatTime(t) == zeroTime1 21 | } 22 | -------------------------------------------------------------------------------- /docs/gctt.md: -------------------------------------------------------------------------------- 1 | # GCTT 2 | 3 | ## 简介 4 | 5 | GCTT (Go Chinese Translation Team) 是 Go中文网(https://studygolang.com) 翻译组,负责从国外优秀媒体翻译 Go 相关的技术、教程、资讯、杂文等内容。 6 | 7 | ## GCTT 的组成 8 | 9 | **选题**,负责选择合适的内容,并将原文转换为 markdown 格式,提交到 [GCTT](https://github.com/studygolang/gctt) 库中。 10 | **译者**,负责从选题中选择内容进行翻译。 11 | **校对**,负责将初译的文章进行文字润色、技术校对等工作。 12 | **发布**,负责将校对后的文章,排版发布到 Go中文网。 13 | 14 | ## Go语言中文网功能支持 15 | 16 | 1. https://studygolang.com/gctt 提供支持 17 | 18 | 2. 因为主要翻译工作通过 github 进行,最后发布,通过Go语言中文网的文章发布,需要对翻译文章做一些特别处理,比如版权说明、译者等 19 | 20 | 3. 和 https://github.com/studygolang/gctt 项目做对接 21 | 22 | 4. 为译者做评级等,将来可以考虑给奖励等 -------------------------------------------------------------------------------- /static/css/search.css: -------------------------------------------------------------------------------- 1 | .search-box { margin: 15px 0; } 2 | .search-box .box_white { padding-top: 15px; padding-bottom:5px; margin-right: -15px; } 3 | .search-form {} 4 | .search-form input { border: 2px solid #222222; padding: 5px 8px; } 5 | .search-form input:focus { border: 2px solid #000000; } 6 | 7 | .search-result {} 8 | .search-result .result-title {padding: 10px 0 10px 20px; margin-bottom: 10px; text-align:center;} 9 | .search-result .result-title .website { font-style: italic; } 10 | .search-result .result-title .num { } 11 | 12 | .search-result article em { color: red; font-style: normal; } 13 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/feeds/uuid.go: -------------------------------------------------------------------------------- 1 | package feeds 2 | 3 | // relevant bits from https://github.com/abneptis/GoUUID/blob/master/uuid.go 4 | 5 | import ( 6 | "crypto/rand" 7 | "fmt" 8 | ) 9 | 10 | type UUID [16]byte 11 | 12 | // create a new uuid v4 13 | func NewUUID() *UUID { 14 | u := &UUID{} 15 | _, err := rand.Read(u[:16]) 16 | if err != nil { 17 | panic(err) 18 | } 19 | 20 | u[8] = (u[8] | 0x80) & 0xBf 21 | u[6] = (u[6] | 0x40) & 0x4f 22 | return u 23 | } 24 | 25 | func (u *UUID) String() string { 26 | return fmt.Sprintf("%x-%x-%x-%x-%x", u[:4], u[4:6], u[6:8], u[8:10], u[10:]) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/security.go: -------------------------------------------------------------------------------- 1 | package goutils 2 | 3 | import ( 4 | "net/url" 5 | "sort" 6 | ) 7 | 8 | // GenSign 根据输入参数进行签名 9 | func GenSign(args url.Values, secretKey string) string { 10 | keys := make([]string, 0, len(args)) 11 | for k := range args { 12 | if k == "sign" { 13 | continue 14 | } 15 | keys = append(keys, k) 16 | } 17 | sort.Sort(sort.StringSlice(keys)) 18 | 19 | buffer := NewBuffer() 20 | for _, k := range keys { 21 | buffer.Append(k).Append("=").Append(args.Get(k)) 22 | } 23 | 24 | buffer.Append(secretKey) 25 | 26 | return Md5(buffer.String()) 27 | } 28 | -------------------------------------------------------------------------------- /model/friend_link.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | type FriendLink struct { 12 | Id int `json:"-" xorm:"pk autoincr"` 13 | Name string `json:"name"` 14 | Url string `json:"url"` 15 | Logo string `json:"logo"` 16 | Seq int `json:"-"` 17 | CreatedAt time.Time `json:"-" xorm:"created"` 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/log/logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import "io" 4 | 5 | type ( 6 | // Logger defines the logging interface. 7 | Logger interface { 8 | SetOutput(io.Writer) 9 | SetLevel(uint8) 10 | Print(...interface{}) 11 | Printf(string, ...interface{}) 12 | Debug(...interface{}) 13 | Debugf(string, ...interface{}) 14 | Info(...interface{}) 15 | Infof(string, ...interface{}) 16 | Warn(...interface{}) 17 | Warnf(string, ...interface{}) 18 | Error(...interface{}) 19 | Errorf(string, ...interface{}) 20 | Fatal(...interface{}) 21 | Fatalf(string, ...interface{}) 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /model/wechat.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // https://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import ( 10 | "time" 11 | ) 12 | 13 | // 微信绑定用户信息 14 | type WechatUser struct { 15 | Id int `xorm:"pk autoincr"` 16 | Openid string 17 | Nickname string 18 | Avatar string 19 | SessionKey string 20 | OpenInfo string 21 | Uid int 22 | CreatedAt time.Time 23 | UpdatedAt time.Time `xorm:"<-"` 24 | } 25 | -------------------------------------------------------------------------------- /model/dynamic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | // 动态(go动态;本站动态等) 12 | type Dynamic struct { 13 | Id int `json:"id" xorm:"pk autoincr"` 14 | Content string `json:"content"` 15 | Dmtype int `json:"dmtype"` 16 | Url string `json:"url"` 17 | Seq int `json:"seq"` 18 | Ctime time.Time `json:"ctime" xorm:"created"` 19 | } 20 | -------------------------------------------------------------------------------- /model/user_setting.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | const ( 12 | KeyNewUserWait = "new_user_wait" // 新用户注册多久能发布帖子,单位秒,0表示没限制 13 | KeyCanEditTime = "can_edit_time" // 发布后多久内能够编辑,单位秒 14 | ) 15 | 16 | type UserSetting struct { 17 | Id int `xorm:"pk autoincr"` 18 | Key string 19 | Value int 20 | CreatedAt time.Time `xorm:"created"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/huichen/sego/license.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Hui Chen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /model/github_user.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | type GithubUser struct { 10 | Id int `json:"id"` 11 | Login string `json:"login"` 12 | AvatarUrl string `json:"avatar_url"` 13 | Email string `json:"email"` 14 | Name string `json:"name"` 15 | Company string `json:"company"` 16 | Blog string `json:"blog"` 17 | Location string `json:"location"` 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/autosave/lang/zh.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang('autosave', 'zh', { 6 | dateFormat: 'LLL', 7 | autoSaveMessage: '自動儲存 :)', 8 | loadSavedContent: '你在 “{0}” 有一個自動儲存的版本。你想要比較新舊內容,並選擇使用哪一個嗎?點取消按鈕將會移除先前的自動儲存紀錄。', 9 | title: '新舊內容比較', 10 | loadedContent: '目前內容', 11 | autoSavedContent: '自動儲存的內容: \'', 12 | ok: '是,我要讀取自動儲存的內容', 13 | no: '否', 14 | diffType: '選擇比較方式:', 15 | sideBySide: '雙欄式', 16 | inline: '條列式' 17 | }); 18 | -------------------------------------------------------------------------------- /static/dist/js/preview.min.js: -------------------------------------------------------------------------------- 1 | $(function(){$("#markdown-content").on("keydown",function(t){if(9==t.keyCode){t.preventDefault();var e=this.selectionStart,n=this.selectionEnd,i=window.getSelection().toString();i="\t"+i.replace(/\n/g,"\n\t"),this.value=this.value.substring(0,e)+i+this.value.substring(n),this.setSelectionRange(e+"\t".length,e+i.length)}}),$("#markdown-content").on("input propertychange",function(){var t=$(this).val();marked=SG.markSettingNoHightlight();var e=marked(t);e=SG.replaceCodeChar(e),$("#content-preview").html(e),Prism.highlightAll(),emojify.run($("#content-preview").get(0))}),$("#markdown-content").pasteUploadImage("/image/paste_upload")}); -------------------------------------------------------------------------------- /static/js/admin/authority/modify.js: -------------------------------------------------------------------------------- 1 | jQuery(function($){ 2 | var allmenu2 = $.parseJSON(ALL_MENU2); 3 | var optionHtml = ''; 4 | var menu1 = $('#menu1').val(); 5 | var curMenu2 = allmenu2[menu1]; 6 | for(var i in curMenu2) { 7 | if (curMenu2[i][0] == menu2) { 8 | optionHtml += ''; 9 | } else { 10 | optionHtml += ''; 11 | } 12 | } 13 | $('#menu2').html(optionHtml); 14 | $.uniform.update("#menu2"); 15 | 16 | window.formSuccCallback = function(data) {} 17 | }); -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/driver.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Driver interface { 4 | Parse(string, string) (*Uri, error) 5 | } 6 | 7 | var ( 8 | drivers = map[string]Driver{} 9 | ) 10 | 11 | func RegisterDriver(driverName string, driver Driver) { 12 | if driver == nil { 13 | panic("core: Register driver is nil") 14 | } 15 | if _, dup := drivers[driverName]; dup { 16 | panic("core: Register called twice for driver " + driverName) 17 | } 18 | drivers[driverName] = driver 19 | } 20 | 21 | func QueryDriver(driverName string) Driver { 22 | return drivers[driverName] 23 | } 24 | 25 | func RegisteredDriverSize() int { 26 | return len(drivers) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/rand.go: -------------------------------------------------------------------------------- 1 | package goutils 2 | 3 | import ( 4 | "fmt" 5 | "math/rand" 6 | "strconv" 7 | 8 | "github.com/jmcvetta/randutil" 9 | ) 10 | 11 | const DefaultCharset = randutil.Alphanumeric + "!%@#" 12 | 13 | // RandString 产生随机字符串,可用于密码等 14 | func RandString(n int, defaultCharsets ...string) string { 15 | charset := DefaultCharset 16 | if len(defaultCharsets) > 0 { 17 | charset = defaultCharsets[0] 18 | } 19 | 20 | result, err := randutil.String(n, charset) 21 | if err != nil { 22 | fmt.Println("goutils RandString error:", err) 23 | return Md5(strconv.Itoa(rand.Intn(999999))) 24 | } 25 | 26 | return result 27 | } 28 | -------------------------------------------------------------------------------- /static/js/admin/authority/new.js: -------------------------------------------------------------------------------- 1 | jQuery(function($){ 2 | var allmenu2 = $.parseJSON(ALL_MENU2); 3 | 4 | $('#menu1').on('change', function(){ 5 | var optionHtml = ''; 6 | 7 | var menu1 = $(this).val(); 8 | if (menu1 == 0) { 9 | $('#menu2').html(optionHtml); 10 | $('#menu2').get(0).options[0].selected = 0; 11 | $.uniform.update("#menu2"); 12 | return 13 | } 14 | 15 | var curMenu2 = allmenu2[menu1]; 16 | for(var i in curMenu2) { 17 | optionHtml += ''; 18 | } 19 | 20 | $('#menu2').html(optionHtml); 21 | 22 | }); 23 | }); -------------------------------------------------------------------------------- /model/learning_material.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | type LearningMaterial struct { 12 | Id int `json:"-" xorm:"pk autoincr"` 13 | Title string `json:"title"` 14 | Url string `json:"url"` 15 | Type int `json:"type"` 16 | Seq int `json:"-"` 17 | FirstUrl string `json:"first_url"` 18 | CreatedAt time.Time `json:"-" xorm:"created"` 19 | } 20 | -------------------------------------------------------------------------------- /template/500.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}对不起,该页面出错了 {{end}} 2 | {{define "content"}} 3 |
4 |
5 |

对不起,该页面出错了。请反馈给我们

6 |

将在3秒后跳转到首页

7 |
8 |
9 | {{end}} 10 | {{define "js"}} 11 | 23 | {{end}} -------------------------------------------------------------------------------- /model/authority.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | // 权限信息 10 | type Authority struct { 11 | Aid int `json:"aid" xorm:"pk autoincr"` 12 | Name string `json:"name"` 13 | Menu1 int `json:"menu1"` 14 | Menu2 int `json:"menu2"` 15 | Route string `json:"route"` 16 | OpUser string `json:"op_user"` 17 | Ctime OftenTime `json:"ctime" xorm:"created"` 18 | Mtime OftenTime `json:"mtime" xorm:"<-"` 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /template/sidebar/concern.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/websocket/dial.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package websocket 6 | 7 | import ( 8 | "crypto/tls" 9 | "net" 10 | ) 11 | 12 | func dialWithDialer(dialer *net.Dialer, config *Config) (conn net.Conn, err error) { 13 | switch config.Location.Scheme { 14 | case "ws": 15 | conn, err = dialer.Dial("tcp", parseAuthority(config.Location)) 16 | 17 | case "wss": 18 | conn, err = tls.DialWithDialer(dialer, "tcp", parseAuthority(config.Location), config.TlsConfig) 19 | 20 | default: 21 | err = ErrBadScheme 22 | } 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/base/api_base.proto: -------------------------------------------------------------------------------- 1 | // Built-in base types for API calls. Primarily useful as return types. 2 | 3 | syntax = "proto2"; 4 | option go_package = "base"; 5 | 6 | package appengine.base; 7 | 8 | message StringProto { 9 | required string value = 1; 10 | } 11 | 12 | message Integer32Proto { 13 | required int32 value = 1; 14 | } 15 | 16 | message Integer64Proto { 17 | required int64 value = 1; 18 | } 19 | 20 | message BoolProto { 21 | required bool value = 1; 22 | } 23 | 24 | message DoubleProto { 25 | required double value = 1; 26 | } 27 | 28 | message BytesProto { 29 | required bytes value = 1 [ctype=CORD]; 30 | } 31 | 32 | message VoidProto { 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/README.md: -------------------------------------------------------------------------------- 1 | # Gommon [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/gommon) [![Build Status](http://img.shields.io/travis/labstack/gommon.svg?style=flat-square)](https://travis-ci.org/labstack/gommon) [![Coverage Status](http://img.shields.io/coveralls/labstack/gommon.svg?style=flat-square)](https://coveralls.io/r/labstack/gommon) 2 | 3 | Common packages for Go 4 | - [Bytes](https://github.com/labstack/gommon/tree/master/bytes) - Format/parse bytes. 5 | - [Color](https://github.com/labstack/gommon/tree/master/color) - Style terminal text. 6 | - [Log](https://github.com/labstack/gommon/tree/master/log) - Simple logging. 7 | -------------------------------------------------------------------------------- /vendor/github.com/lunny/html2md/core.go: -------------------------------------------------------------------------------- 1 | package html2md 2 | 3 | import "regexp" 4 | 5 | const ( 6 | Foreign = iota 7 | Void 8 | ) 9 | 10 | type ReplaceFunc func(string, []string) string 11 | 12 | type Rule struct { 13 | Patterns []string 14 | Tp int 15 | Replacement ReplaceFunc 16 | } 17 | 18 | func AttrRegExp(attr string) *regexp.Regexp { 19 | return regexp.MustCompile(attr + `\s*=\s*["']?([^"\"']*)["']?`) 20 | } 21 | 22 | var ( 23 | rules = make(map[string]*Rule) 24 | converts = make([]func(string) string, 0) 25 | ) 26 | 27 | func AddRule(name string, rule *Rule) { 28 | rules[name] = rule 29 | } 30 | 31 | func AddConvert(f func(string) string) { 32 | converts = append(converts, f) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /http/controller/wide.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package controller 8 | 9 | import "github.com/labstack/echo" 10 | 11 | // WideController . 12 | type WideController struct{} 13 | 14 | // RegisterRoute 注册路由 15 | func (w WideController) RegisterRoute(g *echo.Group) { 16 | g.GET("/wide/playground", w.Playground) 17 | } 18 | 19 | // Playground Wide 的内嵌 iframe 的 playground 20 | func (WideController) Playground(ctx echo.Context) error { 21 | return render(ctx, "wide/playground.html", nil) 22 | } 23 | -------------------------------------------------------------------------------- /logic/rank_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package logic_test 8 | 9 | import ( 10 | "logic" 11 | "model" 12 | "testing" 13 | ) 14 | 15 | func TestGenRank(t *testing.T) { 16 | needRankTypes := []int{ 17 | model.TypeTopic, 18 | model.TypeResource, 19 | model.TypeProject, 20 | model.TypeArticle, 21 | model.TypeBook, 22 | } 23 | 24 | for _, objtype := range needRankTypes { 25 | logic.DefaultRank.GenWeekRank(objtype) 26 | logic.DefaultRank.GenMonthRank(objtype) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | > Note: gorilla/context, having been born well before `context.Context` existed, does not play well 8 | > with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`. 9 | 10 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 11 | -------------------------------------------------------------------------------- /model/like.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | const ( 12 | FlagCancel = iota 13 | FlagLike // 喜欢 14 | FlagUnlike // 不喜欢(暂时不支持) 15 | ) 16 | 17 | // 赞(喜欢) 18 | type Like struct { 19 | Uid int `json:"uid"` 20 | Objid int `json:"objid"` 21 | Objtype int `json:"objtype"` 22 | Flag int `json:"flag"` 23 | Ctime time.Time `json:"ctime" xorm:"<-"` 24 | } 25 | 26 | func (*Like) TableName() string { 27 | return "likes" 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/glide.lock: -------------------------------------------------------------------------------- 1 | hash: e55ed1b26ebd131b2a6f7bb5bcbac90529cccd68976513e2648f38fe55fdd807 2 | updated: 2016-04-24T08:29:37.021386935-07:00 3 | imports: 4 | - name: github.com/mattn/go-colorable 5 | version: bc69d6cebca8dd5675346a34a1c545b67dc74d5e 6 | - name: github.com/mattn/go-isatty 7 | version: 56b76bdf51f7708750eac80fa38b952bb9f32639 8 | - name: github.com/stretchr/testify 9 | version: c5d7a69bf8a2c9c374798160849c071093e41dd1 10 | subpackages: 11 | - assert 12 | - name: github.com/valyala/fasttemplate 13 | version: 3b874956e03f1636d171bda64b130f9135f42cff 14 | - name: golang.org/x/sys 15 | version: f64b50fbea64174967a8882830d621a18ee1548e 16 | subpackages: 17 | - unix 18 | devImports: [] 19 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/autosave/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang('autosave', 'zh-cn', { 6 | dateFormat: 'LLL', 7 | autoSaveMessage: '自动保存', 8 | loadSavedContent: '已经存在这个内容之前保存的版本 "{0}". 你希望比较两个不同的版本并从中选择你想要加载的那个么?', 9 | title: '比较自动保存的版本', 10 | loadedContent: '已经加载的内容', 11 | localStorageFull: 'Browser localStorage is full, clear your storage or Increase database size', 12 | autoSavedContent: '自动保存的内容: \'', 13 | ok: '我确认,加载自动保存的内容', 14 | no: '取消', 15 | diffType: '选择视图类型:', 16 | sideBySide: '并排视图', 17 | inline: '内嵌视图' 18 | }); 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/builder_delete.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package builder 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // Delete creates a delete Builder 12 | func Delete(conds ...Cond) *Builder { 13 | builder := &Builder{cond: NewCond()} 14 | return builder.Delete(conds...) 15 | } 16 | 17 | func (b *Builder) deleteWriteTo(w Writer) error { 18 | if len(b.tableName) <= 0 { 19 | return ErrNoTableName 20 | } 21 | 22 | if _, err := fmt.Fprintf(w, "DELETE FROM %s WHERE ", b.tableName); err != nil { 23 | return err 24 | } 25 | 26 | return b.cond.WriteTo(w) 27 | } 28 | -------------------------------------------------------------------------------- /template/403.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}对不起,没有操作权限 {{end}} 2 | {{define "content"}} 3 |
4 |
5 |

对不起,您没有操作权限

6 |

7 | {{if .msg}} 8 | {{noescape .msg}} 9 | {{else}} 10 | 将在3秒后跳转到首页

11 | {{end}} 12 |
13 |
14 | {{end}} 15 | {{define "js"}} 16 | 31 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/ilogger.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type LogLevel int 4 | 5 | const ( 6 | // !nashtsai! following level also match syslog.Priority value 7 | LOG_DEBUG LogLevel = iota 8 | LOG_INFO 9 | LOG_WARNING 10 | LOG_ERR 11 | LOG_OFF 12 | LOG_UNKNOWN 13 | ) 14 | 15 | // logger interface 16 | type ILogger interface { 17 | Debug(v ...interface{}) 18 | Debugf(format string, v ...interface{}) 19 | Error(v ...interface{}) 20 | Errorf(format string, v ...interface{}) 21 | Info(v ...interface{}) 22 | Infof(format string, v ...interface{}) 23 | Warn(v ...interface{}) 24 | Warnf(format string, v ...interface{}) 25 | 26 | Level() LogLevel 27 | SetLevel(l LogLevel) 28 | 29 | ShowSQL(show ...bool) 30 | IsShowSQL() bool 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /http/controller/admin/tool.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package admin 8 | 9 | import ( 10 | "sander/logic" 11 | 12 | "github.com/labstack/echo" 13 | ) 14 | 15 | // ToolController . 16 | type ToolController struct{} 17 | 18 | // RegisterRoute 注册路由 19 | func (t ToolController) RegisterRoute(g *echo.Group) { 20 | g.GET("/tool/sitemap", t.GenSitemap) 21 | } 22 | 23 | // GenSitemap . 24 | func (ToolController) GenSitemap(ctx echo.Context) error { 25 | logic.GenSitemap() 26 | return render(ctx, "tool/sitemap.html", nil) 27 | } 28 | -------------------------------------------------------------------------------- /static/dist/js/message.min.js: -------------------------------------------------------------------------------- 1 | (function(){emojify.setConfig({only_crawl_id:null,img_dir:SG.EMOJI_DOMAIN,ignored_tags:{SCRIPT:1,TEXTAREA:1,A:1,PRE:1,CODE:1}}),SG.Message=function(){},SG.Message.prototype=new SG.Publisher,SG.Message.prototype.parseContent=function(e){var t=e.text();marked.setOptions({highlight:function(e){return e=(e=(e=e.replace(/"/g,'"')).replace(/</g,"<")).replace(/>/g,">"),hljs.highlightAuto(e).value}}),e.html(marked(t)),emojify.run(e.get(0))},jQuery(document).ready(function(e){e("#submit").on("click",function(t){t.preventDefault();if(!e(".validate-form").validate().form())return!1;(new SG.Message).publish(this)}),e(document).keypress(function(t){!t.ctrlKey||10!=t.which&&13!=t.which||e("#submit").click()}),SG.registerAtEvent(!1,!0)})}).call(this); -------------------------------------------------------------------------------- /static/js/admin/jquery.equalHeight.js: -------------------------------------------------------------------------------- 1 | // make sure the $ is pointing to JQuery and not some other library 2 | (function($){ 3 | // add a new method to JQuery 4 | 5 | $.fn.equalHeight = function() { 6 | // find the tallest height in the collection 7 | // that was passed in (.column) 8 | tallest = 0; 9 | this.each(function(){ 10 | thisHeight = $(this).height(); 11 | if( thisHeight > tallest) 12 | tallest = thisHeight; 13 | }); 14 | 15 | // set each items height to use the tallest value found 16 | this.each(function(){ 17 | $(this).height(tallest); 18 | }); 19 | } 20 | })(jQuery); -------------------------------------------------------------------------------- /vendor/github.com/twinj/uuid/appveyor.yml: -------------------------------------------------------------------------------- 1 | # version format 2 | version: "{build}" 3 | 4 | # Operating system (build VM template) 5 | os: Windows Server 2012 R2 6 | 7 | clone_folder: c:\gopath\src\github.com\twinj\uuid 8 | 9 | # environment variables 10 | environment: 11 | GOPATH: c:\gopath 12 | 13 | # scripts that run after cloning repository 14 | install: 15 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 16 | - go version 17 | - go env 18 | - go get -t -v ./... 19 | 20 | # to run your custom scripts instead of automatic MSBuild 21 | build_script: 22 | - go vet -x ./... 23 | - gofmt -s -l -e . 24 | - go test -short -v 25 | - go test -short -race -v 26 | 27 | # to disable automatic tests 28 | test: off 29 | 30 | # to disable deployment 31 | deploy: off -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /http/controller/app/routes.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package app 8 | 9 | import "github.com/labstack/echo" 10 | 11 | // RegisterRoutes . 12 | func RegisterRoutes(g *echo.Group) { 13 | new(IndexController).RegisterRoute(g) 14 | new(ArticleController).RegisterRoute(g) 15 | new(TopicController).RegisterRoute(g) 16 | new(ResourceController).RegisterRoute(g) 17 | new(ProjectController).RegisterRoute(g) 18 | new(UserController).RegisterRoute(g) 19 | new(WechatController).RegisterRoute(g) 20 | new(CommentController).RegisterRoute(g) 21 | } 22 | -------------------------------------------------------------------------------- /liquibase/liquibase.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if "%OS%" == "Windows_NT" setlocal 3 | 4 | setlocal enabledelayedexpansion 5 | 6 | rem %~dp0 is expanded pathname of the current script under NT 7 | set LIQUIBASE_HOME="%~dp0" 8 | 9 | set CP=. 10 | for /R %LIQUIBASE_HOME% %%f in (liquibase*.jar) do set CP=!CP!;%%f 11 | for /R %LIQUIBASE_HOME%\lib %%f in (*.jar) do set CP=!CP!;%%f 12 | 13 | rem get command line args into a variable 14 | set CMD_LINE_ARGS=%1 15 | if ""%1""=="""" goto done 16 | shift 17 | :setup 18 | if ""%1""=="""" goto done 19 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 20 | shift 21 | goto setup 22 | :done 23 | 24 | IF NOT DEFINED JAVA_OPTS set JAVA_OPTS= 25 | 26 | java -cp "%CP%" %JAVA_OPTS% liquibase.integration.commandline.Main %CMD_LINE_ARGS% 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/engine_maxlife.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package xorm 8 | 9 | import "time" 10 | 11 | // SetConnMaxLifetime sets the maximum amount of time a connection may be reused. 12 | func (engine *Engine) SetConnMaxLifetime(d time.Duration) { 13 | engine.db.SetConnMaxLifetime(d) 14 | } 15 | 16 | // SetConnMaxLifetime sets the maximum amount of time a connection may be reused. 17 | func (eg *EngineGroup) SetConnMaxLifetime(d time.Duration) { 18 | eg.Engine.SetConnMaxLifetime(d) 19 | for i := 0; i < len(eg.slaves); i++ { 20 | eg.slaves[i].SetConnMaxLifetime(d) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /static/css/libs/jquery.cftoaster.1.0.1.css: -------------------------------------------------------------------------------- 1 | .cf_toaster { 2 | position: absolute; 3 | overflow: visible; 4 | z-index: 999999; 5 | left: 50%; 6 | } 7 | 8 | .cf_toaster .background { 9 | position: absolute; 10 | overflow: hidden; 11 | width: 100%; 12 | height: 100%; 13 | z-index: 0; 14 | -moz-border-radius: 2px; 15 | border-radius: 2px; 16 | filter:alpha(opacity=95); 17 | opacity:0.95; 18 | -moz-box-shadow: 0px 0px 10px #1a1a1a; 19 | -webkit-box-shadow: 0px 0px 10px #1a1a1a; 20 | box-shadow: 0px 0px 10px #1a1a1a; 21 | } 22 | 23 | .cf_toaster .content { 24 | position: relative; 25 | overflow: hidden; 26 | z-index: 1; 27 | text-align: center; 28 | font-size: 15px; 29 | font-weight: normal; 30 | line-height: 20px; 31 | padding: 10px; 32 | text-shadow: none; 33 | } 34 | -------------------------------------------------------------------------------- /cmd/main/pprof.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: meission meission@aliyun.com 6 | 7 | package main 8 | 9 | import ( 10 | "net/http" 11 | "net/http/pprof" 12 | ) 13 | 14 | // Pprof start http pprof. 15 | func Pprof(addr string) { 16 | ps := http.NewServeMux() 17 | ps.HandleFunc("/debug/pprof/", pprof.Index) 18 | ps.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) 19 | ps.HandleFunc("/debug/pprof/profile", pprof.Profile) 20 | ps.HandleFunc("/debug/pprof/symbol", pprof.Symbol) 21 | go func() { 22 | if err := http.ListenAndServe(addr, ps); err != nil { 23 | panic(err) 24 | } 25 | }() 26 | } 27 | -------------------------------------------------------------------------------- /http/controller/link.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package controller 8 | 9 | import ( 10 | "sander/logic" 11 | 12 | "github.com/labstack/echo" 13 | ) 14 | 15 | type LinkController struct{} 16 | 17 | // 注册路由 18 | func (l LinkController) RegisterRoute(g *echo.Group) { 19 | g.GET("/links", l.FindLinks) 20 | } 21 | 22 | // FindLinks 友情链接 23 | func (LinkController) FindLinks(ctx echo.Context) error { 24 | 25 | friendLinks := logic.DefaultFriendLink.FindAll(ctx) 26 | 27 | return render(ctx, "link.html", map[string]interface{}{"links": friendLinks}) 28 | } 29 | -------------------------------------------------------------------------------- /static/dist/css/table_data.min.css: -------------------------------------------------------------------------------- 1 | table.data td.d,table.data th.h{text-align:left;font-size:13px;border-right:1px solid #ccc;padding:5px}table.data th.h{font-weight:700;border-bottom:2px solid #ccc;text-shadow:0 1px 0 #fff;background:#f5f5f5;background:-moz-linear-gradient(top,#f5f5f5 0,#e2e2e2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f5f5f5),color-stop(100%,#e2e2e2));background:-webkit-linear-gradient(top,#f5f5f5 0,#e2e2e2 100%);background:-o-linear-gradient(top,#f5f5f5 0,#e2e2e2 100%);background:-ms-linear-gradient(top,#f5f5f5 0,#e2e2e2 100%);background:linear-gradient(top,#f5f5f5 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e2e2e2', GradientType=0 )}table.data td.d{font-weight:400;border-bottom:1px solid #ccc} -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /logic/download.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // https://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import ( 10 | "sander/db" 11 | "sander/logger" 12 | "sander/model" 13 | 14 | "golang.org/x/net/context" 15 | ) 16 | 17 | type DownloadLogic struct{} 18 | 19 | var DefaultDownload = DownloadLogic{} 20 | 21 | func (DownloadLogic) FindAll(ctx context.Context) []*model.Download { 22 | downloads := make([]*model.Download, 0) 23 | err := db.MasterDB.Desc("seq").Find(&downloads) 24 | if err != nil { 25 | logger.Error("DownloadLogic FindAll Error:%+v", err) 26 | } 27 | 28 | return downloads 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | _ "github.com/mattn/go-isatty" 10 | ) 11 | 12 | // NewColorable return new instance of Writer which handle escape sequence. 13 | func NewColorable(file *os.File) io.Writer { 14 | if file == nil { 15 | panic("nil passed instead of *os.File to NewColorable()") 16 | } 17 | 18 | return file 19 | } 20 | 21 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 22 | func NewColorableStdout() io.Writer { 23 | return os.Stdout 24 | } 25 | 26 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 27 | func NewColorableStderr() io.Writer { 28 | return os.Stderr 29 | } 30 | -------------------------------------------------------------------------------- /cmd/crawler/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package main 8 | 9 | import ( 10 | "time" 11 | 12 | "math/rand" 13 | "sander/cmd" 14 | "sander/config" 15 | "sander/logger" 16 | 17 | "github.com/polaris1119/keyword" 18 | ) 19 | 20 | func init() { 21 | // 设置随机数种子 22 | rand.Seed(time.Now().Unix()) 23 | } 24 | 25 | func main() { 26 | logger.Init(config.ROOT + "/log/crawler") 27 | go keyword.Extractor.Init(keyword.DefaultProps, true, config.ROOT+"/data/programming.txt,"+config.ROOT+"/data/dictionary.txt") 28 | 29 | server.CrawlServer() 30 | 31 | select {} 32 | } 33 | -------------------------------------------------------------------------------- /cmd/indexer/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package main 8 | 9 | import ( 10 | "math/rand" 11 | "time" 12 | 13 | "sander/cmd" 14 | "sander/config" 15 | "sander/logger" 16 | 17 | "github.com/polaris1119/keyword" 18 | ) 19 | 20 | func init() { 21 | // 设置随机数种子 22 | rand.Seed(time.Now().Unix()) 23 | } 24 | 25 | func main() { 26 | logger.Init(config.ROOT + "/log/indexer") 27 | go keyword.Extractor.Init(keyword.DefaultProps, true, config.ROOT+"/data/programming.txt,"+config.ROOT+"/data/dictionary.txt") 28 | 29 | server.IndexingServer() 30 | 31 | select {} 32 | } 33 | -------------------------------------------------------------------------------- /model/download.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // https://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package model 8 | 9 | import "time" 10 | 11 | const ( 12 | DLArchived = iota 13 | DLStable 14 | DLFeatured 15 | DLUnstable 16 | ) 17 | 18 | // Download go 下载 19 | type Download struct { 20 | Id int `xorm:"pk autoincr"` 21 | Version string 22 | Filename string 23 | Kind string 24 | OS string `xorm:"os"` 25 | Arch string 26 | Size int 27 | Checksum string 28 | Category int 29 | IsRecommend bool 30 | Seq int 31 | CreatedAt time.Time `xorm:"created"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/times/README.md: -------------------------------------------------------------------------------- 1 | # times 2 | 3 | golang的time辅助包 4 | 5 | 1. 写此包的原因: 6 | Go原生的time包封装程度不够,用起来没那么顺手,而且Format很是奇怪,必须基于2006年1月2日15:04:05;此包是对time包的一些封装 7 | 2. 实现方式:参照PHP的date()函数和strtotime()函数实现,使用方式也与这两个函数类似。 8 | 9 | 10 | # 使用实例 11 | 12 | - 字符串转为time.Time类型: 13 | 14 | ``` 15 | t := times.StrToLocalTime("2012-11-12 23:32:01") 16 | t := times.StrToLocalTime("2012-11-12") 17 | ``` 18 | 19 | 原生的Go包这么实现: 20 | 21 | ``` 22 | t := time.Date(2012, 11, 12, 23, 32, 01, 0, time.Local) 23 | t := time.Date(2012, 11, 12, 0, 0, 0, 0, time.Local) 24 | ``` 25 | 26 | - time.Time类型格式化为字符串: 27 | 28 | ``` 29 | now := time.Now() 30 | strTime := times.Format("Y-m-d H:i:s", now) 31 | ``` 32 | 33 | 原生的Go包这么实现: 34 | 35 | ``` 36 | strTime := time.Now().Format("2006-01-02 15:04:05") 37 | ``` 38 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable return new instance of Writer which handle escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/ssor/bom/bom.go: -------------------------------------------------------------------------------- 1 | package bom 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "io/ioutil" 7 | ) 8 | 9 | const ( 10 | bom0 = 0xef 11 | bom1 = 0xbb 12 | bom2 = 0xbf 13 | ) 14 | 15 | // CleanBom returns b with the 3 byte BOM stripped off the front if it is present. 16 | // If the BOM is not present, then b is returned. 17 | func CleanBom(b []byte) []byte { 18 | if len(b) >= 3 && 19 | b[0] == bom0 && 20 | b[1] == bom1 && 21 | b[2] == bom2 { 22 | return b[3:] 23 | } 24 | return b 25 | } 26 | 27 | // NewReaderWithoutBom returns an io.Reader that will skip over initial UTF-8 byte order marks. 28 | func NewReaderWithoutBom(r io.Reader) (io.Reader, error) { 29 | bs, err := ioutil.ReadAll(r) 30 | if err != nil { 31 | return nil, err 32 | } 33 | return bytes.NewReader(CleanBom(bs)), nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /http/controller/captcha.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of captchaHandler source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package controller 8 | 9 | import ( 10 | xhttp "sander/http" 11 | 12 | "github.com/dchest/captcha" 13 | "github.com/labstack/echo" 14 | ) 15 | 16 | var captchaHandler = captcha.Server(100, 40) 17 | 18 | // 验证码 19 | type CaptchaController struct{} 20 | 21 | func (c CaptchaController) RegisterRoute(g *echo.Group) { 22 | g.Get("/captcha/*", c.Server) 23 | } 24 | 25 | func (CaptchaController) Server(ctx echo.Context) error { 26 | captchaHandler.ServeHTTP(xhttp.ResponseWriter(ctx), xhttp.Request(ctx)) 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /static/js/account.js: -------------------------------------------------------------------------------- 1 | // 账号(登录/注册/忘记密码等)相关js功能 2 | (function(){ 3 | SG.Register = function(){} 4 | SG.Register.prototype = new SG.Publisher(); 5 | 6 | jQuery(document).ready(function($) { 7 | 8 | var origSrc = ''; 9 | $('#captcha_img').on('click', function(evt){ 10 | evt.preventDefault(); 11 | 12 | if (origSrc == '') { 13 | origSrc = $(this).attr("src"); 14 | } 15 | $(this).attr("src", origSrc+"?reload=" + (new Date()).getTime()); 16 | }); 17 | 18 | // 注册 19 | $('#register-submit').on('click', function(evt){ 20 | evt.preventDefault(); 21 | var $form = $('.validate-form'); 22 | var validator = $form.validate(); 23 | if (!validator.form()) { 24 | return false; 25 | } 26 | 27 | $form.submit(); 28 | // new SG.Register().publish(this); 29 | }); 30 | }); 31 | }).call(this); 32 | -------------------------------------------------------------------------------- /template/gctt/apply.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}申请成为译者 - Go中文翻译组(GCTT) {{end}} 2 | {{define "content"}} 3 |
4 |
5 |
6 | 11 |
12 |
13 | 绑定 GitHub 账号:绑定 GitHub 14 |
15 |
16 |
17 |
18 |
19 | 20 | {{include "common/my_info.html" .}} 21 |
22 |
23 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package xorm 8 | 9 | import "context" 10 | 11 | // PingContext tests if database is alive 12 | func (engine *Engine) PingContext(ctx context.Context) error { 13 | session := engine.NewSession() 14 | defer session.Close() 15 | return session.PingContext(ctx) 16 | } 17 | 18 | // PingContext test if database is ok 19 | func (session *Session) PingContext(ctx context.Context) error { 20 | if session.isAutoClose { 21 | defer session.Close() 22 | } 23 | 24 | session.engine.logger.Infof("PING DATABASE %v", session.engine.DriverName()) 25 | return session.DB().PingContext(ctx) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /static/js/base/upload.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(){ 2 | 3 | $('.upload_img_single').Huploadify({ 4 | auto: true, 5 | fileTypeExts: '*.png;*.jpg;*.JPG;*.bmp;*.gif',// 不限制上传文件请修改成'*.*' 6 | multi:false, 7 | fileSizeLimit: 5*1024*1024, // 大小限制 8 | uploader : '/image/upload', // 文件上传目标地址 9 | buttonText : '上传', 10 | fileObjName : 'img', 11 | showUploadedPercent:true, 12 | onUploadSuccess : function(file, data) { 13 | data = $.parseJSON(data); 14 | if (data.ok) { 15 | var url = data.data.url; 16 | $('.img_url').val(url); 17 | $('img.show_img').attr('src', url); 18 | $('a.show_img').attr('href', url); 19 | } else { 20 | if (window.jAlert) { 21 | jAlert(data.error, '错误'); 22 | } else { 23 | alert(data.error); 24 | } 25 | } 26 | } 27 | }); 28 | }); -------------------------------------------------------------------------------- /template/common/view_stat.html: -------------------------------------------------------------------------------- 1 | {{if .view_user_num}} 2 |
3 |
4 |
统计信息
5 |
6 | 目前已有 {{.view_user_num}} 位注册会员查看 7 |
8 | {{if .view_source.Id}} 9 |
    10 | {{if .view_source.Google}}
  • {{.view_source.Google}} 次来自 Google 点击
  • {{end}} 11 | {{if .view_source.Baidu}}
  • {{.view_source.Baidu}} 次来自 Baidu 点击
  • {{end}} 12 | {{if .view_source.Bing}}
  • {{.view_source.Bing}} 次来自 Bing 点击
  • {{end}} 13 | {{if .view_source.Sogou}}
  • {{.view_source.Sogou}} 次来自 Sogou 点击
  • {{end}} 14 | {{if .view_source.So}}
  • {{.view_source.So}} 次来自 360搜索 点击
  • {{end}} 15 | {{if .view_source.Other}}
  • {{.view_source.Other}} 次外链点击
  • {{end}} 16 |
17 | {{end}} 18 |
19 | {{end}} 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func parseFullAppID(appid string) (partition, domain, displayID string) { 12 | if i := strings.Index(appid, "~"); i != -1 { 13 | partition, appid = appid[:i], appid[i+1:] 14 | } 15 | if i := strings.Index(appid, ":"); i != -1 { 16 | domain, appid = appid[:i], appid[i+1:] 17 | } 18 | return partition, domain, appid 19 | } 20 | 21 | // appID returns "appid" or "domain.com:appid". 22 | func appID(fullAppID string) string { 23 | _, dom, dis := parseFullAppID(fullAppID) 24 | if dom != "" { 25 | return dom + ":" + dis 26 | } 27 | return dis 28 | } 29 | -------------------------------------------------------------------------------- /static/css/md_toolbar.css: -------------------------------------------------------------------------------- 1 | form .md-toolbar ul { margin-bottom:2px;} 2 | form .md-toolbar ul a { -moz-border-radius: 8px;-webkit-border-radius: 8px;border-radius: 8px;padding: 0 5px;line-height: 18px;font-size: 12px;margin-right: 6px;text-shadow: 0;color: #444;border: 1px solid #fff;} 3 | form .md-toolbar ul a:hover { text-decoration: none;} 4 | form .md-toolbar ul .cur a { background: #fff;border: 1px solid #ddd;color: #666;} 5 | form .md-toolbar .upload-img { cursor: pointer;} 6 | form .content-preview { margin-bottom: 5px; width: 100%;height: 200px;border: 1px solid #CCCCCC;border-radius: 3px 3px 3px 3px;-moz-border-radius: 3px 3px 3px 3px;display: none;padding: 4px;overflow: scroll; display: none; } 7 | 8 | .sidebar .help-block ul {padding-left: 25px;font-size: 12px;line-height: 150%;margin-right: 10px;} 9 | 10 | .tooltip {white-space: nowrap;} -------------------------------------------------------------------------------- /vendor/github.com/gorilla/securecookie/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of gorilla/securecookie authors for copyright purposes. 2 | # Please keep the list sorted. 3 | 4 | 0x434D53 5 | Abdülhamit Yilmaz 6 | Annonomus-Penguin 7 | Craig Peterson 8 | Cyril David 9 | Dmitry Chestnykh 10 | Dominik Honnef 11 | Google LLC (https://opensource.google.com/) 12 | John Downey 13 | Kamil Kisiel 14 | Keunwoo Lee 15 | Mahmud Ridwan 16 | Matt Silverlock 17 | rodrigo moraes 18 | s7v7nislands 19 | Wesley Bitter 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /template/admin/50x.html: -------------------------------------------------------------------------------- 1 | {{define "content"}} 2 |
3 |
4 |
5 |

500 Internal Server Error

6 |

The server encountered an internal error and was unable to complete your request.

7 | 8 |

Please contact the server administrator webmaster@yourdomain.com and informed them of the time the error occurred.
More information about this error may be available in the server error log.

9 |
10 |   11 | 12 |
13 |
14 |
15 | {{end}} -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /template/404.html: -------------------------------------------------------------------------------- 1 | {{define "title"}}寻找遗失儿童 {{end}} 2 | {{define "content"}} 3 |
4 |
5 |
6 |

抱歉!页面无法访问……

7 |
8 |
9 |

可能因为:

10 |
    11 |
  • 网址有错误>请检查地址是否完整或存在多余字符
  • 12 |
  • 网址已失效>可能页面已删除,活动已下线等
  • 13 |
14 |
15 | 18 |
19 |
20 | 21 |
22 |
23 | {{end}} -------------------------------------------------------------------------------- /http/middleware/admin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package middleware 8 | 9 | import ( 10 | "net/http" 11 | 12 | "sander/model" 13 | 14 | "github.com/labstack/echo" 15 | ) 16 | 17 | // AdminAuth 用于 echo 框架的判断用户是否有管理后台权限 18 | func AdminAuth() echo.MiddlewareFunc { 19 | return func(next echo.HandlerFunc) echo.HandlerFunc { 20 | return func(ctx echo.Context) error { 21 | user := ctx.Get("user").(*model.Me) 22 | if !user.IsAdmin { 23 | return ctx.HTML(http.StatusForbidden, `403 Forbidden`) 24 | } 25 | 26 | if err := next(ctx); err != nil { 27 | return err 28 | } 29 | 30 | return nil 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/structs/tags.go: -------------------------------------------------------------------------------- 1 | package structs 2 | 3 | import "strings" 4 | 5 | // tagOptions contains a slice of tag options 6 | type tagOptions []string 7 | 8 | // Has returns true if the given option is available in tagOptions 9 | func (t tagOptions) Has(opt string) bool { 10 | for _, tagOpt := range t { 11 | if tagOpt == opt { 12 | return true 13 | } 14 | } 15 | 16 | return false 17 | } 18 | 19 | // parseTag splits a struct field's tag into its name and a list of options 20 | // which comes after a name. A tag is in the form of: "name,option1,option2". 21 | // The name can be neglectected. 22 | func parseTag(tag string) (string, tagOptions) { 23 | // tag is one of followings: 24 | // "" 25 | // "name" 26 | // "name,opt" 27 | // "name,opt,opt2" 28 | // ",opt" 29 | 30 | res := strings.Split(tag, ",") 31 | return res[0], res[1:] 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/tylerb/graceful/keepalive_listener.go: -------------------------------------------------------------------------------- 1 | package graceful 2 | 3 | import ( 4 | "net" 5 | "time" 6 | ) 7 | 8 | type keepAliveConn interface { 9 | SetKeepAlive(bool) error 10 | SetKeepAlivePeriod(d time.Duration) error 11 | } 12 | 13 | // keepAliveListener sets TCP keep-alive timeouts on accepted 14 | // connections. It's used by ListenAndServe and ListenAndServeTLS so 15 | // dead TCP connections (e.g. closing laptop mid-download) eventually 16 | // go away. 17 | type keepAliveListener struct { 18 | net.Listener 19 | keepAlivePeriod time.Duration 20 | } 21 | 22 | func (ln keepAliveListener) Accept() (net.Conn, error) { 23 | c, err := ln.Listener.Accept() 24 | if err != nil { 25 | return nil, err 26 | } 27 | 28 | kac := c.(keepAliveConn) 29 | kac.SetKeepAlive(true) 30 | kac.SetKeepAlivePeriod(ln.keepAlivePeriod) 31 | return c, nil 32 | } 33 | -------------------------------------------------------------------------------- /static/dist/js/books.min.js: -------------------------------------------------------------------------------- 1 | (function(){SG.Book=function(){},SG.Book.prototype=new SG.Publisher,SG.Book.prototype.parseDesc=function(){var e=$(".book .desc").text();marked=SG.markSettingNoHightlight();var t=marked(e);t=SG.replaceCodeChar(t),$(".book .desc").html(t)},jQuery(document).ready(function(e){var t=!1;e(".desc .preview").on("click",function(){if(t)e(".preview-div").hide(),e("#desc").show(),t=!1;else{var i=e("#desc").val();marked.setOptions({highlight:function(e){return e=(e=(e=e.replace(/"/g,'"')).replace(/</g,"<")).replace(/>/g,">"),hljs.highlightAuto(e).value}}),e("#desc").hide(),e(".preview-div").html(marked(i)).show(),t=!0}}),e("#submit").on("click",function(t){t.preventDefault();if(!e(".validate-form").validate().form())return!1;(new SG.Book).publish(this)}),e(document).keypress(function(t){!t.ctrlKey||10!=t.which&&13!=t.which||e("#submit").click()})})}).call(this); -------------------------------------------------------------------------------- /vendor/github.com/jmcvetta/randutil/README.md: -------------------------------------------------------------------------------- 1 | # randutil - Random number/string utilities for the Go language 2 | 3 | This package contains assorted utility functions for creating random numbers 4 | and strings. I use this package quite a bit, especially when testing other 5 | projects. However I make no claims about the cryptographic security or other 6 | properties of the random(-ish?) numbers and strings it produces. Use at your 7 | own risk. 8 | 9 | ## API Documentation 10 | 11 | See GoDoc for [automatically generated 12 | documentation](http://godoc.org/github.com/jmcvetta/randutil). 13 | 14 | 15 | ## Status 16 | 17 | [![Build Status](https://drone.io/github.com/jmcvetta/randutil/status.png)](https://drone.io/github.com/jmcvetta/randutil/latest) 18 | [![Travis Build Status](https://travis-ci.org/jmcvetta/randutil.png)](https://travis-ci.org/jmcvetta/randutil) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /logic/dynamic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import ( 10 | "sander/db" 11 | "sander/logger" 12 | "sander/model" 13 | 14 | "golang.org/x/net/context" 15 | ) 16 | 17 | type DynamicLogic struct{} 18 | 19 | var DefaultDynamic = DynamicLogic{} 20 | 21 | // FindBy 获取动态列表(分页) 22 | func (DynamicLogic) FindBy(ctx context.Context, lastId int, limit int) []*model.Dynamic { 23 | dynamicList := make([]*model.Dynamic, 0) 24 | err := db.MasterDB.Where("id>?", lastId).OrderBy("seq DESC").Limit(limit).Find(&dynamicList) 25 | if err != nil { 26 | logger.Error("DynamicLogic FindBy Error:%+v", err) 27 | } 28 | 29 | return dynamicList 30 | } 31 | -------------------------------------------------------------------------------- /static/dist/js/projects.min.js: -------------------------------------------------------------------------------- 1 | (function(){SG.Projects=function(){},SG.Projects.prototype=new SG.Publisher,SG.Projects.prototype.parseDesc=function(){var e=$(".project .desc").text();marked=SG.markSettingNoHightlight();var t=marked(e);t=SG.replaceCodeChar(t),$(".project .desc").html(t)},jQuery(document).ready(function(e){var t=!1;e(".desc .preview").on("click",function(){if(t)e(".preview-div").hide(),e("#desc").show(),t=!1;else{var i=e("#desc").val();marked.setOptions({highlight:function(e){return e=(e=(e=e.replace(/"/g,'"')).replace(/</g,"<")).replace(/>/g,">"),hljs.highlightAuto(e).value}}),e("#desc").hide(),e(".preview-div").html(marked(i)).show(),t=!0}}),e("#submit").on("click",function(t){t.preventDefault();if(!e(".validate-form").validate().form())return!1;(new SG.Projects).publish(this)}),e(document).keypress(function(t){!t.ctrlKey||10!=t.which&&13!=t.which||e("#submit").click()})})}).call(this); -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /http/controller/admin/routes.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package admin 8 | 9 | import "github.com/labstack/echo" 10 | 11 | // RegisterRoutes . 12 | func RegisterRoutes(g *echo.Group) { 13 | new(AuthorityController).RegisterRoute(g) 14 | new(UserController).RegisterRoute(g) 15 | new(TopicController).RegisterRoute(g) 16 | new(NodeController).RegisterRoute(g) 17 | new(ArticleController).RegisterRoute(g) 18 | new(ProjectController).RegisterRoute(g) 19 | new(RuleController).RegisterRoute(g) 20 | new(ReadingController).RegisterRoute(g) 21 | new(ToolController).RegisterRoute(g) 22 | new(SettingController).RegisterRoute(g) 23 | new(MetricsController).RegisterRoute(g) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /logic/learning_material.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import ( 10 | "sander/db" 11 | "sander/logger" 12 | "sander/model" 13 | 14 | "golang.org/x/net/context" 15 | ) 16 | 17 | type LearningMaterialLogic struct{} 18 | 19 | var DefaultLearningMaterial = LearningMaterialLogic{} 20 | 21 | func (LearningMaterialLogic) FindAll(ctx context.Context) []*model.LearningMaterial { 22 | learningMaterials := make([]*model.LearningMaterial, 0) 23 | err := db.MasterDB.Asc("type").Desc("seq").Find(&learningMaterials) 24 | if err != nil { 25 | logger.Error("LearningMaterialLogic FindAll error:", err) 26 | return nil 27 | } 28 | 29 | return learningMaterials 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /logic/commenter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import ( 10 | "fmt" 11 | "time" 12 | ) 13 | 14 | // Commenter 评论接口 15 | type Commenter interface { 16 | fmt.Stringer 17 | // 评论回调接口,用于更新对象自身需要更新的数据 18 | UpdateComment(int, int, int, time.Time) 19 | } 20 | 21 | var commenters = make(map[int]Commenter) 22 | 23 | // 注册评论对象,使得某种类型(主题、博客等)被评论了可以回调 24 | func RegisterCommentObject(objtype int, commenter Commenter) { 25 | if commenter == nil { 26 | panic("logic: Register commenter is nil") 27 | } 28 | if _, dup := commenters[objtype]; dup { 29 | panic("logic: Register called twice for commenter " + commenter.String()) 30 | } 31 | commenters[objtype] = commenter 32 | } 33 | -------------------------------------------------------------------------------- /static/dist/js/topics.min.js: -------------------------------------------------------------------------------- 1 | (function(){emojify.setConfig({only_crawl_id:null,img_dir:SG.EMOJI_DOMAIN,ignored_tags:{SCRIPT:1,TEXTAREA:1,A:1,PRE:1,CODE:1}}),SG.Topics=function(){},SG.Topics.prototype=new SG.Publisher,SG.Topics.prototype.parseContent=function(t){marked=SG.markSettingNoHightlight(),t.each(function(){var t=$(this).text(),i=marked(t);i=SG.replaceCodeChar(i),$(this).html(i),emojify.run(this)})},jQuery(document).ready(function(t){t("#submit").on("click",function(i){i.preventDefault();if(!t(".validate-form").validate().form())return!1;if(0!=t(".usernames").length){var e=SG.analyzeAt(t("#content").val());t(".usernames").val(e)}(new SG.Topics).publish(this,function(t){purgeComposeDraft(uid,"topic"),setTimeout(function(){t.tid?window.location.href="/topics/"+t.tid:window.location.href="/topics"},1e3)})}),t(document).keypress(function(i){!i.ctrlKey||10!=i.which&&13!=i.which||t("#submit").click()}),SG.registerAtEvent()})}).call(this); -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/ip.go: -------------------------------------------------------------------------------- 1 | package goutils 2 | 3 | import ( 4 | "encoding/binary" 5 | "net" 6 | "net/http" 7 | ) 8 | 9 | const ( 10 | XForwardedFor = "X-Forwarded-For" 11 | XRealIP = "X-Real-IP" 12 | ) 13 | 14 | // RemoteIp 返回远程客户端的 IP,如 192.168.1.1 15 | func RemoteIp(req *http.Request) string { 16 | remoteAddr := req.RemoteAddr 17 | if ip := req.Header.Get(XRealIP); ip != "" { 18 | remoteAddr = ip 19 | } else if ip = req.Header.Get(XForwardedFor); ip != "" { 20 | remoteAddr = ip 21 | } else { 22 | remoteAddr, _, _ = net.SplitHostPort(remoteAddr) 23 | } 24 | 25 | if remoteAddr == "::1" { 26 | remoteAddr = "127.0.0.1" 27 | } 28 | 29 | return remoteAddr 30 | } 31 | 32 | // Ip2long 将 IPv4 字符串形式转为 uint32 33 | func Ip2long(ipstr string) uint32 { 34 | ip := net.ParseIP(ipstr) 35 | if ip == nil { 36 | return 0 37 | } 38 | ip = ip.To4() 39 | return binary.BigEndian.Uint32(ip) 40 | } 41 | -------------------------------------------------------------------------------- /middleware/auth.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | "net/url" 6 | 7 | "github.com/labstack/echo" 8 | ) 9 | 10 | // AuthConfig . 11 | type AuthConfig struct { 12 | signature func(url.Values, string) string 13 | secretKey string 14 | } 15 | 16 | // DefaultAuthConfig . 17 | var DefaultAuthConfig = &AuthConfig{} 18 | 19 | // EchoAuth . 20 | func EchoAuth() echo.MiddlewareFunc { 21 | return EchoAuthWithConfig(DefaultAuthConfig) 22 | } 23 | 24 | // EchoAuthWithConfig 用于 echo 框架的签名校验中间件 25 | func EchoAuthWithConfig(authConfig *AuthConfig) echo.MiddlewareFunc { 26 | return func(next echo.HandlerFunc) echo.HandlerFunc { 27 | return func(ctx echo.Context) error { 28 | sign := authConfig.signature(ctx.FormParams(), authConfig.secretKey) 29 | if sign != ctx.FormValue("sign") { 30 | return ctx.String(http.StatusBadRequest, `400 Bad Request`) 31 | } 32 | return next(ctx) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package builder 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrNotSupportType not supported SQL type error 11 | ErrNotSupportType = errors.New("Not supported SQL type") 12 | // ErrNoNotInConditions no NOT IN params error 13 | ErrNoNotInConditions = errors.New("No NOT IN conditions") 14 | // ErrNoInConditions no IN params error 15 | ErrNoInConditions = errors.New("No IN conditions") 16 | // ErrNeedMoreArguments need more arguments 17 | ErrNeedMoreArguments = errors.New("Need more sql arguments") 18 | // ErrNoTableName no table name 19 | ErrNoTableName = errors.New("No table indicated") 20 | // ErrNoColumnToUpdate no column to update 21 | ErrNoColumnToUpdate = errors.New("No column to be update") 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/convert.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 polaris. All rights reserved. 2 | // Use of this source code is governed by a MIT-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package goutils 8 | 9 | import ( 10 | "fmt" 11 | "strconv" 12 | ) 13 | 14 | func ConvertString(inter interface{}, precs ...int) string { 15 | switch v := inter.(type) { 16 | case string: 17 | return v 18 | case float64: 19 | prec := 0 20 | if len(precs) > 0 { 21 | prec = precs[0] 22 | } 23 | return strconv.FormatFloat(v, 'f', prec, 64) 24 | case int64: 25 | return strconv.FormatInt(v, 10) 26 | case uint64: 27 | return strconv.FormatUint(v, 10) 28 | case int: 29 | return strconv.Itoa(v) 30 | case uint: 31 | return strconv.FormatUint(uint64(v), 10) 32 | default: 33 | return fmt.Sprintf("%v", inter) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/facebookgo/stats/aggregation.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "sort" 4 | 5 | // Average returns the average value 6 | func Average(values []float64) float64 { 7 | if len(values) == 0 { 8 | return 0 9 | } 10 | 11 | var val float64 12 | for _, point := range values { 13 | val += point 14 | } 15 | return val / float64(len(values)) 16 | } 17 | 18 | // Sum returns the sum of all the given values 19 | func Sum(values []float64) float64 { 20 | var val float64 21 | for _, point := range values { 22 | val += point 23 | } 24 | return val 25 | } 26 | 27 | // Percentiles returns a map containing the asked for percentiles 28 | func Percentiles(values []float64, percentiles map[string]float64) map[string]float64 { 29 | sort.Float64s(values) 30 | results := map[string]float64{} 31 | for label, p := range percentiles { 32 | results[label] = values[int(float64(len(values))*p)] 33 | } 34 | return results 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/huichen/sego/test_utils.go: -------------------------------------------------------------------------------- 1 | package sego 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func expect(t *testing.T, expect string, actual interface{}) { 9 | actualString := fmt.Sprint(actual) 10 | if expect != actualString { 11 | t.Errorf("期待值=\"%s\", 实际=\"%s\"", expect, actualString) 12 | } 13 | } 14 | 15 | func printTokens(tokens []*Token, numTokens int) (output string) { 16 | for iToken := 0; iToken < numTokens; iToken++ { 17 | for _, word := range tokens[iToken].text { 18 | output += fmt.Sprint(string(word)) 19 | } 20 | output += " " 21 | } 22 | return 23 | } 24 | 25 | func toWords(strings ...string) []Text { 26 | words := []Text{} 27 | for _, s := range strings { 28 | words = append(words, []byte(s)) 29 | } 30 | return words 31 | } 32 | 33 | func bytesToString(bytes []Text) (output string) { 34 | for _, b := range bytes { 35 | output += (string(b) + "/") 36 | } 37 | return 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/match/README.md: -------------------------------------------------------------------------------- 1 | Match 2 | ===== 3 | Build Status 4 | GoDoc 5 | 6 | Match is a very simple pattern matcher where '*' matches on any 7 | number characters and '?' matches on any one character. 8 | 9 | Installing 10 | ---------- 11 | 12 | ``` 13 | go get -u github.com/tidwall/match 14 | ``` 15 | 16 | Example 17 | ------- 18 | 19 | ```go 20 | match.Match("hello", "*llo") 21 | match.Match("jello", "?ello") 22 | match.Match("hello", "h*o") 23 | ``` 24 | 25 | 26 | Contact 27 | ------- 28 | Josh Baker [@tidwall](http://twitter.com/tidwall) 29 | 30 | License 31 | ------- 32 | Redcon source code is available under the MIT [License](/LICENSE). 33 | -------------------------------------------------------------------------------- /logic/friend_link.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author:polaris polaris@studygolang.com 6 | 7 | package logic 8 | 9 | import ( 10 | "sander/db" 11 | "sander/logger" 12 | "sander/model" 13 | 14 | "golang.org/x/net/context" 15 | ) 16 | 17 | type FriendLinkLogic struct{} 18 | 19 | var DefaultFriendLink = FriendLinkLogic{} 20 | 21 | func (FriendLinkLogic) FindAll(ctx context.Context, limits ...int) []*model.FriendLink { 22 | friendLinks := make([]*model.FriendLink, 0) 23 | session := db.MasterDB.OrderBy("seq asc") 24 | if len(limits) > 0 { 25 | session.Limit(limits[0]) 26 | } 27 | err := session.Find(&friendLinks) 28 | if err != nil { 29 | logger.Error("FriendLinkLogic FindAll error:", err) 30 | return nil 31 | } 32 | 33 | return friendLinks 34 | } 35 | -------------------------------------------------------------------------------- /static/css/message.css: -------------------------------------------------------------------------------- 1 | .message {} 2 | .message .nav {background: #fff; margin-top: 10px; padding: 20px 0 0 20px;} 3 | .message .data {padding-left: 20px; padding-right: 20px; } 4 | .message .data li {border-bottom: 1px dotted #999;margin: 10px 0;padding-bottom: 15px;position: relative;} 5 | .message .data li h3 {font-size: 14px;color: #999;line-height: 18px;font-weight: normal;padding-bottom: 8px;font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin:0;} 6 | .message .data li h3 a img {float: left; margin-right: 10px;} 7 | .message .data li .info {line-height:18px;min-height:18px;} 8 | .message .data li .cmd {position: absolute;right: 0;top: 0;} 9 | 10 | .message .data a.label:link,.message .data a.label:visited,.message .data a.label:active { color: #ccc; } 11 | .message .data a.label:hover { color: #fff; } 12 | 13 | .message .replywrap { background-color: #f2f2f5; margin-top: 10px; padding: 20px; text-align: center; } 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/builder_union.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package builder 6 | 7 | import ( 8 | "errors" 9 | "fmt" 10 | "strings" 11 | ) 12 | 13 | func (b *Builder) unionWriteTo(w Writer) error { 14 | for idx, v := range b.unions { 15 | if v.builder.optype != selectType { 16 | return errors.New("UNION is only allowed among SELECT operations") 17 | } 18 | if len(b.unions) == 1 { 19 | if err := v.builder.selectWriteTo(w); err != nil { 20 | return err 21 | } 22 | } else { 23 | if idx != 0 { 24 | fmt.Fprint(w, fmt.Sprintf(" UNION %v ", strings.ToUpper(v.unionType))) 25 | } 26 | fmt.Fprint(w, "(") 27 | if err := v.builder.selectWriteTo(w); err != nil { 28 | return err 29 | } 30 | fmt.Fprint(w, ")") 31 | } 32 | } 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.mkd: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) 5 | [![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /static/css/resources.css: -------------------------------------------------------------------------------- 1 | .box_white .desc {margin-left: 10px;margin-right: 10px;padding-top: 10px;padding-bottom: 10px; 2 | border-bottom: 1px solid #DDD;} 3 | .resources {padding: 0 8px;} 4 | .resources .resource {margin-left: 0;padding-top: 10px;padding-bottom: 10px;border-bottom: 1px dashed #CCC;} 5 | .resources .resource:hover {background: #F5F5F5;} 6 | .resources .resource .rinfo {margin-left: 30px;} 7 | .resources .resource .rinfo .avatar {width:48px; margin-right:10px;} 8 | .resources .resource .rinfo .link-url {font-size: 16px;font-weight: bold;color: #259;} 9 | .resources .resource .rinfo .host {color: #888;} 10 | .resources .resource .rinfo .ino {margin: 5px 0;color: #888;font-size: 13px;} 11 | .resources .resource .rinfo .edi {margin: 0 0 9px;font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;font-size: 13px;line-height: 18px;} 12 | .resources .resource .rinfo .edi a, .resources .resource .rinfo .edi span {margin-right: 8px;color: #777;} 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/builder/cond_expr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Xorm Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package builder 6 | 7 | import "fmt" 8 | 9 | type expr struct { 10 | sql string 11 | args []interface{} 12 | } 13 | 14 | var _ Cond = expr{} 15 | 16 | // Expr generate customerize SQL 17 | func Expr(sql string, args ...interface{}) Cond { 18 | return expr{sql, args} 19 | } 20 | 21 | func (expr expr) WriteTo(w Writer) error { 22 | if _, err := fmt.Fprint(w, expr.sql); err != nil { 23 | return err 24 | } 25 | w.Append(expr.args...) 26 | return nil 27 | } 28 | 29 | func (expr expr) And(conds ...Cond) Cond { 30 | return And(expr, And(conds...)) 31 | } 32 | 33 | func (expr expr) Or(conds ...Cond) Cond { 34 | return Or(expr, Or(conds...)) 35 | } 36 | 37 | func (expr expr) IsValid() bool { 38 | return len(expr.sql) > 0 39 | } 40 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/prism/Creating and Editing Code Snippets.txt: -------------------------------------------------------------------------------- 1 | CKEditor Prism Highlighter Plugin 2 | 3 | 4 | I. CREATING NEW PRISM CODE SNIPPET 5 | 6 | 1.) Click the Code Snippet icon in the CKEditor Toolbar. The Dialog window will now pop-up. 7 | 2.) Select the language that will be the basis for the syntax highlighting. 8 | 3.) Input the code snippets to be highlighted. 9 | 4.) Click the OK button. 10 | 11 | 12 | II. EDITING EXISTING PRISM CODE SNIPPET 13 | 14 | Just double-click the target code snippet block and its dialog window will pop-up. 15 | This happens since a code snippet is implemented as a widget in which by default 16 | has a mask/wrapper covering the entire widget block so that you could click in 17 | any part of it. 18 | 19 | 20 | Note that you could also copy and paste the existing code snippets for faster workflow 21 | since it will be already set in your desired programming language and you will just 22 | need to edit/set the contents. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print < 3 | {{end}} 4 | {{define "content"}} 5 |
6 |
7 |
8 |
9 | 13 |
14 | 15 |
16 |
17 | {{range .links}} 18 | {{.Name}} 19 | {{end}} 20 |
21 |
22 |
23 |
24 |
25 | 26 | {{include "common/my_info.html" .}} 27 |
28 |
29 | {{end}} -------------------------------------------------------------------------------- /vendor/github.com/polaris1119/goutils/float.go: -------------------------------------------------------------------------------- 1 | package goutils 2 | 3 | import ( 4 | "log" 5 | "strconv" 6 | "strings" 7 | ) 8 | 9 | func getFloatDefault(defaultVals ...float64) float64 { 10 | if len(defaultVals) > 0 { 11 | return defaultVals[0] 12 | } 13 | return 0.0 14 | } 15 | 16 | func mustFloat(s string, defaultVals ...float64) float64 { 17 | if s == "" { 18 | return getFloatDefault() 19 | } 20 | 21 | f, err := strconv.ParseFloat(strings.TrimSpace(s), 64) 22 | if err != nil { 23 | log.Println("goutils MustFloat strconv.ParseFloat error:", err) 24 | return getFloatDefault() 25 | } 26 | 27 | return f 28 | } 29 | 30 | func MustFloat(inter interface{}, defaultVals ...float64) float64 { 31 | switch v := inter.(type) { 32 | case float64: 33 | return v 34 | case string: 35 | return mustFloat(v, defaultVals...) 36 | case int64: 37 | return float64(v) 38 | case float32: 39 | return float64(v) 40 | default: 41 | return getFloatDefault(defaultVals...) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/autosave/lang/en.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang('autosave', 'en', { 6 | dateFormat: 'LLL', 7 | autoSaveMessage: 'Auto Saved', 8 | loadSavedContent: 'An auto-saved version of this content from "{0}" has been found. Would you like to compare content versions and choose which one to load? Clicking Cancel will remove previously auto-saved content.', 9 | title: 'Compare auto-saved content with that loaded from the website', 10 | loadedContent: 'Loaded content', 11 | localStorageFull: 'Browser localStorage is full, clear your storage or Increase database size', 12 | autoSavedContent: 'Auto-saved content from: \'', 13 | ok: 'Yes, load auto-saved content', 14 | no: 'No', 15 | diffType: 'Choose view type:', 16 | sideBySide: 'Side by side view', 17 | inline: 'Inline view' 18 | }); 19 | -------------------------------------------------------------------------------- /vendor/github.com/qiniu/api.v6/conf/conf.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "regexp" 7 | "runtime" 8 | 9 | "github.com/qiniu/rpc" 10 | ) 11 | 12 | var UP_HOST = "http://upload.qiniu.com" 13 | var RS_HOST = "http://rs.qbox.me" 14 | var RSF_HOST = "http://rsf.qbox.me" 15 | 16 | var PUB_HOST = "http://pub.qbox.me" 17 | var IO_HOST = "http://iovip.qbox.me" 18 | 19 | var ACCESS_KEY string 20 | var SECRET_KEY string 21 | 22 | var version = "6.0.9" 23 | 24 | var userPattern = regexp.MustCompile("^[a-zA-Z0-9_.-]*$") 25 | 26 | // user should be [A-Za-z0-9]* 27 | func SetUser(user string) error { 28 | if !userPattern.MatchString(user) { 29 | return errors.New("invalid user format") 30 | } 31 | rpc.UserAgent = formatUserAgent(user) 32 | return nil 33 | } 34 | 35 | func formatUserAgent(user string) string { 36 | return fmt.Sprintf("QiniuGo/%s (%s; %s; %s) %s", version, runtime.GOOS, runtime.GOARCH, user, runtime.Version()) 37 | } 38 | 39 | func init() { 40 | SetUser("") 41 | } 42 | -------------------------------------------------------------------------------- /static/css/libs/zoom.css: -------------------------------------------------------------------------------- 1 | img[data-action="zoom"] { 2 | cursor: pointer; 3 | cursor: -webkit-zoom-in; 4 | cursor: -moz-zoom-in; 5 | } 6 | .zoom-img, 7 | .zoom-img-wrap { 8 | position: relative; 9 | z-index: 666; 10 | -webkit-transition: all 300ms; 11 | -o-transition: all 300ms; 12 | transition: all 300ms; 13 | } 14 | img.zoom-img { 15 | cursor: pointer; 16 | cursor: -webkit-zoom-out; 17 | cursor: -moz-zoom-out; 18 | } 19 | .zoom-overlay { 20 | z-index: 420; 21 | background: #fff; 22 | position: fixed; 23 | top: 0; 24 | left: 0; 25 | right: 0; 26 | bottom: 0; 27 | pointer-events: none; 28 | filter: "alpha(opacity=0)"; 29 | opacity: 0; 30 | -webkit-transition: opacity 300ms; 31 | -o-transition: opacity 300ms; 32 | transition: opacity 300ms; 33 | } 34 | .zoom-overlay-open .zoom-overlay { 35 | filter: "alpha(opacity=100)"; 36 | opacity: 1; 37 | } 38 | .zoom-overlay-open, 39 | .zoom-overlay-transitioning { 40 | cursor: default; 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /config/changelogs/1.0/studygolang.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /util/convert_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The StudyGolang Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // http://studygolang.com 5 | // Author: polaris polaris@studygolang.com 6 | 7 | package util_test 8 | 9 | import ( 10 | "testing" 11 | . "util" 12 | ) 13 | 14 | type model struct { 15 | Id int 16 | Name string 17 | } 18 | 19 | func TestModels2Intslice(t *testing.T) { 20 | models := []*model{ 21 | {12, "polaris"}, 22 | {13, "xuxinhua"}, 23 | } 24 | 25 | actualResult := Models2Intslice(models, "Id") 26 | expectResult := []int{12, 13} 27 | 28 | if !sliceIsEqual(actualResult, expectResult) { 29 | t.Fatalf("expect:%v, actual:%v", expectResult, actualResult) 30 | } 31 | } 32 | 33 | func sliceIsEqual(slice1, slice2 []int) bool { 34 | if len(slice1) != len(slice2) { 35 | return false 36 | } 37 | 38 | for i, v := range slice1 { 39 | if v != slice2[i] { 40 | return false 41 | } 42 | } 43 | 44 | return true 45 | } 46 | --------------------------------------------------------------------------------