├── .gitignore ├── Dockerfile ├── Makefile ├── cmds ├── ssh-hostkeygen │ └── ssh-hostkeygen.go ├── ssh-keygen │ └── sshkeyfingerprint.go └── start-gogs │ └── start-gogs.go ├── passwd.template ├── start.sh ├── vendor.yml └── vendor ├── github.com ├── Unknwon │ ├── cae │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_ZH.md │ │ ├── cae.go │ │ └── zip │ │ │ ├── read.go │ │ │ ├── stream.go │ │ │ ├── write.go │ │ │ └── zip.go │ ├── com │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cmd.go │ │ ├── convert.go │ │ ├── dir.go │ │ ├── file.go │ │ ├── html.go │ │ ├── http.go │ │ ├── math.go │ │ ├── path.go │ │ ├── regex.go │ │ ├── slice.go │ │ ├── string.go │ │ ├── time.go │ │ └── url.go │ ├── i18n │ │ ├── LICENSE │ │ ├── README.md │ │ └── i18n.go │ └── paginater │ │ ├── LICENSE │ │ ├── README.md │ │ └── paginater.go ├── bradfitz │ └── gomemcache │ │ ├── LICENSE │ │ ├── README.md │ │ └── memcache │ │ ├── memcache.go │ │ └── selector.go ├── go-macaron │ ├── binding │ │ ├── LICENSE │ │ ├── README.md │ │ ├── binding.go │ │ └── errors.go │ ├── cache │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cache.go │ │ ├── file.go │ │ ├── memcache │ │ │ ├── memcache.go │ │ │ └── memcache.goconvey │ │ ├── memory.go │ │ ├── redis │ │ │ ├── redis.go │ │ │ └── redis.goconvey │ │ └── utils.go │ ├── captcha │ │ ├── LICENSE │ │ ├── README.md │ │ ├── captcha.go │ │ ├── image.go │ │ └── siprng.go │ ├── csrf │ │ ├── LICENSE │ │ ├── README.md │ │ ├── csrf.go │ │ └── xsrf.go │ ├── i18n │ │ ├── LICENSE │ │ ├── README.md │ │ └── i18n.go │ ├── inject │ │ ├── LICENSE │ │ ├── README.md │ │ └── inject.go │ └── session │ │ ├── LICENSE │ │ ├── README.md │ │ ├── file.go │ │ ├── memory.go │ │ ├── redis │ │ ├── redis.go │ │ └── redis.goconvey │ │ ├── session.go │ │ └── utils.go ├── go-sql-driver │ └── mysql │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── ISSUE_TEMPLATE.md │ │ ├── LICENSE │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── README.md │ │ ├── appengine.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ └── utils.go ├── go-xorm │ ├── core │ │ ├── LICENSE │ │ ├── README.md │ │ ├── benchmark.sh │ │ ├── cache.go │ │ ├── column.go │ │ ├── converstion.go │ │ ├── db.go │ │ ├── dialect.go │ │ ├── driver.go │ │ ├── error.go │ │ ├── filter.go │ │ ├── ilogger.go │ │ ├── index.go │ │ ├── mapper.go │ │ ├── pk.go │ │ ├── rows.go │ │ ├── scan.go │ │ ├── table.go │ │ └── type.go │ ├── tidb │ │ ├── README.md │ │ ├── tidb_dialect.go │ │ └── tidb_driver.go │ └── xorm │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_CN.md │ │ ├── VERSION │ │ ├── doc.go │ │ ├── engine.go │ │ ├── error.go │ │ ├── gen_reserved.sh │ │ ├── goracle_driver.go │ │ ├── helpers.go │ │ ├── logger.go │ │ ├── lru_cacher.go │ │ ├── memory_store.go │ │ ├── mssql_dialect.go │ │ ├── mymysql_driver.go │ │ ├── mysql_dialect.go │ │ ├── mysql_driver.go │ │ ├── oci8_driver.go │ │ ├── odbc_driver.go │ │ ├── oracle_dialect.go │ │ ├── pg_reserved.txt │ │ ├── postgres_dialect.go │ │ ├── pq_driver.go │ │ ├── processors.go │ │ ├── rows.go │ │ ├── session.go │ │ ├── sqlite3_dialect.go │ │ ├── sqlite3_driver.go │ │ ├── statement.go │ │ ├── syslogger.go │ │ ├── types.go │ │ └── xorm.go ├── gogits │ ├── chardet │ │ ├── 2022.go │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── detector.go │ │ ├── icu-license.html │ │ ├── multi_byte.go │ │ ├── recognizer.go │ │ ├── single_byte.go │ │ ├── unicode.go │ │ └── utf8.go │ ├── cron │ │ ├── LICENSE │ │ ├── README.md │ │ ├── constantdelay.go │ │ ├── cron.go │ │ ├── doc.go │ │ ├── parser.go │ │ └── spec.go │ ├── git-module │ │ ├── LICENSE │ │ ├── README.md │ │ ├── blob.go │ │ ├── command.go │ │ ├── commit.go │ │ ├── commit_archive.go │ │ ├── error.go │ │ ├── git.go │ │ ├── hook.go │ │ ├── repo.go │ │ ├── repo_branch.go │ │ ├── repo_commit.go │ │ ├── repo_hook.go │ │ ├── repo_object.go │ │ ├── repo_pull.go │ │ ├── repo_tag.go │ │ ├── repo_tree.go │ │ ├── sha1.go │ │ ├── signature.go │ │ ├── submodule.go │ │ ├── tag.go │ │ ├── tree.go │ │ ├── tree_blob.go │ │ ├── tree_entry.go │ │ └── utlis.go │ ├── go-gogs-client │ │ ├── LICENSE │ │ ├── README.md │ │ ├── admin_org.go │ │ ├── admin_repo.go │ │ ├── admin_user.go │ │ ├── gogs.go │ │ ├── issue.go │ │ ├── issue_comment.go │ │ ├── issue_label.go │ │ ├── issue_milestone.go │ │ ├── miscellaneous.go │ │ ├── org.go │ │ ├── org_member.go │ │ ├── org_team.go │ │ ├── pull.go │ │ ├── repo.go │ │ ├── repo_branch.go │ │ ├── repo_collaborator.go │ │ ├── repo_file.go │ │ ├── repo_hook.go │ │ ├── repo_key.go │ │ ├── user.go │ │ ├── user_app.go │ │ ├── user_email.go │ │ ├── user_follow.go │ │ ├── user_key.go │ │ └── utils.go │ └── gogs │ │ ├── Dockerfile │ │ ├── Dockerfile.rpi │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── README_ZH.md │ │ ├── glide.lock │ │ ├── glide.yaml │ │ ├── gogs.go │ │ ├── models │ │ ├── access.go │ │ ├── action.go │ │ ├── admin.go │ │ ├── error.go │ │ ├── git_diff.go │ │ ├── issue.go │ │ ├── issue_comment.go │ │ ├── issue_label.go │ │ ├── issue_mail.go │ │ ├── login.go │ │ ├── mail.go │ │ ├── migrations │ │ │ ├── migrations.go │ │ │ └── v13.go │ │ ├── models.go │ │ ├── models_sqlite.go │ │ ├── models_tidb.go │ │ ├── org.go │ │ ├── org_team.go │ │ ├── pull.go │ │ ├── release.go │ │ ├── repo.go │ │ ├── repo_branch.go │ │ ├── repo_collaboration.go │ │ ├── repo_editor.go │ │ ├── ssh_key.go │ │ ├── token.go │ │ ├── update.go │ │ ├── user.go │ │ ├── user_mail.go │ │ ├── webhook.go │ │ ├── webhook_slack.go │ │ └── wiki.go │ │ ├── modules │ │ ├── auth │ │ │ ├── admin.go │ │ │ ├── auth.go │ │ │ ├── auth_form.go │ │ │ ├── ldap │ │ │ │ ├── README.md │ │ │ │ └── ldap.go │ │ │ ├── org.go │ │ │ ├── pam │ │ │ │ ├── pam.go │ │ │ │ └── pam_stub.go │ │ │ ├── repo_form.go │ │ │ └── user_form.go │ │ ├── avatar │ │ │ └── avatar.go │ │ ├── base │ │ │ ├── base.go │ │ │ └── tool.go │ │ ├── bindata │ │ │ └── bindata.go │ │ ├── context │ │ │ ├── api.go │ │ │ ├── api_org.go │ │ │ ├── auth.go │ │ │ ├── context.go │ │ │ ├── org.go │ │ │ └── repo.go │ │ ├── cron │ │ │ └── cron.go │ │ ├── httplib │ │ │ └── httplib.go │ │ ├── log │ │ │ ├── conn.go │ │ │ ├── console.go │ │ │ ├── file.go │ │ │ ├── log.go │ │ │ └── smtp.go │ │ ├── mailer │ │ │ └── mailer.go │ │ ├── markdown │ │ │ └── markdown.go │ │ ├── process │ │ │ └── manager.go │ │ ├── setting │ │ │ ├── miniwinsvc.go │ │ │ └── setting.go │ │ ├── ssh │ │ │ └── ssh.go │ │ ├── sync │ │ │ ├── single_instance_pool.go │ │ │ └── status_pool.go │ │ ├── template │ │ │ ├── highlight │ │ │ │ └── highlight.go │ │ │ └── template.go │ │ └── user │ │ │ └── user.go │ │ └── routers │ │ ├── home.go │ │ ├── install.go │ │ ├── repo │ │ ├── branch.go │ │ ├── commit.go │ │ ├── download.go │ │ ├── editor.go │ │ ├── http.go │ │ ├── issue.go │ │ ├── pull.go │ │ ├── release.go │ │ ├── repo.go │ │ ├── setting.go │ │ ├── upload.go │ │ ├── view.go │ │ ├── webhook.go │ │ └── wiki.go │ │ └── user │ │ ├── auth.go │ │ ├── home.go │ │ ├── profile.go │ │ └── setting.go ├── golang │ ├── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Make.protobuf │ │ ├── Makefile │ │ ├── README.md │ │ └── proto │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ └── snappy │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ └── snappy.go ├── issue9 │ └── identicon │ │ ├── LICENSE │ │ ├── README.md │ │ ├── block.go │ │ ├── doc.go │ │ ├── identicon.go │ │ └── polygon.go ├── jaytaylor │ └── html2text │ │ ├── LICENSE │ │ ├── README.md │ │ └── html2text.go ├── juju │ └── errors │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── doc.go │ │ ├── error.go │ │ ├── errortypes.go │ │ ├── functions.go │ │ └── path.go ├── kardianos │ └── minwinsvc │ │ ├── LICENSE │ │ ├── README.md │ │ ├── minwinsvc.go │ │ ├── svc_other.go │ │ └── svc_windows.go ├── lib │ └── pq │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── array.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── copy.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── error.go │ │ ├── notify.go │ │ ├── oid │ │ ├── doc.go │ │ ├── gen.go │ │ └── types.go │ │ ├── url.go │ │ ├── user_posix.go │ │ └── user_windows.go ├── mattn │ └── go-sqlite3 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── callback.go │ │ ├── doc.go │ │ ├── error.go │ │ ├── sqlite3-binding.c │ │ ├── sqlite3-binding.h │ │ ├── sqlite3.go │ │ ├── sqlite3_fts5.go │ │ ├── sqlite3_icu.go │ │ ├── sqlite3_json1.go │ │ ├── sqlite3_libsqlite3.go │ │ ├── sqlite3_load_extension.go │ │ ├── sqlite3_omit_load_extension.go │ │ ├── sqlite3_other.go │ │ ├── sqlite3_windows.go │ │ └── sqlite3ext.h ├── mcuadros │ └── go-version │ │ ├── LICENSE │ │ ├── README.md │ │ ├── compare.go │ │ ├── constraint.go │ │ ├── doc.go │ │ ├── group.go │ │ ├── normalize.go │ │ ├── sort.go │ │ └── stability.go ├── microcosm-cc │ └── bluemonday │ │ ├── CONTRIBUTING.md │ │ ├── CREDITS.md │ │ ├── LICENCE.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── doc.go │ │ ├── helpers.go │ │ ├── policies.go │ │ ├── policy.go │ │ └── sanitize.go ├── msteinert │ └── pam │ │ ├── LICENSE │ │ ├── README.md │ │ ├── callback.go │ │ ├── transaction.c │ │ └── transaction.go ├── nfnt │ └── resize │ │ ├── LICENSE │ │ ├── README.md │ │ ├── converter.go │ │ ├── filters.go │ │ ├── nearest.go │ │ ├── resize.go │ │ ├── thumbnail.go │ │ └── ycc.go ├── ngaut │ └── log │ │ ├── LICENSE │ │ ├── README.md │ │ ├── crash_unix.go │ │ ├── crash_win.go │ │ └── log.go ├── petar │ └── GoLLRB │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ └── llrb │ │ ├── avgvar.go │ │ ├── iterator.go │ │ ├── llrb-stats.go │ │ ├── llrb.go │ │ └── util.go ├── pingcap │ ├── goleveldb │ │ ├── LICENSE │ │ ├── README.md │ │ └── leveldb │ │ │ ├── batch.go │ │ │ ├── cache │ │ │ ├── cache.go │ │ │ └── lru.go │ │ │ ├── comparer.go │ │ │ ├── comparer │ │ │ ├── bytes_comparer.go │ │ │ └── comparer.go │ │ │ ├── db.go │ │ │ ├── db_compaction.go │ │ │ ├── db_iter.go │ │ │ ├── db_snapshot.go │ │ │ ├── db_state.go │ │ │ ├── db_transaction.go │ │ │ ├── db_util.go │ │ │ ├── db_write.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── errors │ │ │ └── errors.go │ │ │ ├── filter.go │ │ │ ├── filter │ │ │ ├── bloom.go │ │ │ └── filter.go │ │ │ ├── iterator │ │ │ ├── array_iter.go │ │ │ ├── indexed_iter.go │ │ │ ├── iter.go │ │ │ └── merged_iter.go │ │ │ ├── journal │ │ │ └── journal.go │ │ │ ├── key.go │ │ │ ├── memdb │ │ │ └── memdb.go │ │ │ ├── opt │ │ │ └── options.go │ │ │ ├── options.go │ │ │ ├── session.go │ │ │ ├── session_compaction.go │ │ │ ├── session_record.go │ │ │ ├── session_util.go │ │ │ ├── storage │ │ │ ├── file_storage.go │ │ │ ├── file_storage_nacl.go │ │ │ ├── file_storage_plan9.go │ │ │ ├── file_storage_solaris.go │ │ │ ├── file_storage_unix.go │ │ │ ├── file_storage_windows.go │ │ │ ├── mem_storage.go │ │ │ └── storage.go │ │ │ ├── table.go │ │ │ ├── table │ │ │ ├── reader.go │ │ │ ├── table.go │ │ │ └── writer.go │ │ │ ├── util.go │ │ │ ├── util │ │ │ ├── buffer.go │ │ │ ├── buffer_pool.go │ │ │ ├── crc32.go │ │ │ ├── hash.go │ │ │ ├── range.go │ │ │ └── util.go │ │ │ └── version.go │ ├── tidb │ │ ├── CONTRIBUTING.md │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── ast │ │ │ ├── ast.go │ │ │ ├── base.go │ │ │ ├── cloner.go │ │ │ ├── ddl.go │ │ │ ├── dml.go │ │ │ ├── expressions.go │ │ │ ├── flag.go │ │ │ ├── functions.go │ │ │ ├── misc.go │ │ │ └── stringer.go │ │ ├── bootstrap.go │ │ ├── context │ │ │ └── context.go │ │ ├── ddl │ │ │ ├── bg_worker.go │ │ │ ├── callback.go │ │ │ ├── column.go │ │ │ ├── ddl.go │ │ │ ├── ddl_worker.go │ │ │ ├── foreign_key.go │ │ │ ├── index.go │ │ │ ├── reorg.go │ │ │ ├── schema.go │ │ │ ├── stat.go │ │ │ └── table.go │ │ ├── domain │ │ │ └── domain.go │ │ ├── driver.go │ │ ├── evaluator │ │ │ ├── builtin.go │ │ │ ├── builtin_control.go │ │ │ ├── builtin_info.go │ │ │ ├── builtin_math.go │ │ │ ├── builtin_other.go │ │ │ ├── builtin_string.go │ │ │ ├── builtin_time.go │ │ │ ├── evaluator.go │ │ │ ├── evaluator_binop.go │ │ │ ├── evaluator_like.go │ │ │ └── helper.go │ │ ├── executor │ │ │ ├── adapter.go │ │ │ ├── aggregate_xapi.go │ │ │ ├── builder.go │ │ │ ├── compiler.go │ │ │ ├── executor.go │ │ │ ├── executor_ddl.go │ │ │ ├── executor_simple.go │ │ │ ├── executor_write.go │ │ │ ├── executor_xapi.go │ │ │ ├── explain.go │ │ │ ├── grant.go │ │ │ ├── new_builder.go │ │ │ ├── new_executor.go │ │ │ ├── new_executor_write.go │ │ │ ├── new_executor_xapi.go │ │ │ ├── prepared.go │ │ │ ├── show.go │ │ │ └── union_scan.go │ │ ├── expression │ │ │ ├── aggregation.go │ │ │ └── expression.go │ │ ├── gitcookie.sh │ │ ├── infoschema │ │ │ ├── infoschema.go │ │ │ └── tables.go │ │ ├── inspectkv │ │ │ └── inspectkv.go │ │ ├── kv │ │ │ ├── buffer_store.go │ │ │ ├── error.go │ │ │ ├── iter.go │ │ │ ├── key.go │ │ │ ├── kv.go │ │ │ ├── memdb_buffer.go │ │ │ ├── mock.go │ │ │ ├── rbtree_buffer.go │ │ │ ├── txn.go │ │ │ ├── union_iter.go │ │ │ ├── union_store.go │ │ │ ├── utils.go │ │ │ └── version.go │ │ ├── make.cmd │ │ ├── meta │ │ │ ├── autoid │ │ │ │ └── autoid.go │ │ │ └── meta.go │ │ ├── metric │ │ │ └── metric.go │ │ ├── model │ │ │ ├── ddl.go │ │ │ └── model.go │ │ ├── mysql │ │ │ ├── bit.go │ │ │ ├── charset.go │ │ │ ├── const.go │ │ │ ├── enum.go │ │ │ ├── errcode.go │ │ │ ├── errname.go │ │ │ ├── error.go │ │ │ ├── fsp.go │ │ │ ├── hex.go │ │ │ ├── mydecimal.go │ │ │ ├── set.go │ │ │ ├── state.go │ │ │ ├── time.go │ │ │ ├── type.go │ │ │ └── util.go │ │ ├── parser │ │ │ ├── lexer.go │ │ │ ├── misc.go │ │ │ ├── opcode │ │ │ │ └── opcode.go │ │ │ ├── parser.y │ │ │ └── yy_parser.go │ │ ├── perfschema │ │ │ ├── const.go │ │ │ ├── init.go │ │ │ ├── instrument.go │ │ │ ├── perfschema.go │ │ │ └── statement.go │ │ ├── plan │ │ │ ├── column_pruning.go │ │ │ ├── expression_rewriter.go │ │ │ ├── join_reorder.go │ │ │ ├── logical_plan_builder.go │ │ │ ├── logical_plans.go │ │ │ ├── match_property.go │ │ │ ├── optimizer.go │ │ │ ├── physical_plan_builder.go │ │ │ ├── physical_plans.go │ │ │ ├── plan.go │ │ │ ├── planbuilder.go │ │ │ ├── plans.go │ │ │ ├── predicate_push_down.go │ │ │ ├── preprocess.go │ │ │ ├── push_limit.go │ │ │ ├── range.go │ │ │ ├── refiner.go │ │ │ ├── resolver.go │ │ │ ├── statistics │ │ │ │ ├── statistics.go │ │ │ │ ├── statistics.pb.go │ │ │ │ └── statistics.proto │ │ │ ├── stringer.go │ │ │ ├── typeinferer.go │ │ │ └── validator.go │ │ ├── privilege │ │ │ ├── privilege.go │ │ │ └── privileges │ │ │ │ └── privileges.go │ │ ├── session.go │ │ ├── sessionctx │ │ │ ├── autocommit │ │ │ │ └── autocommit.go │ │ │ ├── db │ │ │ │ └── db.go │ │ │ ├── domainctx.go │ │ │ ├── forupdate │ │ │ │ └── for_update_ctx.go │ │ │ └── variable │ │ │ │ ├── session.go │ │ │ │ ├── statusvar.go │ │ │ │ └── sysvar.go │ │ ├── store │ │ │ └── localstore │ │ │ │ ├── compactor.go │ │ │ │ ├── engine │ │ │ │ └── engine.go │ │ │ │ ├── goleveldb │ │ │ │ └── goleveldb.go │ │ │ │ ├── kv.go │ │ │ │ ├── local_aggregate.go │ │ │ │ ├── local_client.go │ │ │ │ ├── local_pd.go │ │ │ │ ├── local_region.go │ │ │ │ ├── local_version_provider.go │ │ │ │ ├── mvcc.go │ │ │ │ ├── snapshot.go │ │ │ │ └── txn.go │ │ ├── structure │ │ │ ├── hash.go │ │ │ ├── list.go │ │ │ ├── string.go │ │ │ ├── structure.go │ │ │ └── type.go │ │ ├── table │ │ │ ├── column.go │ │ │ ├── index.go │ │ │ ├── table.go │ │ │ └── tables │ │ │ │ ├── bounded_tables.go │ │ │ │ ├── index.go │ │ │ │ ├── memory_tables.go │ │ │ │ └── tables.go │ │ ├── tablecodec │ │ │ └── tablecodec.go │ │ ├── terror │ │ │ └── terror.go │ │ ├── tidb.go │ │ ├── updatedep.sh │ │ ├── util │ │ │ ├── auth.go │ │ │ ├── bytes │ │ │ │ └── bytes.go │ │ │ ├── charset │ │ │ │ ├── charset.go │ │ │ │ └── encoding_table.go │ │ │ ├── codec │ │ │ │ ├── bytes.go │ │ │ │ ├── codec.go │ │ │ │ ├── decimal.go │ │ │ │ ├── float.go │ │ │ │ └── number.go │ │ │ ├── distinct │ │ │ │ └── distinct.go │ │ │ ├── hack │ │ │ │ └── hack.go │ │ │ ├── prefix_helper.go │ │ │ ├── segmentmap │ │ │ │ └── segmentmap.go │ │ │ ├── sqlexec │ │ │ │ └── restricted_sql_executor.go │ │ │ ├── stringutil │ │ │ │ └── string_util.go │ │ │ └── types │ │ │ │ ├── compare.go │ │ │ │ ├── convert.go │ │ │ │ ├── datum.go │ │ │ │ ├── datum_eval.go │ │ │ │ ├── etc.go │ │ │ │ ├── field_type.go │ │ │ │ ├── helper.go │ │ │ │ └── overflow.go │ │ └── xapi │ │ │ ├── xapi.go │ │ │ └── xeval │ │ │ └── eval.go │ └── tipb │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── generate-binlog.sh │ │ ├── generate-go.sh │ │ ├── generate-rust.sh │ │ └── go-tipb │ │ ├── expression.pb.go │ │ ├── schema.pb.go │ │ └── select.pb.go ├── rcrowley │ └── go-metrics │ │ ├── LICENSE │ │ ├── README.md │ │ ├── counter.go │ │ ├── debug.go │ │ ├── ewma.go │ │ ├── gauge.go │ │ ├── gauge_float64.go │ │ ├── graphite.go │ │ ├── healthcheck.go │ │ ├── histogram.go │ │ ├── json.go │ │ ├── log.go │ │ ├── memory.md │ │ ├── meter.go │ │ ├── metrics.go │ │ ├── opentsdb.go │ │ ├── registry.go │ │ ├── runtime.go │ │ ├── runtime_cgo.go │ │ ├── runtime_gccpufraction.go │ │ ├── runtime_no_cgo.go │ │ ├── runtime_no_gccpufraction.go │ │ ├── sample.go │ │ ├── syslog.go │ │ ├── timer.go │ │ ├── validate.sh │ │ └── writer.go ├── russross │ └── blackfriday │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── block.go │ │ ├── html.go │ │ ├── inline.go │ │ ├── latex.go │ │ ├── markdown.go │ │ └── smartypants.go ├── satori │ └── go.uuid │ │ ├── LICENSE │ │ ├── README.md │ │ └── uuid.go ├── sergi │ └── go-diff │ │ ├── APACHE-LICENSE-2.0.txt │ │ ├── LICENSE.txt │ │ ├── README.md │ │ └── diffmatchpatch │ │ ├── dmp.go │ │ ├── speedtest1.txt │ │ ├── speedtest2.txt │ │ └── stack.go ├── shurcooL │ └── sanitized_anchor_name │ │ ├── LICENSE │ │ ├── README.md │ │ └── main.go ├── strk │ └── go-libravatar │ │ ├── LICENSE │ │ ├── README.md │ │ └── libravatar.go ├── twinj │ └── uuid │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── format.go │ │ ├── generator.go │ │ ├── glide.lock │ │ ├── glide.yaml │ │ ├── saver.go │ │ ├── timestamp.go │ │ ├── types.go │ │ ├── uuid.go │ │ └── version.go └── yosida95 │ └── golang-sshkey │ ├── LICENSE │ ├── README.rst │ ├── dsa.go │ ├── ecdsa.go │ ├── fingerprint.go │ ├── marshal.go │ ├── rsa.go │ ├── sshkey.go │ └── unmarshal.go ├── golang.org └── x │ ├── crypto │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── curve25519 │ │ ├── const_amd64.s │ │ ├── cswap_amd64.s │ │ ├── curve25519.go │ │ ├── doc.go │ │ ├── freeze_amd64.s │ │ ├── ladderstep_amd64.s │ │ ├── mont25519_amd64.go │ │ ├── mul_amd64.s │ │ └── square_amd64.s │ ├── ed25519 │ │ ├── ed25519.go │ │ └── internal │ │ │ └── edwards25519 │ │ │ ├── const.go │ │ │ └── edwards25519.go │ └── ssh │ │ ├── buffer.go │ │ ├── certs.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── common.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── handshake.go │ │ ├── kex.go │ │ ├── keys.go │ │ ├── mac.go │ │ ├── messages.go │ │ ├── mux.go │ │ ├── server.go │ │ ├── session.go │ │ ├── tcpip.go │ │ └── transport.go │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ └── html │ │ ├── atom │ │ ├── atom.go │ │ ├── gen.go │ │ └── table.go │ │ ├── charset │ │ └── charset.go │ │ ├── const.go │ │ ├── doc.go │ │ ├── doctype.go │ │ ├── entity.go │ │ ├── escape.go │ │ ├── foreign.go │ │ ├── node.go │ │ ├── parse.go │ │ ├── render.go │ │ └── token.go │ ├── sys │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ └── windows │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_unset.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── svc │ │ ├── event.go │ │ ├── go12.c │ │ ├── go12.go │ │ ├── go13.go │ │ ├── security.go │ │ ├── service.go │ │ ├── sys_386.s │ │ └── sys_amd64.s │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── zsyscall_windows.go │ │ ├── ztypes_windows.go │ │ ├── ztypes_windows_386.go │ │ └── ztypes_windows_amd64.go │ └── text │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── codereview.cfg │ ├── doc.go │ ├── encoding │ ├── charmap │ │ ├── charmap.go │ │ ├── maketables.go │ │ └── tables.go │ ├── encoding.go │ ├── htmlindex │ │ ├── gen.go │ │ ├── htmlindex.go │ │ ├── map.go │ │ └── tables.go │ ├── internal │ │ ├── identifier │ │ │ ├── gen.go │ │ │ ├── identifier.go │ │ │ └── mib.go │ │ └── internal.go │ ├── japanese │ │ ├── all.go │ │ ├── eucjp.go │ │ ├── iso2022jp.go │ │ ├── maketables.go │ │ ├── shiftjis.go │ │ └── tables.go │ ├── korean │ │ ├── euckr.go │ │ ├── maketables.go │ │ └── tables.go │ ├── simplifiedchinese │ │ ├── all.go │ │ ├── gbk.go │ │ ├── hzgb2312.go │ │ ├── maketables.go │ │ └── tables.go │ ├── traditionalchinese │ │ ├── big5.go │ │ ├── maketables.go │ │ └── tables.go │ └── unicode │ │ ├── override.go │ │ └── unicode.go │ ├── gen.go │ ├── internal │ ├── gen.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── internal.go │ ├── match.go │ ├── tables.go │ ├── tag │ │ └── tag.go │ └── utf8internal │ │ └── utf8internal.go │ ├── language │ ├── Makefile │ ├── common.go │ ├── coverage.go │ ├── gen_common.go │ ├── gen_index.go │ ├── go1_1.go │ ├── go1_2.go │ ├── index.go │ ├── language.go │ ├── lookup.go │ ├── maketables.go │ ├── match.go │ ├── parse.go │ ├── tables.go │ └── tags.go │ ├── runes │ ├── cond.go │ └── runes.go │ ├── transform │ └── transform.go │ └── unicode │ ├── cldr │ ├── base.go │ ├── cldr.go │ ├── collate.go │ ├── decode.go │ ├── makexml.go │ ├── resolve.go │ ├── slice.go │ └── xml.go │ └── doc.go └── gopkg.in ├── alexcesaro └── quotedprintable.v3 │ ├── LICENSE │ ├── README.md │ ├── encodedword.go │ ├── pool.go │ ├── pool_go12.go │ ├── reader.go │ └── writer.go ├── asn1-ber.v1 ├── LICENSE ├── README.md ├── ber.go ├── content_int.go ├── header.go ├── identifier.go ├── length.go └── util.go ├── bufio.v1 ├── LICENSE ├── Makefile ├── README.md ├── buffer.go └── bufio.go ├── editorconfig └── editorconfig-core-go.v1 │ ├── LICENSE │ ├── README.md │ └── editorconfig.go ├── gomail.v2 ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── auth.go ├── doc.go ├── message.go ├── mime.go ├── mime_go14.go ├── send.go ├── smtp.go └── writeto.go ├── ini.v1 ├── LICENSE ├── Makefile ├── README.md ├── README_ZH.md ├── error.go ├── ini.go ├── key.go ├── parser.go ├── section.go └── struct.go ├── ldap.v2 ├── LICENSE ├── Makefile ├── README.md ├── add.go ├── bind.go ├── client.go ├── compare.go ├── conn.go ├── control.go ├── debug.go ├── del.go ├── dn.go ├── doc.go ├── error.go ├── filter.go ├── ldap.go ├── modify.go ├── passwdmodify.go └── search.go ├── macaron.v1 ├── LICENSE ├── README.md ├── context.go ├── logger.go ├── macaron.go ├── macaronlogo.png ├── recovery.go ├── render.go ├── response_writer.go ├── return_handler.go ├── router.go ├── static.go └── tree.go └── redis.v2 ├── LICENSE ├── Makefile ├── README.md ├── command.go ├── commands.go ├── doc.go ├── error.go ├── multi.go ├── parser.go ├── pipeline.go ├── pool.go ├── pubsub.go ├── rate_limit.go ├── redis.go ├── script.go └── sentinel.go /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: docker 2 | docker: build/ssh-hostkeygen build/ssh-keygen build/start-gogs Dockerfile 3 | docker build -t gogs . 4 | 5 | build/ssh-keygen: cmds/ssh-keygen/sshkeyfingerprint.go 6 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --ldflags '-extldflags "-static" -s -w' -o build/ssh-keygen cmds/ssh-keygen/sshkeyfingerprint.go 7 | 8 | build/ssh-hostkeygen: cmds/ssh-hostkeygen/ssh-hostkeygen.go 9 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --ldflags '-extldflags "-static" -s -w' -o build/ssh-hostkeygen cmds/ssh-hostkeygen/ssh-hostkeygen.go 10 | 11 | build/start-gogs: cmds/start-gogs/start-gogs.go 12 | CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags="sqlite" --ldflags '-extldflags "-static" -s -w' -o build/start-gogs cmds/start-gogs/start-gogs.go 13 | 14 | .PHONY: clean 15 | clean: 16 | rm -rf build 17 | -------------------------------------------------------------------------------- /cmds/ssh-hostkeygen/ssh-hostkeygen.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto/rand" 5 | "crypto/rsa" 6 | "crypto/x509" 7 | "encoding/pem" 8 | "fmt" 9 | "os" 10 | 11 | "golang.org/x/crypto/ssh" 12 | ) 13 | 14 | func main() { 15 | priv, err := rsa.GenerateKey(rand.Reader, 2014) 16 | if err != nil { 17 | fmt.Print(err) 18 | os.Exit(1) 19 | } 20 | 21 | // Get der format. priv_der []byte 22 | priv_der := x509.MarshalPKCS1PrivateKey(priv) 23 | 24 | // pem.Block 25 | // blk pem.Block 26 | priv_blk := pem.Block{ 27 | Type: "RSA PRIVATE KEY", 28 | Headers: nil, 29 | Bytes: priv_der, 30 | } 31 | 32 | // Resultant private key in PEM format. 33 | // priv_pem string 34 | privBytes := pem.EncodeToMemory(&priv_blk) 35 | 36 | // Public Key generation 37 | sshPublicKey, err := ssh.NewPublicKey(&priv.PublicKey) 38 | pubBytes := ssh.MarshalAuthorizedKey(sshPublicKey) 39 | 40 | if err = writeFile("gogs.rsa", privBytes); err != nil && !os.IsExist(err) { 41 | panic(err) 42 | } 43 | if err = writeFile("gogs.rsa.pub", pubBytes); err != nil && !os.IsExist(err) { 44 | panic(err) 45 | } 46 | } 47 | 48 | func writeFile(path string, contents []byte) error { 49 | f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600) 50 | if err != nil { 51 | return err 52 | } 53 | defer f.Close() 54 | if _, err := f.Write(contents); err != nil { 55 | return err 56 | } 57 | 58 | return nil 59 | } 60 | -------------------------------------------------------------------------------- /cmds/ssh-keygen/sshkeyfingerprint.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto" 5 | "encoding/base64" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | 10 | sshkey "github.com/yosida95/golang-sshkey" 11 | ) 12 | 13 | func main() { 14 | b, err := ioutil.ReadFile(os.Args[2]) 15 | if err != nil { 16 | panic(err) 17 | } 18 | pub, err := sshkey.UnmarshalPublicKey(string(b)) 19 | if err != nil { 20 | panic(err) 21 | } 22 | 23 | fingerprint, err := sshkey.Fingerprint(pub, crypto.SHA256) 24 | if err != nil { 25 | panic(err) 26 | } 27 | fmt.Printf("%d SHA256:%s %s (%s)\n", pub.Length(), base64.RawStdEncoding.EncodeToString(fingerprint), pub.Comment(), keyType(pub.Type())) 28 | } 29 | 30 | func keyType(keyType sshkey.Type) string { 31 | switch keyType { 32 | case sshkey.KEY_DSA: 33 | return "DSA" 34 | case sshkey.KEY_RSA: 35 | return "RSA" 36 | case sshkey.KEY_ECDSA: 37 | return "ECDSA" 38 | default: 39 | return "UNKNOWN" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | git:x:${USER_ID}:${GROUP_ID}:Git user:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh - 2 | 3 | IFS=' 4 | ' 5 | 6 | export USER_ID=$(id -u) 7 | export GROUP_ID=$(id -g) 8 | envsubst < /tmp/passwd.template > /tmp/passwd 9 | export LD_PRELOAD=libnss_wrapper.so 10 | export NSS_WRAPPER_PASSWD=/tmp/passwd 11 | export NSS_WRAPPER_GROUP=/etc/group 12 | 13 | PATH=/bin:/usr/bin:/usr/local/bin 14 | HOME=${HOME:?"need \$HOME variable"} 15 | USER=$(whoami) 16 | export USER HOME PATH 17 | 18 | mkdir ${HOME}/git 19 | 20 | cd "$(dirname $0)" 21 | 22 | ( 23 | mkdir -p ${HOME}/ssh/ || true 24 | cd ${HOME}/ssh/ 25 | /opt/gogs/ssh-hostkeygen 26 | ) 27 | 28 | export GOGS_RUN_USER=${USER:-git} 29 | 30 | exec ./start-gogs 31 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/cae/README_ZH.md: -------------------------------------------------------------------------------- 1 | 压缩与打包扩展 2 | ============= 3 | 4 | [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/cae) 5 | 6 | 包 cae 实现了 PHP 风格的压缩与打包扩展。 7 | 8 | 但本包依据 Go 语言的风格进行了一些修改。 9 | 10 | 引用:[PHP:Compression and Archive Extensions](http://www.php.net/manual/en/refs.compression.php) 11 | 12 | 编码规范:基于 [Go 编码规范](https://github.com/Unknwon/go-code-convention) 13 | 14 | ### 实现 15 | 16 | 包 `zip`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/zip)) 和 `tz`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/tz)) 都允许你轻易的读取或写入 ZIP/TAR.GZ 压缩档案和其内部文件。 17 | 18 | - 特性: 19 | - 将任意位置的文件或目录加入档案,没有一对一的操作限制。 20 | - 只解压部分文件,而非一次性解压全部。 21 | - 将数据以流的形式直接写入 `io.Writer` 而不需经过文件系统的存储。 22 | 23 | ### 测试用例与覆盖率 24 | 25 | 所有子包均采用 [GoConvey](http://goconvey.co/) 来书写测试用例,覆盖率均超过 80%。 26 | 27 | ## 授权许可 28 | 29 | 本项目采用 Apache v2 开源授权许可证,完整的授权说明已放置在 [LICENSE](LICENSE) 文件中。 -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/README.md: -------------------------------------------------------------------------------- 1 | Common Functions 2 | ================ 3 | 4 | [![Build Status](https://travis-ci.org/Unknwon/com.svg)](https://travis-ci.org/Unknwon/com) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/com) 5 | 6 | This is an open source project for commonly used functions for the Go programming language. 7 | 8 | This package need >= **go 1.2** 9 | 10 | Code Convention: based on [Go Code Convention](https://github.com/Unknwon/go-code-convention). 11 | 12 | ## Contribute 13 | 14 | Your contribute is welcome, but you have to check following steps after you added some functions and commit them: 15 | 16 | 1. Make sure you wrote user-friendly comments for **all functions** . 17 | 2. Make sure you wrote test cases with any possible condition for **all functions** in file `*_test.go`. 18 | 3. Make sure you wrote benchmarks for **all functions** in file `*_test.go`. 19 | 4. Make sure you wrote useful examples for **all functions** in file `example_test.go`. 20 | 5. Make sure you ran `go test` and got **PASS** . 21 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/math.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | // PowInt is int type of math.Pow function. 18 | func PowInt(x int, y int) int { 19 | if y <= 0 { 20 | return 1 21 | } else { 22 | if y % 2 == 0 { 23 | sqrt := PowInt(x, y/2) 24 | return sqrt * sqrt 25 | } else { 26 | return PowInt(x, y-1) * x 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/Unknwon/com/url.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 com authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package com 16 | 17 | import ( 18 | "encoding/base64" 19 | "net/url" 20 | ) 21 | 22 | // url encode string, is + not %20 23 | func UrlEncode(str string) string { 24 | return url.QueryEscape(str) 25 | } 26 | 27 | // url decode string 28 | func UrlDecode(str string) (string, error) { 29 | return url.QueryUnescape(str) 30 | } 31 | 32 | // base64 encode 33 | func Base64Encode(str string) string { 34 | return base64.StdEncoding.EncodeToString([]byte(str)) 35 | } 36 | 37 | // base64 decode 38 | func Base64Decode(str string) (string, error) { 39 | s, e := base64.StdEncoding.DecodeString(str) 40 | return string(s), e 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/bradfitz/gomemcache/README.md: -------------------------------------------------------------------------------- 1 | ## About 2 | 3 | This is a memcache client library for the Go programming language 4 | (http://golang.org/). 5 | 6 | ## Installing 7 | 8 | ### Using *go get* 9 | 10 | $ go get github.com/bradfitz/gomemcache/memcache 11 | 12 | After this command *gomemcache* is ready to use. Its source will be in: 13 | 14 | $GOPATH/src/github.com/bradfitz/gomemcache/memcache 15 | 16 | ## Example 17 | 18 | import ( 19 | "github.com/bradfitz/gomemcache/memcache" 20 | ) 21 | 22 | func main() { 23 | mc := memcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212") 24 | mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")}) 25 | 26 | it, err := mc.Get("foo") 27 | ... 28 | } 29 | 30 | ## Full docs, see: 31 | 32 | See https://godoc.org/github.com/bradfitz/gomemcache/memcache 33 | 34 | Or run: 35 | 36 | $ godoc github.com/bradfitz/gomemcache/memcache 37 | 38 | -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/binding/README.md: -------------------------------------------------------------------------------- 1 | # binding [![Build Status](https://travis-ci.org/go-macaron/binding.svg?branch=master)](https://travis-ci.org/go-macaron/binding) [![](http://gocover.io/_badge/github.com/go-macaron/binding)](http://gocover.io/github.com/go-macaron/binding) 2 | 3 | Middleware binding provides request data binding and validation for [Macaron](https://github.com/go-macaron/macaron). 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/binding 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/binding) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/binding) 13 | 14 | ## Credits 15 | 16 | This package is a modified version of [martini-contrib/binding](https://github.com/martini-contrib/binding). 17 | 18 | ## License 19 | 20 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/cache/README.md: -------------------------------------------------------------------------------- 1 | # cache [![Build Status](https://travis-ci.org/go-macaron/cache.svg?branch=master)](https://travis-ci.org/go-macaron/cache) [![](http://gocover.io/_badge/github.com/go-macaron/cache)](http://gocover.io/github.com/go-macaron/cache) 2 | 3 | Middleware cache provides cache management for [Macaron](https://github.com/go-macaron/macaron). It can use many cache adapters, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Ledis and Nodb. 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/cache 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/cache) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/cache) 13 | 14 | ## Credits 15 | 16 | This package is a modified version of [beego/cache](https://github.com/astaxie/beego/tree/master/cache). 17 | 18 | ## License 19 | 20 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/cache/memcache/memcache.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/cache/redis/redis.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/captcha/README.md: -------------------------------------------------------------------------------- 1 | # captcha [![Build Status](https://travis-ci.org/go-macaron/captcha.svg?branch=master)](https://travis-ci.org/go-macaron/captcha) 2 | 3 | Middleware captcha provides captcha service for [Macaron](https://github.com/go-macaron/macaron). 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/captcha 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/captcha) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/captcha) 13 | 14 | ## License 15 | 16 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/csrf/README.md: -------------------------------------------------------------------------------- 1 | # csrf [![Build Status](https://travis-ci.org/go-macaron/csrf.svg?branch=master)](https://travis-ci.org/go-macaron/csrf) [![](http://gocover.io/_badge/github.com/go-macaron/csrf)](http://gocover.io/github.com/go-macaron/csrf) 2 | 3 | Middleware csrf generates and validates CSRF tokens for [Macaron](https://github.com/go-macaron/macaron). 4 | 5 | [API Reference](https://gowalker.org/github.com/go-macaron/csrf) 6 | 7 | ### Installation 8 | 9 | go get github.com/go-macaron/csrf 10 | 11 | ## Getting Help 12 | 13 | - [API Reference](https://gowalker.org/github.com/go-macaron/csrf) 14 | - [Documentation](http://go-macaron.com/docs/middlewares/csrf) 15 | 16 | ## License 17 | 18 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/i18n/README.md: -------------------------------------------------------------------------------- 1 | # i18n [![Build Status](https://travis-ci.org/go-macaron/i18n.svg?branch=master)](https://travis-ci.org/go-macaron/i18n) [![](http://gocover.io/_badge/github.com/go-macaron/i18n)](http://gocover.io/github.com/go-macaron/i18n) 2 | 3 | Middleware i18n provides app Internationalization and Localization for [Macaron](https://github.com/go-macaron/macaron). 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/i18n 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/i18n) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/i18n) 13 | 14 | ## License 15 | 16 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/inject/README.md: -------------------------------------------------------------------------------- 1 | # inject [![Build Status](https://travis-ci.org/go-macaron/inject.svg?branch=master)](https://travis-ci.org/go-macaron/inject) [![](http://gocover.io/_badge/github.com/go-macaron/inject)](http://gocover.io/github.com/go-macaron/inject) 2 | 3 | Package inject provides utilities for mapping and injecting dependencies in various ways. 4 | 5 | **This a modified version of [codegangsta/inject](https://github.com/codegangsta/inject) for special purpose of Macaron** 6 | 7 | **Please use the original version if you need dependency injection feature** 8 | 9 | ## License 10 | 11 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/session/README.md: -------------------------------------------------------------------------------- 1 | # session [![Build Status](https://travis-ci.org/go-macaron/session.svg?branch=master)](https://travis-ci.org/go-macaron/session) [![](http://gocover.io/_badge/github.com/go-macaron/session)](http://gocover.io/github.com/go-macaron/session) 2 | 3 | Middleware session provides session management for [Macaron](https://github.com/go-macaron/macaron). It can use many session providers, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Couchbase, Ledis and Nodb. 4 | 5 | ### Installation 6 | 7 | go get github.com/go-macaron/session 8 | 9 | ## Getting Help 10 | 11 | - [API Reference](https://gowalker.org/github.com/go-macaron/session) 12 | - [Documentation](http://go-macaron.com/docs/middlewares/session) 13 | 14 | ## Credits 15 | 16 | This package is a modified version of [beego/session](https://github.com/astaxie/beego/tree/master/session). 17 | 18 | ## License 19 | 20 | This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/go-macaron/session/redis/redis.goconvey: -------------------------------------------------------------------------------- 1 | ignore -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Reporting Issues 4 | 5 | Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed). 6 | 7 | ## Contributing Code 8 | 9 | By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file. 10 | Don't forget to add yourself to the AUTHORS file. 11 | 12 | ### Code Review 13 | 14 | Everyone is invited to review and comment on pull requests. 15 | If it looks fine to you, comment with "LGTM" (Looks good to me). 16 | 17 | If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes. 18 | 19 | Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM". 20 | 21 | ## Development Ideas 22 | 23 | If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page. 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Issue description 2 | Tell us what should happen and what happens instead 3 | 4 | ### Example code 5 | ```go 6 | If possible, please enter some example code here to reproduce the issue. 7 | ``` 8 | 9 | ### Error log 10 | ``` 11 | If you have an error log, please paste it here. 12 | ``` 13 | 14 | ### Configuration 15 | *Driver version (or git SHA):* 16 | 17 | *Go version:* run `go version` in your console 18 | 19 | *Server version:* E.g. MySQL 5.6, MariaDB 10.0.20 20 | 21 | *Server OS:* E.g. Debian 8.1 (Jessie), Windows 10 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | Please explain the changes you made here. 3 | 4 | ### Checklist 5 | - [ ] Code compiles correctly 6 | - [ ] Created tests which fail without the change (if possible) 7 | - [ ] All tests passing 8 | - [ ] Extended the README / documentation, if necessary 9 | - [ ] Added myself / the copyright holder to the AUTHORS file 10 | -------------------------------------------------------------------------------- /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 | "appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /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/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.netConn == nil { 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.netConn == nil { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/core/benchmark.sh: -------------------------------------------------------------------------------- 1 | go test -v -bench=. -run=XXX 2 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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/go-xorm/core/scan.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | type NullTime time.Time 10 | 11 | var ( 12 | _ driver.Valuer = NullTime{} 13 | ) 14 | 15 | func (ns *NullTime) Scan(value interface{}) error { 16 | if value == nil { 17 | return nil 18 | } 19 | return convertTime(ns, value) 20 | } 21 | 22 | // Value implements the driver Valuer interface. 23 | func (ns NullTime) Value() (driver.Value, error) { 24 | if (time.Time)(ns).IsZero() { 25 | return nil, nil 26 | } 27 | return (time.Time)(ns).Format("2006-01-02 15:04:05"), nil 28 | } 29 | 30 | func convertTime(dest *NullTime, src interface{}) error { 31 | // Common cases, without reflect. 32 | switch s := src.(type) { 33 | case string: 34 | t, err := time.Parse("2006-01-02 15:04:05", s) 35 | if err != nil { 36 | return err 37 | } 38 | *dest = NullTime(t) 39 | return nil 40 | case []uint8: 41 | t, err := time.Parse("2006-01-02 15:04:05", string(s)) 42 | if err != nil { 43 | return err 44 | } 45 | *dest = NullTime(t) 46 | return nil 47 | case nil: 48 | default: 49 | return fmt.Errorf("unsupported driver -> Scan pair: %T -> %T", src, dest) 50 | } 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/tidb/README.md: -------------------------------------------------------------------------------- 1 | tidb driver and dialect for github.com/go-xorm/xorm 2 | ======== 3 | 4 | Currently, we can support tidb for allmost all the operations. 5 | 6 | # How to use 7 | 8 | Just like other supports of xorm, but you should import the three packages: 9 | 10 | ```Go 11 | import ( 12 | _ "github.com/pingcap/tidb" 13 | _ "github.com/go-xorm/tidb" 14 | "github.com/go-xorm/xorm" 15 | ) 16 | 17 | //The formate of DataSource name is store://uri/dbname 18 | // for goleveldb as store 19 | xorm.NewEngine("tidb", "goleveldb://./tidb/tidb") 20 | // for memory as store 21 | xorm.NewEngine("tidb", "memory://tidb/tidb") 22 | // for boltdb as store 23 | xorm.NewEngine("tidb", "boltdb://./tidb/tidb") 24 | ``` 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/tidb/tidb_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 tidb 6 | 7 | import ( 8 | "errors" 9 | "net/url" 10 | "path/filepath" 11 | 12 | "github.com/go-xorm/core" 13 | ) 14 | 15 | var ( 16 | _ core.Dialect = (*tidb)(nil) 17 | 18 | DBType core.DbType = "tidb" 19 | ) 20 | 21 | func init() { 22 | core.RegisterDriver(string(DBType), &tidbDriver{}) 23 | core.RegisterDialect(DBType, func() core.Dialect { 24 | return &tidb{} 25 | }) 26 | } 27 | 28 | type tidbDriver struct { 29 | } 30 | 31 | func (p *tidbDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 32 | u, err := url.Parse(dataSourceName) 33 | if err != nil { 34 | return nil, err 35 | } 36 | if u.Scheme != "goleveldb" && u.Scheme != "memory" && u.Scheme != "boltdb" { 37 | return nil, errors.New(u.Scheme + " is not supported yet.") 38 | } 39 | path := filepath.Join(u.Host, u.Path) 40 | dbName := filepath.Clean(filepath.Base(path)) 41 | 42 | uri := &core.Uri{ 43 | DbType: DBType, 44 | DbName: dbName, 45 | } 46 | 47 | return uri, nil 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/VERSION: -------------------------------------------------------------------------------- 1 | xorm v0.5.5.0822 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "errors" 9 | ) 10 | 11 | var ( 12 | ErrParamsType error = errors.New("Params type error") 13 | ErrTableNotFound error = errors.New("Not found table") 14 | ErrUnSupportedType error = errors.New("Unsupported type error") 15 | ErrNotExist error = errors.New("Not exist error") 16 | ErrCacheFailed error = errors.New("Cache failed") 17 | ErrNeedDeletedCond error = errors.New("Delete need at least one condition") 18 | ErrNotImplemented error = errors.New("Not implemented.") 19 | ) 20 | -------------------------------------------------------------------------------- /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/go-xorm/xorm/goracle_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "errors" 9 | "regexp" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | // func init() { 15 | // core.RegisterDriver("goracle", &goracleDriver{}) 16 | // } 17 | 18 | type goracleDriver struct { 19 | } 20 | 21 | func (cfg *goracleDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 22 | db := &core.Uri{DbType: core.ORACLE} 23 | dsnPattern := regexp.MustCompile( 24 | `^(?:(?P.*?)(?::(?P.*))?@)?` + // [user[:password]@] 25 | `(?:(?P[^\(]*)(?:\((?P[^\)]*)\))?)?` + // [net[(addr)]] 26 | `\/(?P.*?)` + // /dbname 27 | `(?:\?(?P[^\?]*))?$`) // [?param1=value1¶mN=valueN] 28 | matches := dsnPattern.FindStringSubmatch(dataSourceName) 29 | //tlsConfigRegister := make(map[string]*tls.Config) 30 | names := dsnPattern.SubexpNames() 31 | 32 | for i, match := range matches { 33 | switch names[i] { 34 | case "dbname": 35 | db.DbName = match 36 | } 37 | } 38 | if db.DbName == "" { 39 | return nil, errors.New("dbname is empty") 40 | } 41 | return db, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/memory_store.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "sync" 9 | 10 | "github.com/go-xorm/core" 11 | ) 12 | 13 | var _ core.CacheStore = NewMemoryStore() 14 | 15 | // memory store 16 | type MemoryStore struct { 17 | store map[interface{}]interface{} 18 | mutex sync.RWMutex 19 | } 20 | 21 | func NewMemoryStore() *MemoryStore { 22 | return &MemoryStore{store: make(map[interface{}]interface{})} 23 | } 24 | 25 | func (s *MemoryStore) Put(key string, value interface{}) error { 26 | s.mutex.Lock() 27 | defer s.mutex.Unlock() 28 | s.store[key] = value 29 | return nil 30 | } 31 | 32 | func (s *MemoryStore) Get(key string) (interface{}, error) { 33 | s.mutex.RLock() 34 | defer s.mutex.RUnlock() 35 | if v, ok := s.store[key]; ok { 36 | return v, nil 37 | } 38 | 39 | return nil, ErrNotExist 40 | } 41 | 42 | func (s *MemoryStore) Del(key string) error { 43 | s.mutex.Lock() 44 | defer s.mutex.Unlock() 45 | delete(s.store, key) 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/oci8_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "errors" 9 | "regexp" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | type oci8Driver struct { 15 | } 16 | 17 | //dataSourceName=user/password@ipv4:port/dbname 18 | //dataSourceName=user/password@[ipv6]:port/dbname 19 | func (p *oci8Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 20 | db := &core.Uri{DbType: core.ORACLE} 21 | dsnPattern := regexp.MustCompile( 22 | `^(?P.*)\/(?P.*)@` + // user:password@ 23 | `(?P.*)` + // ip:port 24 | `\/(?P.*)`) // dbname 25 | matches := dsnPattern.FindStringSubmatch(dataSourceName) 26 | names := dsnPattern.SubexpNames() 27 | for i, match := range matches { 28 | switch names[i] { 29 | case "dbname": 30 | db.DbName = match 31 | } 32 | } 33 | if db.DbName == "" { 34 | return nil, errors.New("dbname is empty") 35 | } 36 | return db, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/odbc_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "errors" 9 | "strings" 10 | 11 | "github.com/go-xorm/core" 12 | ) 13 | 14 | type odbcDriver struct { 15 | } 16 | 17 | func (p *odbcDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 18 | kv := strings.Split(dataSourceName, ";") 19 | var dbName string 20 | 21 | for _, c := range kv { 22 | vv := strings.Split(strings.TrimSpace(c), "=") 23 | if len(vv) == 2 { 24 | switch strings.ToLower(vv[0]) { 25 | case "database": 26 | dbName = vv[1] 27 | } 28 | } 29 | } 30 | if dbName == "" { 31 | return nil, errors.New("no db name provided") 32 | } 33 | return &core.Uri{DbName: dbName, DbType: core.MSSQL}, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/processors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 | // Executed before an object is initially persisted to the database 8 | type BeforeInsertProcessor interface { 9 | BeforeInsert() 10 | } 11 | 12 | // Executed before an object is updated 13 | type BeforeUpdateProcessor interface { 14 | BeforeUpdate() 15 | } 16 | 17 | // Executed before an object is deleted 18 | type BeforeDeleteProcessor interface { 19 | BeforeDelete() 20 | } 21 | 22 | type BeforeSetProcessor interface { 23 | BeforeSet(string, Cell) 24 | } 25 | 26 | type AfterSetProcessor interface { 27 | AfterSet(string, Cell) 28 | } 29 | 30 | // !nashtsai! TODO enable BeforeValidateProcessor when xorm start to support validations 31 | //// Executed before an object is validated 32 | //type BeforeValidateProcessor interface { 33 | // BeforeValidate() 34 | //} 35 | // -- 36 | 37 | // Executed after an object is persisted to the database 38 | type AfterInsertProcessor interface { 39 | AfterInsert() 40 | } 41 | 42 | // Executed after an object has been updated 43 | type AfterUpdateProcessor interface { 44 | AfterUpdate() 45 | } 46 | 47 | // Executed after an object has been deleted 48 | type AfterDeleteProcessor interface { 49 | AfterDelete() 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-xorm/xorm/sqlite3_driver.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 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 ( 8 | "github.com/go-xorm/core" 9 | ) 10 | 11 | // func init() { 12 | // core.RegisterDriver("sqlite3", &sqlite3Driver{}) 13 | // } 14 | 15 | type sqlite3Driver struct { 16 | } 17 | 18 | func (p *sqlite3Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) { 19 | return &core.Uri{DbType: core.SQLITE, DbName: dataSourceName}, nil 20 | } 21 | -------------------------------------------------------------------------------- /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/gogits/chardet/AUTHORS: -------------------------------------------------------------------------------- 1 | Sheng Yu (yusheng dot sjtu at gmail dot com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/chardet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 chardet Authors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | Partial of the Software is derived from ICU project. See icu-license.html for 22 | license of the derivative portions. 23 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/chardet/README.md: -------------------------------------------------------------------------------- 1 | # chardet 2 | 3 | chardet is library to automatically detect 4 | [charset](http://en.wikipedia.org/wiki/Character_encoding) of texts for [Go 5 | programming language](http://golang.org/). It's based on the algorithm and data 6 | in [ICU](http://icu-project.org/)'s implementation. 7 | 8 | The project was created by [saintfish](http://github.com/saintfish/chardet). In January 2015 it was forked by the gogits project in order to incorporate bugfixes and new features. 9 | 10 | ## Documentation and Usage 11 | 12 | See [pkgdoc](http://godoc.org/github.com/gogits/chardet) 13 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/cron/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 Rob Figueiredo 2 | All Rights Reserved. 3 | 4 | MIT LICENSE 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/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 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/cron/constantdelay.go: -------------------------------------------------------------------------------- 1 | package cron 2 | 3 | import "time" 4 | 5 | // ConstantDelaySchedule represents a simple recurring duty cycle, e.g. "Every 5 minutes". 6 | // It does not support jobs more frequent than once a second. 7 | type ConstantDelaySchedule struct { 8 | Delay time.Duration 9 | } 10 | 11 | // Every returns a crontab Schedule that activates once every duration. 12 | // Delays of less than a second are not supported (will round up to 1 second). 13 | // Any fields less than a Second are truncated. 14 | func Every(duration time.Duration) ConstantDelaySchedule { 15 | if duration < time.Second { 16 | duration = time.Second 17 | } 18 | return ConstantDelaySchedule{ 19 | Delay: duration - time.Duration(duration.Nanoseconds())%time.Second, 20 | } 21 | } 22 | 23 | // Next returns the next time this should be run. 24 | // This rounds so that the next activation time will be on the second. 25 | func (schedule ConstantDelaySchedule) Next(t time.Time) time.Time { 26 | return t.Add(schedule.Delay - time.Duration(t.Nanosecond())*time.Nanosecond) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 All Gogs Contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/README.md: -------------------------------------------------------------------------------- 1 | # Git Shell [![Build Status](https://travis-ci.org/gogits/git-module.svg?branch=master)](https://travis-ci.org/gogits/git-module) 2 | 3 | Package git-module is a Go module for Git access through shell commands. 4 | 5 | ## Limitations 6 | 7 | - Go version must be at least **1.3**. 8 | - Git version must be no less than **1.7.1**, and great than or equal to **1.8.0** is recommended. 9 | - For Windows users, try use as higher version as possible. 10 | 11 | ## License 12 | 13 | This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text. 14 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/blob.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | ) 11 | 12 | // Blob represents a Git object. 13 | type Blob struct { 14 | repo *Repository 15 | *TreeEntry 16 | } 17 | 18 | // Data gets content of blob all at once and wrap it as io.Reader. 19 | // This can be very slow and memory consuming for huge content. 20 | func (b *Blob) Data() (io.Reader, error) { 21 | stdout, err := NewCommand("show", b.ID.String()).RunInDirBytes(b.repo.Path) 22 | if err != nil { 23 | return nil, err 24 | } 25 | return bytes.NewBuffer(stdout), nil 26 | } 27 | 28 | func (b *Blob) DataPipeline(stdout, stderr io.Writer) error { 29 | return NewCommand("show", b.ID.String()).RunInDirPipeline(b.repo.Path, stdout, stderr) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/commit_archive.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | import ( 8 | "fmt" 9 | "path" 10 | "strings" 11 | ) 12 | 13 | type ArchiveType int 14 | 15 | const ( 16 | ZIP ArchiveType = iota + 1 17 | TARGZ 18 | ) 19 | 20 | func (c *Commit) CreateArchive(target string, archiveType ArchiveType) error { 21 | var format string 22 | switch archiveType { 23 | case ZIP: 24 | format = "zip" 25 | case TARGZ: 26 | format = "tar.gz" 27 | default: 28 | return fmt.Errorf("unknown format: %v", archiveType) 29 | } 30 | 31 | _, err := NewCommand("archive", "--prefix="+path.Base(strings.TrimSuffix(c.repo.Path, ".git"))+"/", "--format="+format, "-o", target, c.ID.String()).RunInDir(c.repo.Path) 32 | return err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | ) 11 | 12 | type ErrExecTimeout struct { 13 | Duration time.Duration 14 | } 15 | 16 | func IsErrExecTimeout(err error) bool { 17 | _, ok := err.(ErrExecTimeout) 18 | return ok 19 | } 20 | 21 | func (err ErrExecTimeout) Error() string { 22 | return fmt.Sprintf("execution is timeout [duration: %v]", err.Duration) 23 | } 24 | 25 | type ErrNotExist struct { 26 | ID string 27 | RelPath string 28 | } 29 | 30 | func IsErrNotExist(err error) bool { 31 | _, ok := err.(ErrNotExist) 32 | return ok 33 | } 34 | 35 | func (err ErrNotExist) Error() string { 36 | return fmt.Sprintf("object does not exist [id: %s, rel_path: %s]", err.ID, err.RelPath) 37 | } 38 | 39 | type ErrUnsupportedVersion struct { 40 | Required string 41 | } 42 | 43 | func IsErrUnsupportedVersion(err error) bool { 44 | _, ok := err.(ErrUnsupportedVersion) 45 | return ok 46 | } 47 | 48 | func (err ErrUnsupportedVersion) Error() string { 49 | return fmt.Sprintf("Operation requires higher version [required: %s]", err.Required) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/repo_hook.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | func (repo *Repository) GetHook(name string) (*Hook, error) { 8 | return GetHook(repo.Path, name) 9 | } 10 | 11 | func (repo *Repository) Hooks() ([]*Hook, error) { 12 | return ListHooks(repo.Path) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/repo_object.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package git 6 | 7 | type ObjectType string 8 | 9 | const ( 10 | OBJECT_COMMIT ObjectType = "commit" 11 | OBJECT_TREE ObjectType = "tree" 12 | OBJECT_BLOB ObjectType = "blob" 13 | OBJECT_TAG ObjectType = "tag" 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/repo_tree.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | func (repo *Repository) getTree(id sha1) (*Tree, error) { 8 | treePath := filepathFromSHA1(repo.Path, id.String()) 9 | if isFile(treePath) { 10 | _, err := NewCommand("ls-tree", id.String()).RunInDir(repo.Path) 11 | if err != nil { 12 | return nil, ErrNotExist{id.String(), ""} 13 | } 14 | } 15 | 16 | return NewTree(repo, id), nil 17 | } 18 | 19 | // Find the tree object in the repository. 20 | func (repo *Repository) GetTree(idStr string) (*Tree, error) { 21 | id, err := NewIDFromString(idStr) 22 | if err != nil { 23 | return nil, err 24 | } 25 | return repo.getTree(id) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/git-module/tree_blob.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package git 6 | 7 | import ( 8 | "path" 9 | "strings" 10 | ) 11 | 12 | func (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error) { 13 | if len(relpath) == 0 { 14 | return &TreeEntry{ 15 | ID: t.ID, 16 | Type: OBJECT_TREE, 17 | mode: ENTRY_MODE_TREE, 18 | }, nil 19 | } 20 | 21 | relpath = path.Clean(relpath) 22 | parts := strings.Split(relpath, "/") 23 | var err error 24 | tree := t 25 | for i, name := range parts { 26 | if i == len(parts)-1 { 27 | entries, err := tree.ListEntries() 28 | if err != nil { 29 | return nil, err 30 | } 31 | for _, v := range entries { 32 | if v.name == name { 33 | return v, nil 34 | } 35 | } 36 | } else { 37 | tree, err = tree.SubTree(name) 38 | if err != nil { 39 | return nil, err 40 | } 41 | } 42 | } 43 | return nil, ErrNotExist{"", relpath} 44 | } 45 | 46 | func (t *Tree) GetBlobByPath(relpath string) (*Blob, error) { 47 | entry, err := t.GetTreeEntryByPath(relpath) 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | if !entry.IsDir() { 53 | return entry.Blob(), nil 54 | } 55 | 56 | return nil, ErrNotExist{"", relpath} 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Go Git Service 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/README.md: -------------------------------------------------------------------------------- 1 | Gogs API client in Go 2 | ===================== 3 | 4 | This package is still in experiment, see [Wiki](https://github.com/gogits/go-gogs-client/wiki) for documentation. 5 | 6 | ## License 7 | 8 | This project is under the MIT License. See the [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) file for the full license text. -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/admin_org.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "bytes" 9 | "encoding/json" 10 | "fmt" 11 | ) 12 | 13 | func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, error) { 14 | body, err := json.Marshal(&opt) 15 | if err != nil { 16 | return nil, err 17 | } 18 | org := new(Organization) 19 | return org, c.getParsedResponse("POST", fmt.Sprintf("/admin/users/%s/orgs", user), 20 | jsonHeader, bytes.NewReader(body), org) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/admin_repo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "bytes" 9 | "encoding/json" 10 | "fmt" 11 | ) 12 | 13 | func (c *Client) AdminCreateRepo(user string, opt CreateRepoOption) (*Repository, error) { 14 | body, err := json.Marshal(&opt) 15 | if err != nil { 16 | return nil, err 17 | } 18 | repo := new(Repository) 19 | return repo, c.getParsedResponse("POST", fmt.Sprintf("/admin/users/%s/repos", user), 20 | jsonHeader, bytes.NewReader(body), repo) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/miscellaneous.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | type MarkdownOption struct { 8 | Text string 9 | Mode string 10 | Context string 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/org_member.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "bytes" 9 | "encoding/json" 10 | "fmt" 11 | ) 12 | 13 | type AddOrgMembershipOption struct { 14 | Role string `json:"role" binding:"Required"` 15 | } 16 | 17 | func (c *Client) AddOrgMembership(org, user string, opt AddOrgMembershipOption) error { 18 | body, err := json.Marshal(&opt) 19 | if err != nil { 20 | return err 21 | } 22 | _, err = c.getResponse("PUT", fmt.Sprintf("/orgs/%s/membership/%s", org, user), jsonHeader, bytes.NewReader(body)) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/org_team.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | type Team struct { 8 | ID int64 `json:"id"` 9 | Name string `json:"name"` 10 | Description string `json:"description"` 11 | Permission string `json:"permission"` 12 | } 13 | 14 | type CreateTeamOption struct { 15 | Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"` 16 | Description string `json:"description" binding:"MaxSize(255)"` 17 | Permission string `json:"permission"` 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/pull.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "time" 9 | ) 10 | 11 | // PullRequest represents a pull reqesut API object. 12 | type PullRequest struct { 13 | // Copied from issue.go 14 | ID int64 `json:"id"` 15 | Index int64 `json:"number"` 16 | Poster *User `json:"user"` 17 | Title string `json:"title"` 18 | Body string `json:"body"` 19 | Labels []*Label `json:"labels"` 20 | Milestone *Milestone `json:"milestone"` 21 | Assignee *User `json:"assignee"` 22 | State StateType `json:"state"` 23 | Comments int `json:"comments"` 24 | 25 | HTMLURL string `json:"html_url"` 26 | 27 | Mergeable *bool `json:"mergeable"` 28 | HasMerged bool `json:"merged"` 29 | Merged *time.Time `json:"merged_at"` 30 | MergedCommitID *string `json:"merge_commit_sha"` 31 | MergedBy *User `json:"merged_by"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/repo_branch.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // Branch represents a repository branch. 12 | type Branch struct { 13 | Name string `json:"name"` 14 | Commit *PayloadCommit `json:"commit"` 15 | } 16 | 17 | func (c *Client) ListRepoBranches(user, repo string) ([]*Branch, error) { 18 | branches := make([]*Branch, 0, 10) 19 | return branches, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches", user, repo), nil, nil, &branches) 20 | } 21 | 22 | func (c *Client) GetRepoBranch(user, repo, branch string) (*Branch, error) { 23 | b := new(Branch) 24 | return b, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches/%s", user, repo, branch), nil, nil, &b) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/repo_collaborator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "bytes" 9 | "encoding/json" 10 | "fmt" 11 | ) 12 | 13 | type AddCollaboratorOption struct { 14 | Permission *string `json:"permission"` 15 | } 16 | 17 | func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollaboratorOption) error { 18 | body, err := json.Marshal(&opt) 19 | if err != nil { 20 | return err 21 | } 22 | _, err = c.getResponse("PUT", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), nil, bytes.NewReader(body)) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/repo_file.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // GetFile downloads a file of repository, ref can be branch/tag/commit. 12 | // e.g.: ref -> master, tree -> macaron.go(no leading slash) 13 | func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, error) { 14 | return c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/raw/%s/%s", user, repo, ref, tree), nil, nil) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/user.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // User represents a API user. 12 | type User struct { 13 | ID int64 `json:"id"` 14 | UserName string `json:"username"` 15 | FullName string `json:"full_name"` 16 | Email string `json:"email"` 17 | AvatarUrl string `json:"avatar_url"` 18 | } 19 | 20 | func (c *Client) GetUserInfo(user string) (*User, error) { 21 | u := new(User) 22 | err := c.getParsedResponse("GET", fmt.Sprintf("/users/%s", user), nil, nil, u) 23 | return u, err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/user_email.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "bytes" 9 | "encoding/json" 10 | ) 11 | 12 | type Email struct { 13 | Email string `json:"email"` 14 | Verified bool `json:"verified"` 15 | Primary bool `json:"primary"` 16 | } 17 | 18 | func (c *Client) ListEmails() ([]*Email, error) { 19 | emails := make([]*Email, 0, 3) 20 | return emails, c.getParsedResponse("GET", "/user/emails", nil, nil, &emails) 21 | } 22 | 23 | type CreateEmailOption struct { 24 | Emails []string `json:"emails"` 25 | } 26 | 27 | func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, error) { 28 | body, err := json.Marshal(&opt) 29 | if err != nil { 30 | return nil, err 31 | } 32 | emails := make([]*Email, 0, 3) 33 | return emails, c.getParsedResponse("POST", "/user/emails", jsonHeader, bytes.NewReader(body), emails) 34 | } 35 | 36 | func (c *Client) DeleteEmail(opt CreateEmailOption) error { 37 | body, err := json.Marshal(&opt) 38 | if err != nil { 39 | return err 40 | } 41 | _, err = c.getResponse("DELETE", "/user/emails", jsonHeader, bytes.NewReader(body)) 42 | return err 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/go-gogs-client/utils.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Gogs Authors. 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 | 5 | package gogs 6 | 7 | import ( 8 | "net/http" 9 | ) 10 | 11 | var jsonHeader = http.Header{"content-type": []string{"application/json"}} 12 | 13 | func Bool(v bool) *bool { 14 | return &v 15 | } 16 | 17 | func String(v string) *string { 18 | return &v 19 | } 20 | 21 | func Int64(v int64) *int64 { 22 | return &v 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.3 2 | MAINTAINER jp@roemer.im 3 | 4 | # Install system utils & Gogs runtime dependencies 5 | ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-amd64 /usr/sbin/gosu 6 | RUN chmod +x /usr/sbin/gosu \ 7 | && apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat tzdata 8 | 9 | ENV GOGS_CUSTOM /data/gogs 10 | 11 | COPY . /app/gogs/ 12 | WORKDIR /app/gogs/ 13 | RUN ./docker/build.sh 14 | 15 | # Configure LibC Name Service 16 | COPY docker/nsswitch.conf /etc/nsswitch.conf 17 | 18 | # Configure Docker Container 19 | VOLUME ["/data"] 20 | EXPOSE 22 3000 21 | ENTRYPOINT ["docker/start.sh"] 22 | CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"] 23 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/Dockerfile.rpi: -------------------------------------------------------------------------------- 1 | FROM hypriot/rpi-alpine-scratch:v3.2 2 | MAINTAINER jp@roemer.im, raxetul@gmail.com 3 | 4 | # Install system utils & Gogs runtime dependencies 5 | ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-armhf /usr/sbin/gosu 6 | RUN chmod +x /usr/sbin/gosu \ 7 | && echo "http://dl-4.alpinelinux.org/alpine/v3.3/main/" | tee /etc/apk/repositories \ 8 | && echo "http://dl-4.alpinelinux.org/alpine/v3.3/community/" | tee -a /etc/apk/repositories \ 9 | && apk -U --no-progress upgrade && rm -f /var/cache/apk/APKINDEX.* \ 10 | && apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat tzdata 11 | 12 | ENV GOGS_CUSTOM /data/gogs 13 | 14 | COPY . /app/gogs/ 15 | WORKDIR /app/gogs/ 16 | RUN ./docker/build.sh 17 | 18 | # Configure LibC Name Service 19 | COPY docker/nsswitch.conf /etc/nsswitch.conf 20 | 21 | # Configure Docker Container 22 | VOLUME ["/data"] 23 | EXPOSE 22 3000 24 | ENTRYPOINT ["docker/start.sh"] 25 | CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"] 26 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) The Gogs Authors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/gogs.go: -------------------------------------------------------------------------------- 1 | // +build go1.4 2 | 3 | // Copyright 2014 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // Gogs (Go Git Service) is a painless self-hosted Git Service. 8 | package main 9 | 10 | import ( 11 | "os" 12 | "runtime" 13 | 14 | "github.com/codegangsta/cli" 15 | 16 | "github.com/gogits/gogs/cmd" 17 | "github.com/gogits/gogs/modules/setting" 18 | ) 19 | 20 | const APP_VER = "0.9.85.0824" 21 | 22 | func init() { 23 | runtime.GOMAXPROCS(runtime.NumCPU()) 24 | setting.AppVer = APP_VER 25 | } 26 | 27 | func main() { 28 | app := cli.NewApp() 29 | app.Name = "Gogs" 30 | app.Usage = "Go Git Service: a painless self-hosted Git service" 31 | app.Version = APP_VER 32 | app.Commands = []cli.Command{ 33 | cmd.CmdWeb, 34 | cmd.CmdServ, 35 | cmd.CmdUpdate, 36 | cmd.CmdDump, 37 | cmd.CmdCert, 38 | cmd.CmdAdmin, 39 | } 40 | app.Flags = append(app.Flags, []cli.Flag{}...) 41 | app.Run(os.Args) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/models/models_sqlite.go: -------------------------------------------------------------------------------- 1 | // +build sqlite 2 | 3 | // Copyright 2014 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package models 8 | 9 | import ( 10 | _ "github.com/mattn/go-sqlite3" 11 | ) 12 | 13 | func init() { 14 | EnableSQLite3 = true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/models/models_tidb.go: -------------------------------------------------------------------------------- 1 | // +build tidb go1.4.2 2 | 3 | // Copyright 2015 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package models 8 | 9 | import ( 10 | _ "github.com/go-xorm/tidb" 11 | "github.com/ngaut/log" 12 | _ "github.com/pingcap/tidb" 13 | ) 14 | 15 | func init() { 16 | EnableTiDB = true 17 | log.SetLevelByString("error") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/models/repo_branch.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package models 6 | 7 | import ( 8 | "github.com/gogits/git-module" 9 | ) 10 | 11 | type Branch struct { 12 | Path string 13 | Name string 14 | } 15 | 16 | func GetBranchesByPath(path string) ([]*Branch, error) { 17 | gitRepo, err := git.OpenRepository(path) 18 | if err != nil { 19 | return nil, err 20 | } 21 | 22 | brs, err := gitRepo.GetBranches() 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | branches := make([]*Branch, len(brs)) 28 | for i := range brs { 29 | branches[i] = &Branch{ 30 | Path: path, 31 | Name: brs[i], 32 | } 33 | } 34 | return branches, nil 35 | } 36 | 37 | func (repo *Repository) GetBranch(br string) (*Branch, error) { 38 | if !git.IsBranchExist(repo.RepoPath(), br) { 39 | return nil, &ErrBranchNotExist{br} 40 | } 41 | return &Branch{ 42 | Path: repo.RepoPath(), 43 | Name: br, 44 | }, nil 45 | } 46 | 47 | func (repo *Repository) GetBranches() ([]*Branch, error) { 48 | return GetBranchesByPath(repo.RepoPath()) 49 | } 50 | 51 | func (br *Branch) GetCommit() (*git.Commit, error) { 52 | gitRepo, err := git.OpenRepository(br.Path) 53 | if err != nil { 54 | return nil, err 55 | } 56 | return gitRepo.GetBranchCommit(br.Name) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/auth/auth_form.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package auth 6 | 7 | import ( 8 | "github.com/go-macaron/binding" 9 | "gopkg.in/macaron.v1" 10 | ) 11 | 12 | type AuthenticationForm struct { 13 | ID int64 14 | Type int `binding:"Range(2,5)"` 15 | Name string `binding:"Required;MaxSize(30)"` 16 | Host string 17 | Port int 18 | BindDN string 19 | BindPassword string 20 | UserBase string 21 | UserDN string 22 | AttributeUsername string 23 | AttributeName string 24 | AttributeSurname string 25 | AttributeMail string 26 | AttributesInBind bool 27 | Filter string 28 | AdminFilter string 29 | IsActive bool 30 | SMTPAuth string 31 | SMTPHost string 32 | SMTPPort int 33 | AllowedDomains string 34 | SecurityProtocol int `binding:"Range(0,2)"` 35 | TLS bool 36 | SkipVerify bool 37 | PAMServiceName string 38 | } 39 | 40 | func (f *AuthenticationForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { 41 | return validate(errs, ctx.Data, f, ctx.Locale) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/auth/pam/pam.go: -------------------------------------------------------------------------------- 1 | // +build pam 2 | 3 | // Copyright 2014 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package pam 8 | 9 | import ( 10 | "errors" 11 | 12 | "github.com/msteinert/pam" 13 | ) 14 | 15 | func PAMAuth(serviceName, userName, passwd string) error { 16 | t, err := pam.StartFunc(serviceName, userName, func(s pam.Style, msg string) (string, error) { 17 | switch s { 18 | case pam.PromptEchoOff: 19 | return passwd, nil 20 | case pam.PromptEchoOn, pam.ErrorMsg, pam.TextInfo: 21 | return "", nil 22 | } 23 | return "", errors.New("Unrecognized PAM message style") 24 | }) 25 | 26 | if err != nil { 27 | return err 28 | } 29 | 30 | if err = t.Authenticate(0); err != nil { 31 | return err 32 | } 33 | 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/auth/pam/pam_stub.go: -------------------------------------------------------------------------------- 1 | // +build !pam 2 | 3 | // Copyright 2014 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package pam 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | func PAMAuth(serviceName, userName, passwd string) error { 14 | return errors.New("PAM not supported") 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/avatar/avatar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package avatar 6 | 7 | import ( 8 | "fmt" 9 | "image" 10 | "image/color/palette" 11 | "math/rand" 12 | "time" 13 | 14 | "github.com/issue9/identicon" 15 | ) 16 | 17 | const AVATAR_SIZE = 290 18 | 19 | // RandomImage generates and returns a random avatar image unique to input data 20 | // in custom size (height and width). 21 | func RandomImageSize(size int, data []byte) (image.Image, error) { 22 | randExtent := len(palette.WebSafe) - 32 23 | rand.Seed(time.Now().UnixNano()) 24 | colorIndex := rand.Intn(randExtent) 25 | backColorIndex := colorIndex - 1 26 | if backColorIndex < 0 { 27 | backColorIndex = randExtent - 1 28 | } 29 | 30 | // Define size, background, and forecolor 31 | imgMaker, err := identicon.New(size, 32 | palette.WebSafe[backColorIndex], palette.WebSafe[colorIndex:colorIndex+32]...) 33 | if err != nil { 34 | return nil, fmt.Errorf("identicon.New: %v", err) 35 | } 36 | return imgMaker.Make(data), nil 37 | } 38 | 39 | // RandomImage generates and returns a random avatar image unique to input data 40 | // in default size (height and width). 41 | func RandomImage(data []byte) (image.Image, error) { 42 | return RandomImageSize(AVATAR_SIZE, data) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/base/base.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package base 6 | 7 | const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki" 8 | 9 | type ( 10 | TplName string 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/context/api_org.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package context 6 | 7 | import ( 8 | "github.com/gogits/gogs/models" 9 | ) 10 | 11 | type APIOrganization struct { 12 | Organization *models.User 13 | Team *models.Team 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/setting/miniwinsvc.go: -------------------------------------------------------------------------------- 1 | // +build miniwinsvc 2 | 3 | // Copyright 2015 The Gogs Authors. All rights reserved. 4 | // Use of this source code is governed by a MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package setting 8 | 9 | import ( 10 | _ "github.com/kardianos/minwinsvc" 11 | ) 12 | 13 | func init() { 14 | SupportMiniWinService = true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/sync/status_pool.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gogs Authors. 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 | 5 | package sync 6 | 7 | import ( 8 | "sync" 9 | ) 10 | 11 | // StatusTable is a table maintains true/false values. 12 | // 13 | // This table is particularly useful for un/marking and checking values 14 | // in different goroutines. 15 | type StatusTable struct { 16 | lock sync.RWMutex 17 | pool map[string]bool 18 | } 19 | 20 | // NewStatusTable initializes and returns a new StatusTable object. 21 | func NewStatusTable() *StatusTable { 22 | return &StatusTable{ 23 | pool: make(map[string]bool), 24 | } 25 | } 26 | 27 | // Start sets value of given name to true in the pool. 28 | func (p *StatusTable) Start(name string) { 29 | p.lock.Lock() 30 | defer p.lock.Unlock() 31 | 32 | p.pool[name] = true 33 | } 34 | 35 | // Stop sets value of given name to false in the pool. 36 | func (p *StatusTable) Stop(name string) { 37 | p.lock.Lock() 38 | defer p.lock.Unlock() 39 | 40 | p.pool[name] = false 41 | } 42 | 43 | // IsRunning checks if value of given name is set to true in the pool. 44 | func (p *StatusTable) IsRunning(name string) bool { 45 | p.lock.RLock() 46 | defer p.lock.RUnlock() 47 | 48 | return p.pool[name] 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/modules/user/user.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package user 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | func CurrentUsername() string { 12 | curUserName := os.Getenv("USER") 13 | if len(curUserName) > 0 { 14 | return curUserName 15 | } 16 | 17 | return os.Getenv("USERNAME") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gogits/gogs/routers/repo/branch.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Gogs Authors. 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 | 5 | package repo 6 | 7 | import ( 8 | "github.com/gogits/gogs/modules/base" 9 | "github.com/gogits/gogs/modules/context" 10 | ) 11 | 12 | const ( 13 | BRANCH base.TplName = "repo/branch" 14 | ) 15 | 16 | func Branches(ctx *context.Context) { 17 | ctx.Data["Title"] = "Branches" 18 | ctx.Data["IsRepoToolbarBranches"] = true 19 | 20 | brs, err := ctx.Repo.GitRepo.GetBranches() 21 | if err != nil { 22 | ctx.Handle(500, "repo.Branches(GetBranches)", err) 23 | return 24 | } else if len(brs) == 0 { 25 | ctx.Handle(404, "repo.Branches(GetBranches)", nil) 26 | return 27 | } 28 | 29 | ctx.Data["Branches"] = brs 30 | ctx.HTML(200, BRANCH) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/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/github.com/golang/protobuf/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/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) -------------------------------------------------------------------------------- /vendor/github.com/issue9/identicon/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 caixw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/issue9/identicon/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 by caixw, All rights reserved. 2 | // Use of this source code is governed by a MIT 3 | // license that can be found in the LICENSE file. 4 | 5 | // 一个基于hash值生成随机图像的包。 6 | // 7 | // 关于identicon并没有统一的标准,一般用于在用户注册时, 8 | // 取用户的邮箱或是访问IP等数据(也可以是其它任何数据), 9 | // 进行hash运算,之后根据hash数据,产生一张图像, 10 | // 这样即可以为用户产生一张独特的头像,又不会泄漏用户的隐藏。 11 | // 12 | // 在identicon中,把图像分成以下九个部分: 13 | // ------------- 14 | // | 1 | 2 | 3 | 15 | // ------------- 16 | // | 4 | 5 | 6 | 17 | // ------------- 18 | // | 7 | 8 | 9 | 19 | // ------------- 20 | // 其中1、3、9、7为不同角度(依次增加90度)的同一张图片, 21 | // 2、6、8、4也是如此,这样可以保持图像是对称的,比较美观。 22 | // 5则单独使用一张图片。 23 | // 24 | // // 根据用户访问的IP,为其生成一张头像 25 | // img, _ := identicon.Make(128, color.NRGBA{},color.NRGBA{}, []byte("192.168.1.1")) 26 | // fi, _ := os.Create("/tmp/u1.png") 27 | // png.Encode(fi, img) 28 | // fi.Close() 29 | // 30 | // // 或者 31 | // ii, _ := identicon.New(128, color.NRGBA{}, color.NRGBA{}, color.NRGBA{}) 32 | // img := ii.Make([]byte("192.168.1.1")) 33 | // img = ii.Make([]byte("192.168.1.2")) 34 | // 35 | // NOTE: go test 会在当前目录的testdata文件夹下产生大量的随机图片。 36 | // 要运行测试,必须保证该文件夹是存在的,且有相应的写入权限。 37 | package identicon 38 | -------------------------------------------------------------------------------- /vendor/github.com/jaytaylor/html2text/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jay Taylor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/juju/errors/Makefile: -------------------------------------------------------------------------------- 1 | default: check 2 | 3 | check: 4 | go test && go test -compiler gccgo 5 | 6 | docs: 7 | godoc2md github.com/juju/errors > README.md 8 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)|' README.md 9 | 10 | 11 | .PHONY: default check docs 12 | -------------------------------------------------------------------------------- /vendor/github.com/juju/errors/path.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package errors 5 | 6 | import ( 7 | "runtime" 8 | "strings" 9 | ) 10 | 11 | // prefixSize is used internally to trim the user specific path from the 12 | // front of the returned filenames from the runtime call stack. 13 | var prefixSize int 14 | 15 | // goPath is the deduced path based on the location of this file as compiled. 16 | var goPath string 17 | 18 | func init() { 19 | _, file, _, ok := runtime.Caller(0) 20 | if file == "?" { 21 | return 22 | } 23 | if ok { 24 | // We know that the end of the file should be: 25 | // github.com/juju/errors/path.go 26 | size := len(file) 27 | suffix := len("github.com/juju/errors/path.go") 28 | goPath = file[:size-suffix] 29 | prefixSize = len(goPath) 30 | } 31 | } 32 | 33 | func trimGoPath(filename string) string { 34 | if strings.HasPrefix(filename, goPath) { 35 | return filename[prefixSize:] 36 | } 37 | return filename 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/minwinsvc/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Daniel Theophanes 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/minwinsvc/README.md: -------------------------------------------------------------------------------- 1 | ### Minimal windows service stub 2 | 3 | Programs designed to run from most *nix style operating systems 4 | can import this package to enable running programs as services without modifying 5 | them. 6 | 7 | ``` 8 | import _ "github.com/kardianos/minwinsvc" 9 | ``` 10 | 11 | If you need more control over the exit behavior, set 12 | ``` 13 | minwinsvc.SetOnExit(func() { 14 | // Do something. 15 | // Within 10 seconds call: 16 | os.Exit(0) 17 | }) 18 | ``` 19 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/minwinsvc/minwinsvc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Daniel Theophanes. 2 | // Use of this source code is governed by a zlib-style 3 | // license that can be found in the LICENSE file.package service 4 | 5 | // Minimal non-invasive windows only service stub. 6 | // 7 | // Import to allow running as a windows service. 8 | // import _ "github.com/kardianos/minwinsvc" 9 | // This will detect if running as a windows service 10 | // and install required callbacks for windows. 11 | package minwinsvc 12 | 13 | // SetOnExit sets the function to be called when the windows service 14 | // requests an exit. If this is not called, or if it is called where 15 | // f == nil, then it defaults to calling "os.Exit(0)". 16 | func SetOnExit(f func()) { 17 | setOnExit(f) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/minwinsvc/svc_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Daniel Theophanes. 2 | // Use of this source code is governed by a zlib-style 3 | // license that can be found in the LICENSE file.package service 4 | 5 | //+build !windows 6 | 7 | package minwinsvc 8 | 9 | func setOnExit(f func()) { 10 | // Nothing. 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to pq 2 | 3 | `pq` has a backlog of pull requests, but contributions are still very 4 | much welcome. You can help with patch review, submitting bug reports, 5 | or adding new functionality. There is no formal style guide, but 6 | please conform to the style of existing code and general Go formatting 7 | conventions when submitting patches. 8 | 9 | ### Patch review 10 | 11 | Help review existing open pull requests by commenting on the code or 12 | proposed functionality. 13 | 14 | ### Bug reports 15 | 16 | We appreciate any bug reports, but especially ones with self-contained 17 | (doesn't depend on code outside of pq), minimal (can't be simplified 18 | further) test cases. It's especially helpful if you can submit a pull 19 | request with just the failing test case (you'll probably want to 20 | pattern it after the tests in 21 | [conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). 22 | 23 | ### New functionality 24 | 25 | There are a number of pending patches for new functionality, so 26 | additional feature patches will take a while to merge. Still, patches 27 | are generally reviewed based on usefulness and complexity in addition 28 | to time-in-queue, so if you have a knockout idea, take a shot. Feel 29 | free to open an issue discussion your proposed patch beforehand. 30 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_fts5.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build fts5 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_ENABLE_FTS5 11 | #cgo LDFLAGS: -lm 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_icu.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build icu 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo LDFLAGS: -licuuc -licui18n 11 | #cgo CFLAGS: -DSQLITE_ENABLE_ICU 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_json1.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build json1 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_ENABLE_JSON1 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_libsqlite3.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build libsqlite3 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DUSE_LIBSQLITE3 11 | #cgo linux LDFLAGS: -lsqlite3 12 | #cgo darwin LDFLAGS: -L/usr/local/opt/sqlite/lib -lsqlite3 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_omit_load_extension.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build sqlite_omit_load_extension 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_OMIT_LOAD_EXTENSION 11 | */ 12 | import "C" 13 | import ( 14 | "errors" 15 | ) 16 | 17 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 18 | return errors.New("Extensions have been disabled for static builds") 19 | } 20 | 21 | func (c *SQLiteConn) LoadExtension(lib string, entry string) error { 22 | return errors.New("Extensions have been disabled for static builds") 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build !windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. 11 | #cgo linux LDFLAGS: -ldl 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe 11 | #cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T 12 | #cgo LDFLAGS: -lmingwex -lmingw32 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-version/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Máximo Cuadros 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-version/constraint.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | type Constraint struct { 8 | operator string 9 | version string 10 | } 11 | 12 | // Return a new Constrain and sets operator and version to compare 13 | func NewConstrain(operator, version string) *Constraint { 14 | constraint := new(Constraint) 15 | constraint.SetOperator(operator) 16 | constraint.SetVersion(version) 17 | 18 | return constraint 19 | } 20 | 21 | // Sets operator to compare 22 | func (self *Constraint) SetOperator(operator string) { 23 | self.operator = operator 24 | } 25 | 26 | // Get operator to compare 27 | func (self *Constraint) GetOperator() string { 28 | return self.operator 29 | } 30 | 31 | // Sets version to compare 32 | func (self *Constraint) SetVersion(version string) { 33 | self.version = version 34 | } 35 | 36 | // Get version to compare 37 | func (self *Constraint) GetVersion() string { 38 | return self.version 39 | } 40 | 41 | // Match a given version againts the constraint 42 | func (self *Constraint) Match(version string) bool { 43 | return Compare(version, self.version, self.operator) 44 | } 45 | 46 | // Return a string representation 47 | func (self *Constraint) String() string { 48 | return strings.Trim(self.operator+" "+self.version, " ") 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-version/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Version normalizer and comparison library for go, heavy based on PHP 3 | version_compare function and Version comparsion libs from Composer 4 | (https://github.com/composer/composer) PHP project 5 | */ 6 | package version -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-version/sort.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | // Sorts a string slice of version number strings using version.CompareSimple() 8 | // 9 | // Example: 10 | // version.Sort([]string{"1.10-dev", "1.0rc1", "1.0", "1.0-dev"}) 11 | // Returns []string{"1.0-dev", "1.0rc1", "1.0", "1.10-dev"} 12 | // 13 | func Sort(versionStrings []string) { 14 | versions := versionSlice(versionStrings) 15 | sort.Sort(versions) 16 | } 17 | 18 | type versionSlice []string 19 | 20 | func (s versionSlice) Len() int { 21 | return len(s) 22 | } 23 | 24 | func (s versionSlice) Less(i, j int) bool { 25 | cmp := CompareSimple(Normalize(s[i]), Normalize(s[j])) 26 | if cmp == 0 { 27 | return s[i] < s[j] 28 | } 29 | return cmp < 0 30 | } 31 | 32 | func (s versionSlice) Swap(i, j int) { 33 | tmp := s[j] 34 | s[j] = s[i] 35 | s[i] = tmp 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/microcosm-cc/bluemonday/CREDITS.md: -------------------------------------------------------------------------------- 1 | 2 | 1. John Graham-Cumming http://jgc.org/ 3 | 1. Mike Samuel mikesamuel@gmail.com 4 | 1. Dmitri Shuralyov shurcooL@gmail.com 5 | 1. https://github.com/opennota 6 | -------------------------------------------------------------------------------- /vendor/github.com/microcosm-cc/bluemonday/Makefile: -------------------------------------------------------------------------------- 1 | # Targets: 2 | # 3 | # all: Builds the code locally after testing 4 | # 5 | # fmt: Formats the source files 6 | # build: Builds the code locally 7 | # vet: Vets the code 8 | # lint: Runs lint over the code (you do not need to fix everything) 9 | # test: Runs the tests 10 | # cover: Gives you the URL to a nice test coverage report 11 | # 12 | # install: Builds, tests and installs the code locally 13 | 14 | .PHONY: all fmt build vet lint test cover clean install 15 | 16 | # The first target is always the default action if `make` is called without 17 | # args we build and install into $GOPATH so that it can just be run 18 | 19 | all: fmt vet test install 20 | 21 | fmt: 22 | @gofmt -w ./$* 23 | 24 | build: clean 25 | @go build 26 | 27 | vet: 28 | @vet *.go 29 | 30 | lint: 31 | @golint *.go 32 | 33 | test: 34 | @go test -v ./... 35 | 36 | cover: COVERAGE_FILE := coverage.out 37 | cover: 38 | @go test -coverprofile=$(COVERAGE_FILE) && \ 39 | cover -html=$(COVERAGE_FILE) && rm $(COVERAGE_FILE) 40 | 41 | install: clean 42 | @go install ./... 43 | -------------------------------------------------------------------------------- /vendor/github.com/msteinert/pam/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/msteinert/pam.svg?branch=master)](https://travis-ci.org/msteinert/pam) 2 | [![GoDoc](https://godoc.org/github.com/msteinert/pam?status.svg)](http://godoc.org/github.com/msteinert/pam) 3 | [![Coverage Status](https://coveralls.io/repos/msteinert/pam/badge.svg?branch=master)](https://coveralls.io/r/msteinert/pam?branch=master) 4 | [![Go Report Card](http://goreportcard.com/badge/msteinert/pam)](http://goreportcard.com/report/msteinert/pam) 5 | 6 | # Go PAM 7 | 8 | This is a Go wrapper for the PAM application API. 9 | 10 | ## Testing 11 | 12 | To run the full suite, the tests must be run as the root user. To setup your 13 | system for testing, create a user named "test" with the password "secret". For 14 | example: 15 | 16 | ``` 17 | $ sudo useradd test \ 18 | -d /tmp/test \ 19 | -p '$1$Qd8H95T5$RYSZQeoFbEB.gS19zS99A0' \ 20 | -s /bin/false 21 | ``` 22 | 23 | Then execute the tests: 24 | 25 | ``` 26 | $ sudo GOPATH=$GOPATH $(which go) test -v 27 | ``` 28 | 29 | [1]: http://godoc.org/github.com/msteinert/pam 30 | [2]: http://www.linux-pam.org/Linux-PAM-html/Linux-PAM_ADG.html 31 | -------------------------------------------------------------------------------- /vendor/github.com/msteinert/pam/callback.go: -------------------------------------------------------------------------------- 1 | package pam 2 | 3 | import "sync" 4 | 5 | var cb struct { 6 | sync.Mutex 7 | m map[int]interface{} 8 | c int 9 | } 10 | 11 | func init() { 12 | cb.m = make(map[int]interface{}) 13 | } 14 | 15 | func cbAdd(v interface{}) int { 16 | cb.Lock() 17 | defer cb.Unlock() 18 | cb.c++ 19 | cb.m[cb.c] = v 20 | return cb.c 21 | } 22 | 23 | func cbGet(c int) interface{} { 24 | cb.Lock() 25 | defer cb.Unlock() 26 | if v, ok := cb.m[c]; ok { 27 | return v 28 | } 29 | panic("Callback pointer not found") 30 | } 31 | 32 | func cbDelete(c int) { 33 | cb.Lock() 34 | defer cb.Unlock() 35 | if _, ok := cb.m[c]; !ok { 36 | panic("Callback pointer not found") 37 | } 38 | delete(cb.m, c) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/msteinert/pam/transaction.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | #include 3 | #include 4 | 5 | int cb_pam_conv( 6 | int num_msg, 7 | const struct pam_message **msg, 8 | struct pam_response **resp, 9 | void *appdata_ptr) 10 | { 11 | *resp = calloc(num_msg, sizeof **resp); 12 | if (num_msg <= 0 || num_msg > PAM_MAX_NUM_MSG) { 13 | return PAM_CONV_ERR; 14 | } 15 | if (!*resp) { 16 | return PAM_BUF_ERR; 17 | } 18 | for (size_t i = 0; i < num_msg; ++i) { 19 | struct cbPAMConv_return result = cbPAMConv( 20 | msg[i]->msg_style, 21 | (char *)msg[i]->msg, 22 | (long)appdata_ptr); 23 | if (result.r1 != PAM_SUCCESS) { 24 | goto error; 25 | } 26 | (*resp)[i].resp = result.r0; 27 | } 28 | return PAM_SUCCESS; 29 | error: 30 | for (size_t i = 0; i < num_msg; ++i) { 31 | if ((*resp)[i].resp) { 32 | memset((*resp)[i].resp, 0, strlen((*resp)[i].resp)); 33 | free((*resp)[i].resp); 34 | } 35 | } 36 | memset(*resp, 0, num_msg * sizeof *resp); 37 | free(*resp); 38 | *resp = NULL; 39 | return PAM_CONV_ERR; 40 | } 41 | 42 | void init_pam_conv(struct pam_conv *conv, long c) 43 | { 44 | conv->conv = cb_pam_conv; 45 | conv->appdata_ptr = (void *)c; 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/nfnt/resize/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Jan Schlicht 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/ngaut/log/README.md: -------------------------------------------------------------------------------- 1 | logging 2 | ======= 3 | -------------------------------------------------------------------------------- /vendor/github.com/ngaut/log/crash_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd openbsd netbsd dragonfly darwin linux 2 | 3 | package log 4 | 5 | import ( 6 | "log" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func CrashLog(file string) { 12 | f, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) 13 | if err != nil { 14 | log.Println(err.Error()) 15 | } else { 16 | syscall.Dup2(int(f.Fd()), 2) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/ngaut/log/crash_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package log 4 | 5 | import ( 6 | "log" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | var ( 12 | kernel32 = syscall.MustLoadDLL("kernel32.dll") 13 | procSetStdHandle = kernel32.MustFindProc("SetStdHandle") 14 | ) 15 | 16 | func setStdHandle(stdhandle int32, handle syscall.Handle) error { 17 | r0, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0) 18 | if r0 == 0 { 19 | if e1 != 0 { 20 | return error(e1) 21 | } 22 | return syscall.EINVAL 23 | } 24 | return nil 25 | } 26 | 27 | func CrashLog(file string) { 28 | f, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) 29 | if err != nil { 30 | log.Println(err.Error()) 31 | } else { 32 | err = setStdHandle(syscall.STD_ERROR_HANDLE, syscall.Handle(f.Fd())) 33 | if err != nil { 34 | log.Println(err.Error()) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/petar/GoLLRB/AUTHORS: -------------------------------------------------------------------------------- 1 | Petar Maymounkov 2 | Vadim Vygonets 3 | Ian Smith 4 | Martin Bruse 5 | -------------------------------------------------------------------------------- /vendor/github.com/petar/GoLLRB/llrb/avgvar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Petar Maymounkov. 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 llrb 6 | 7 | import "math" 8 | 9 | // avgVar maintains the average and variance of a stream of numbers 10 | // in a space-efficient manner. 11 | type avgVar struct { 12 | count int64 13 | sum, sumsq float64 14 | } 15 | 16 | func (av *avgVar) Init() { 17 | av.count = 0 18 | av.sum = 0.0 19 | av.sumsq = 0.0 20 | } 21 | 22 | func (av *avgVar) Add(sample float64) { 23 | av.count++ 24 | av.sum += sample 25 | av.sumsq += sample * sample 26 | } 27 | 28 | func (av *avgVar) GetCount() int64 { return av.count } 29 | 30 | func (av *avgVar) GetAvg() float64 { return av.sum / float64(av.count) } 31 | 32 | func (av *avgVar) GetTotal() float64 { return av.sum } 33 | 34 | func (av *avgVar) GetVar() float64 { 35 | a := av.GetAvg() 36 | return av.sumsq/float64(av.count) - a*a 37 | } 38 | 39 | func (av *avgVar) GetStdDev() float64 { return math.Sqrt(av.GetVar()) } 40 | -------------------------------------------------------------------------------- /vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Petar Maymounkov. 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 llrb 6 | 7 | // GetHeight() returns an item in the tree with key @key, and it's height in the tree 8 | func (t *LLRB) GetHeight(key Item) (result Item, depth int) { 9 | return t.getHeight(t.root, key) 10 | } 11 | 12 | func (t *LLRB) getHeight(h *Node, item Item) (Item, int) { 13 | if h == nil { 14 | return nil, 0 15 | } 16 | if less(item, h.Item) { 17 | result, depth := t.getHeight(h.Left, item) 18 | return result, depth + 1 19 | } 20 | if less(h.Item, item) { 21 | result, depth := t.getHeight(h.Right, item) 22 | return result, depth + 1 23 | } 24 | return h.Item, 0 25 | } 26 | 27 | // HeightStats() returns the average and standard deviation of the height 28 | // of elements in the tree 29 | func (t *LLRB) HeightStats() (avg, stddev float64) { 30 | av := &avgVar{} 31 | heightStats(t.root, 0, av) 32 | return av.GetAvg(), av.GetStdDev() 33 | } 34 | 35 | func heightStats(h *Node, d int, av *avgVar) { 36 | if h == nil { 37 | return 38 | } 39 | av.Add(float64(d)) 40 | if h.Left != nil { 41 | heightStats(h.Left, d+1, av) 42 | } 43 | if h.Right != nil { 44 | heightStats(h.Right, d+1, av) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/petar/GoLLRB/llrb/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 Petar Maymounkov. 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 llrb 6 | 7 | type Int int 8 | 9 | func (x Int) Less(than Item) bool { 10 | return x < than.(Int) 11 | } 12 | 13 | type String string 14 | 15 | func (x String) Less(than Item) bool { 16 | return x < than.(String) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Suryandaru Triandana 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/comparer/bytes_comparer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package comparer 8 | 9 | import "bytes" 10 | 11 | type bytesComparer struct{} 12 | 13 | func (bytesComparer) Compare(a, b []byte) int { 14 | return bytes.Compare(a, b) 15 | } 16 | 17 | func (bytesComparer) Name() string { 18 | return "leveldb.BytewiseComparator" 19 | } 20 | 21 | func (bytesComparer) Separator(dst, a, b []byte) []byte { 22 | i, n := 0, len(a) 23 | if n > len(b) { 24 | n = len(b) 25 | } 26 | for ; i < n && a[i] == b[i]; i++ { 27 | } 28 | if i >= n { 29 | // Do not shorten if one string is a prefix of the other 30 | } else if c := a[i]; c < 0xff && c+1 < b[i] { 31 | dst = append(dst, a[:i+1]...) 32 | dst[i]++ 33 | return dst 34 | } 35 | return nil 36 | } 37 | 38 | func (bytesComparer) Successor(dst, b []byte) []byte { 39 | for i, c := range b { 40 | if c != 0xff { 41 | dst = append(dst, b[:i+1]...) 42 | dst[i]++ 43 | return dst 44 | } 45 | } 46 | return nil 47 | } 48 | 49 | // DefaultComparer are default implementation of the Comparer interface. 50 | // It uses the natural ordering, consistent with bytes.Compare. 51 | var DefaultComparer = bytesComparer{} 52 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/pingcap/goleveldb/leveldb/errors" 11 | ) 12 | 13 | var ( 14 | ErrNotFound = errors.ErrNotFound 15 | ErrReadOnly = errors.New("leveldb: read-only mode") 16 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 17 | ErrIterReleased = errors.New("leveldb: iterator released") 18 | ErrClosed = errors.New("leveldb: closed") 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/pingcap/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/storage/file_storage_nacl.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build nacl 8 | 9 | package storage 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 17 | return nil, syscall.ENOTSUP 18 | } 19 | 20 | func setFileLock(f *os.File, readOnly, lock bool) error { 21 | return syscall.ENOTSUP 22 | } 23 | 24 | func rename(oldpath, newpath string) error { 25 | return syscall.ENOTSUP 26 | } 27 | 28 | func isErrInvalid(err error) bool { 29 | return false 30 | } 31 | 32 | func syncDir(name string) error { 33 | return syscall.ENOTSUP 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.6 2 | 3 | COPY . /go/src/github.com/pingcap/tidb 4 | 5 | RUN cd /go/src/github.com/pingcap/tidb && \ 6 | make && \ 7 | mv bin/tidb-server /tidb-server && \ 8 | make clean 9 | 10 | EXPOSE 4000 11 | 12 | ENTRYPOINT ["/tidb-server"] 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/context/context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package context 15 | 16 | import ( 17 | "fmt" 18 | 19 | "github.com/pingcap/tidb/kv" 20 | ) 21 | 22 | // Context is an interface for transaction and executive args environment. 23 | type Context interface { 24 | // GetTxn gets a transaction for further execution. 25 | GetTxn(forceNew bool) (kv.Transaction, error) 26 | 27 | // RollbackTxn rolls back the current transaction. 28 | RollbackTxn() error 29 | 30 | // CommitTxn commits the current transaction. 31 | CommitTxn() error 32 | 33 | // SetValue saves a value associated with this context for key. 34 | SetValue(key fmt.Stringer, value interface{}) 35 | 36 | // Value returns the value associated with this context for key. 37 | Value(key fmt.Stringer) interface{} 38 | 39 | // ClearValue clears the value associated with this context for key. 40 | ClearValue(key fmt.Stringer) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/gitcookie.sh: -------------------------------------------------------------------------------- 1 | touch ~/.gitcookies 2 | chmod 0600 ~/.gitcookies 3 | 4 | git config --global http.cookiefile ~/.gitcookies 5 | 6 | tr , \\t <<\__END__ >>~/.gitcookies 7 | go.googlesource.com,FALSE,/,TRUE,2147483647,o,git-z.pingcap.com=1/Xv6CBlnVpdrhYBXT5i_VexGocQcbgkKsrW938zgjqx0 8 | go-review.googlesource.com,FALSE,/,TRUE,2147483647,o,git-z.pingcap.com=1/Xv6CBlnVpdrhYBXT5i_VexGocQcbgkKsrW938zgjqx0 9 | __END__ 10 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/kv/iter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package kv 15 | 16 | import "github.com/juju/errors" 17 | 18 | // NextUntil applies FnKeyCmp to each entry of the iterator until meets some condition. 19 | // It will stop when fn returns true, or iterator is invalid or an error occurs. 20 | func NextUntil(it Iterator, fn FnKeyCmp) error { 21 | var err error 22 | for it.Valid() && !fn(it.Key()) { 23 | err = it.Next() 24 | if err != nil { 25 | return errors.Trace(err) 26 | } 27 | } 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/make.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | ::go build option 3 | set TiDBBuildTS=%date:~0,10% %time:~1,7% 4 | for /f "delims=" %%i in ('git rev-parse HEAD') do (set TiDBGitHash=%%i) 5 | set LDFLAGS="-X github.com/pingcap/tidb/util/printer.TiDBBuildTS=%TiDBBuildTS% -X github.com/pingcap/tidb/util/printer.TiDBGitHash=%TiDBGitHash%" 6 | 7 | :: godep 8 | go get github.com/tools/godep 9 | 10 | @echo [Parser] 11 | go get github.com/qiuyesuifeng/goyacc 12 | go get github.com/qiuyesuifeng/golex 13 | type nul >>temp.XXXXXX 14 | goyacc -o nul -xegen "temp.XXXXXX" parser/parser.y 15 | goyacc -o parser/parser.go -xe "temp.XXXXXX" parser/parser.y 16 | DEL /F /A /Q temp.XXXXXX 17 | DEL /F /A /Q y.output 18 | 19 | golex -o parser/scanner.go parser/scanner.l 20 | 21 | @echo [Build] 22 | godep go build -ldflags '%LDFLAGS%' 23 | 24 | @echo [Install] 25 | godep go install ./... 26 | 27 | 28 | @echo [Test] 29 | godep go test -cover ./... 30 | 31 | ::done 32 | @echo [Done] 33 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/plan/preprocess.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package plan 15 | 16 | import ( 17 | "github.com/juju/errors" 18 | "github.com/pingcap/tidb/ast" 19 | "github.com/pingcap/tidb/context" 20 | "github.com/pingcap/tidb/infoschema" 21 | ) 22 | 23 | // Preprocess does preprocess work for optimizer. 24 | func Preprocess(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error { 25 | if err := ResolveName(node, info, ctx); err != nil { 26 | return errors.Trace(err) 27 | } 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/plan/statistics/statistics.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package statistics; 4 | 5 | message ColumnPB { 6 | optional int64 id = 1; 7 | optional int64 ndv = 2; 8 | repeated int64 numbers = 3; 9 | optional bytes value = 4; // encoded bytes from datum slice values. 10 | repeated int64 repeats = 5; 11 | } 12 | 13 | message TablePB { 14 | optional int64 id = 1; 15 | optional int64 ts = 2; 16 | optional int64 count = 3; 17 | repeated ColumnPB columns = 4; 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/sessionctx/domainctx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package sessionctx 15 | 16 | import ( 17 | "github.com/pingcap/tidb/context" 18 | "github.com/pingcap/tidb/domain" 19 | ) 20 | 21 | // A dummy type to avoid naming collision in context. 22 | type domainKeyType int 23 | 24 | // String defines a Stringer function for debugging and pretty printing. 25 | func (k domainKeyType) String() string { 26 | return "domain" 27 | } 28 | 29 | const domainKey domainKeyType = 0 30 | 31 | // BindDomain binds domain to context. 32 | func BindDomain(ctx context.Context, domain *domain.Domain) { 33 | ctx.SetValue(domainKey, domain) 34 | } 35 | 36 | // GetDomain gets domain from context. 37 | func GetDomain(ctx context.Context) *domain.Domain { 38 | v, ok := ctx.Value(domainKey).(*domain.Domain) 39 | if !ok { 40 | return nil 41 | } 42 | return v 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/sessionctx/forupdate/for_update_ctx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package forupdate record information for "select ... for update" statement 15 | package forupdate 16 | 17 | import "github.com/pingcap/tidb/context" 18 | 19 | // A dummy type to avoid naming collision in context. 20 | type forupdateKeyType int 21 | 22 | // String defines a Stringer function for debugging and pretty printing. 23 | func (k forupdateKeyType) String() string { 24 | return "for update" 25 | } 26 | 27 | // ForUpdateKey is used to retrive "select for update" statement information 28 | const ForUpdateKey forupdateKeyType = 0 29 | 30 | // SetForUpdate set "select for update" flag. 31 | func SetForUpdate(ctx context.Context) { 32 | ctx.SetValue(ForUpdateKey, true) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/store/localstore/local_pd.go: -------------------------------------------------------------------------------- 1 | package localstore 2 | 3 | import "github.com/pingcap/tidb/kv" 4 | 5 | type localPD struct { 6 | regions []*regionInfo 7 | } 8 | 9 | type regionInfo struct { 10 | startKey kv.Key 11 | endKey kv.Key 12 | rs *localRegion 13 | } 14 | 15 | func (pd *localPD) GetRegionInfo() []*regionInfo { 16 | return pd.regions 17 | } 18 | 19 | func (pd *localPD) SetRegionInfo(regions []*regionInfo) { 20 | pd.regions = regions 21 | } 22 | 23 | // ChangeRegionInfo used for test handling region info change. 24 | func ChangeRegionInfo(store kv.Storage, regionID int, startKey, endKey []byte) { 25 | s := store.(*dbStore) 26 | for i, region := range s.pd.regions { 27 | if region.rs.id == regionID { 28 | newRegionInfo := ®ionInfo{ 29 | startKey: startKey, 30 | endKey: endKey, 31 | rs: region.rs, 32 | } 33 | region.rs.startKey = startKey 34 | region.rs.endKey = endKey 35 | s.pd.regions[i] = newRegionInfo 36 | break 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/updatedep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$1" == "-h" ] ; then 3 | echo "Usage: $0 [package]" 4 | echo " Update dependency package in vendor." 5 | echo " Make sure the package to be updated is on master branch." 6 | echo " If [package] is not provided, it updates 'github.com/pingcap/kvproto/pkg/...'" 7 | echo "" 8 | exit 0 9 | fi 10 | 11 | mv _vendor/* . 12 | if [ $# -eq 1 ]; then 13 | go get -u -v -d $1 14 | godep update $1 15 | elif [ $# -eq 0 ]; then 16 | go get -u -v -d github.com/pingcap/kvproto/pkg 17 | godep update github.com/pingcap/kvproto/pkg/... 18 | else 19 | echo "Invalid argument count." 20 | fi 21 | mv Godeps _vendor/ 22 | mv vendor _vendor/ 23 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/util/bytes/bytes.go: -------------------------------------------------------------------------------- 1 | package bytes 2 | 3 | // CloneBytes returns a deep copy of slice b. 4 | func CloneBytes(b []byte) []byte { 5 | return append([]byte(nil), b...) 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tidb/util/hack/hack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 PingCAP, Inc. 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 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package hack 15 | 16 | import ( 17 | "reflect" 18 | "unsafe" 19 | ) 20 | 21 | // String converts slice to string without copy. 22 | // Use at your own risk. 23 | func String(b []byte) (s string) { 24 | if len(b) == 0 { 25 | return "" 26 | } 27 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 28 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 29 | pstring.Data = pbytes.Data 30 | pstring.Len = pbytes.Len 31 | return 32 | } 33 | 34 | // Slice converts string to slice without copy. 35 | // Use at your own risk. 36 | func Slice(s string) (b []byte) { 37 | pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 38 | pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) 39 | pbytes.Data = pstring.Data 40 | pbytes.Len = pstring.Len 41 | pbytes.Cap = pstring.Len 42 | return 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tipb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tipb" 3 | version = "0.0.1" 4 | 5 | [lib] 6 | name = "tipb" 7 | 8 | [dependencies] 9 | protobuf = "1.0" 10 | 11 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tipb/Makefile: -------------------------------------------------------------------------------- 1 | all: go rust binlog 2 | 3 | go: 4 | ./generate-go.sh 5 | 6 | rust: 7 | ./generate-rust.sh 8 | 9 | binlog: 10 | ./generate-binlog.sh 11 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tipb/generate-binlog.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd proto/binlog 3 | 4 | echo "generate binlog code..." 5 | GOGO_ROOT=${GOPATH}/src/github.com/gogo/protobuf 6 | protoc -I.:${GOGO_ROOT}:${GOGO_ROOT}/protobuf --gofast_out=../../go-binlog *.proto 7 | cd ../../go-binlog 8 | sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go 9 | sed -i.bak -E 's/import fmt \"fmt\"//g' *.pb.go 10 | rm -f *.bak 11 | goimports -w *.pb.go 12 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tipb/generate-go.sh: -------------------------------------------------------------------------------- 1 | cd proto 2 | 3 | echo "generate go code..." 4 | GOGO_ROOT=${GOPATH}/src/github.com/gogo/protobuf 5 | protoc -I.:${GOGO_ROOT}:${GOGO_ROOT}/protobuf --gofast_out=../go-tipb *.proto 6 | cd ../go-tipb 7 | sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go 8 | sed -i.bak -E 's/import fmt \"fmt\"//g' *.pb.go 9 | rm -f *.bak 10 | goimports -w *.pb.go 11 | -------------------------------------------------------------------------------- /vendor/github.com/pingcap/tipb/generate-rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd proto 4 | 5 | echo "generate rust code..." 6 | ret=0 7 | GOGO_ROOT=${GOPATH}/src/github.com/gogo/protobuf 8 | protoc -I.:${GOGO_ROOT}:${GOGO_ROOT}/protobuf --rust_out ../src *.proto || ret=$? 9 | 10 | 11 | echo "extern crate protobuf;" > ../src/lib.rs 12 | for file in `ls *.proto` 13 | do 14 | base_name=$(basename $file ".proto") 15 | echo "#[cfg_attr(rustfmt, rustfmt_skip)]" >> ../src/lib.rs 16 | echo "pub mod $base_name;" >> ../src/lib.rs 17 | done 18 | if [[ $ret -ne 0 ]]; then 19 | exit $ret 20 | fi 21 | cd .. 22 | cargo build 23 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test . 11 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/sergi/go-diff/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Sergi Mansilla 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included 11 | in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /vendor/github.com/sergi/go-diff/diffmatchpatch/stack.go: -------------------------------------------------------------------------------- 1 | package diffmatchpatch 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Stack struct { 8 | top *Element 9 | size int 10 | } 11 | 12 | type Element struct { 13 | value interface{} 14 | next *Element 15 | } 16 | 17 | // Len returns the stack's length 18 | func (s *Stack) Len() int { 19 | return s.size 20 | } 21 | 22 | // Push appends a new element onto the stack 23 | func (s *Stack) Push(value interface{}) { 24 | s.top = &Element{value, s.top} 25 | s.size++ 26 | } 27 | 28 | // Pop removes the top element from the stack and return its value 29 | // If the stack is empty, return nil 30 | func (s *Stack) Pop() (value interface{}) { 31 | if s.size > 0 { 32 | value, s.top = s.top.value, s.top.next 33 | s.size-- 34 | return 35 | } 36 | return nil 37 | } 38 | 39 | // Peek returns the value of the element on the top of the stack 40 | // but don't remove it. If the stack is empty, return nil 41 | func (s *Stack) Peek() (value interface{}) { 42 | if s.size > 0 { 43 | value = s.top.value 44 | return 45 | } 46 | return -1 47 | } 48 | 49 | // Clear empties the stack 50 | func (s *Stack) Clear() { 51 | s.top = nil 52 | s.size = 0 53 | } 54 | 55 | func main() { 56 | stack := new(Stack) 57 | 58 | stack.Push("Things") 59 | stack.Push("and") 60 | stack.Push("Stuff") 61 | 62 | for stack.Len() > 0 { 63 | fmt.Printf("%s ", stack.Pop().(string)) 64 | } 65 | fmt.Println() 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Dmitri Shuralyov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/README.md: -------------------------------------------------------------------------------- 1 | # sanitized_anchor_name [![Build Status](https://travis-ci.org/shurcooL/sanitized_anchor_name.svg?branch=master)](https://travis-ci.org/shurcooL/sanitized_anchor_name) [![GoDoc](https://godoc.org/github.com/shurcooL/sanitized_anchor_name?status.svg)](https://godoc.org/github.com/shurcooL/sanitized_anchor_name) 2 | 3 | Package sanitized_anchor_name provides a func to create sanitized anchor names. 4 | 5 | Its logic can be reused by multiple packages to create interoperable anchor names and links to those anchors. 6 | 7 | At this time, it does not try to ensure that generated anchor names are unique, that responsibility falls on the caller. 8 | 9 | Installation 10 | ------------ 11 | 12 | ```bash 13 | go get -u github.com/shurcooL/sanitized_anchor_name 14 | ``` 15 | 16 | Example 17 | ------- 18 | 19 | ```Go 20 | anchorName := sanitized_anchor_name.Create("This is a header") 21 | 22 | fmt.Println(anchorName) 23 | 24 | // Output: 25 | // this-is-a-header 26 | ``` 27 | 28 | License 29 | ------- 30 | 31 | - [MIT License](LICENSE) 32 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/main.go: -------------------------------------------------------------------------------- 1 | // Package sanitized_anchor_name provides a func to create sanitized anchor names. 2 | // 3 | // Its logic can be reused by multiple packages to create interoperable anchor names 4 | // and links to those anchors. 5 | // 6 | // At this time, it does not try to ensure that generated anchor names 7 | // are unique, that responsibility falls on the caller. 8 | package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" 9 | 10 | import "unicode" 11 | 12 | // Create returns a sanitized anchor name for the given text. 13 | func Create(text string) string { 14 | var anchorName []rune 15 | var futureDash = false 16 | for _, r := range []rune(text) { 17 | switch { 18 | case unicode.IsLetter(r) || unicode.IsNumber(r): 19 | if futureDash && len(anchorName) > 0 { 20 | anchorName = append(anchorName, '-') 21 | } 22 | futureDash = false 23 | anchorName = append(anchorName, unicode.ToLower(r)) 24 | default: 25 | futureDash = true 26 | } 27 | } 28 | return string(anchorName) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/strk/go-libravatar/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Sandro Santilli 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/strk/go-libravatar/README.md: -------------------------------------------------------------------------------- 1 | Simple [golang](https://www.golang.org) library for serving 2 | [federated avatars](https://www.libravatar.org) 3 | 4 | # Use 5 | 6 | ```sh 7 | go get strk.kbt.io/projects/go/libravatar 8 | cd $GOPATH/src/strk.kbt.io/projects/go/libravatar 9 | go doc 10 | ``` 11 | 12 | # Contribute 13 | 14 | A clone of the code repository would be downloaded by `go get`. 15 | You can send patches or pull requests to strk@kbt.io. 16 | 17 | If you need a place to publish your contribution branches, 18 | you could start from a fork of the gitlab mirror: 19 | https://gitlab.com/strk/go-libravatar 20 | 21 | # Contacts 22 | 23 | * Project homepage: http://strk.kbt.io/projects/go/libravatar 24 | * Maintainer: Sandro Santilli 25 | 26 | -------------------------------------------------------------------------------- /vendor/github.com/twinj/uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Krzysztof Kowalik 2 | Copyright (C) 2016 by Daniel Kemp Derivative work 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /vendor/github.com/yosida95/golang-sshkey/README.rst: -------------------------------------------------------------------------------- 1 | golang-sshkey 2 | ============= 3 | 4 | ----- 5 | About 6 | ----- 7 | SSH key management utility 8 | 9 | ------- 10 | Install 11 | ------- 12 | 13 | .. code:: shell 14 | 15 | $ go get github.com/yosida95/golang-sshkey 16 | 17 | 18 | -------- 19 | Document 20 | -------- 21 | https://godoc.org/github.com/yosida95/golang-sshkey 22 | 23 | ------- 24 | License 25 | ------- 26 | golangis licensed under the 3-Clause BSD License. See ./LICENSE. 27 | -------------------------------------------------------------------------------- /vendor/github.com/yosida95/golang-sshkey/marshal.go: -------------------------------------------------------------------------------- 1 | package sshkey 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/binary" 6 | "fmt" 7 | ) 8 | 9 | func encodeByteSlice(in ...[]byte) []byte { 10 | l := 0 11 | for _, v := range in { 12 | l += len(v) 13 | } 14 | if l > 4294967295 { 15 | panic(fmt.Errorf("input byte slice is too long")) 16 | } 17 | 18 | out := make([]byte, 4+l) 19 | binary.BigEndian.PutUint32(out, uint32(l)) 20 | 21 | start := 4 + copy(out[4:], in[0]) 22 | if len(in) > 1 { 23 | for _, v := range in[1:] { 24 | copy(out[start:], v) 25 | } 26 | } 27 | 28 | return out 29 | } 30 | 31 | func MarshalPublicKey(key PublicKey) (result string, err error) { 32 | var content []byte 33 | 34 | switch key.Type() { 35 | case KEY_RSA: 36 | result, content, err = marshalRSAPublicKey(key) 37 | case KEY_DSA: 38 | result, content, err = marshalDSAPublicKey(key) 39 | case KEY_ECDSA: 40 | result, content, err = marshalECDSAPublicKey(key) 41 | default: 42 | return "", ErrUnsupportedKey 43 | } 44 | 45 | result += " " + base64.StdEncoding.EncodeToString(content) 46 | if key.Comment() != "" { 47 | result += " " + key.Comment() 48 | } 49 | 50 | return 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/yosida95/golang-sshkey/sshkey.go: -------------------------------------------------------------------------------- 1 | package sshkey 2 | 3 | import ( 4 | "crypto" 5 | ) 6 | 7 | type Type int 8 | 9 | const ( 10 | KEY_RSA Type = iota 11 | KEY_DSA 12 | KEY_ECDSA 13 | ) 14 | 15 | type PublicKey interface { 16 | Type() Type 17 | Public() crypto.PublicKey 18 | Length() int 19 | Comment() string 20 | } 21 | 22 | type basePublicKey struct { 23 | keyType Type 24 | comment string 25 | } 26 | 27 | func (k *basePublicKey) Type() Type { 28 | return k.keyType 29 | } 30 | 31 | func (k *basePublicKey) Comment() string { 32 | return k.comment 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/yosida95/golang-sshkey/unmarshal.go: -------------------------------------------------------------------------------- 1 | package sshkey 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/binary" 6 | "errors" 7 | "strings" 8 | ) 9 | 10 | var ( 11 | ErrMalformedKey = errors.New("Malformed key") 12 | ErrUnsupportedKey = errors.New("Unsupported key") 13 | ) 14 | 15 | func decodeByteSlice(in []byte) ([]byte, []byte) { 16 | l := len(in) 17 | if l < 4 { 18 | return nil, in 19 | } 20 | 21 | stop := 4 + int(binary.BigEndian.Uint32(in)) 22 | if l < stop { 23 | return nil, in 24 | } 25 | 26 | return in[4:stop], in[stop:l] 27 | } 28 | 29 | func UnmarshalPublicKey(pub string) (PublicKey, error) { 30 | splited := strings.SplitN(pub, " ", 3) 31 | if len(splited) < 2 { 32 | return nil, ErrMalformedKey 33 | } 34 | 35 | var ( 36 | alg = strings.TrimSpace(splited[0]) 37 | cb64 = strings.TrimSpace(splited[1]) 38 | comment string 39 | ) 40 | if len(splited) == 3 { 41 | comment = strings.TrimSpace(splited[2]) 42 | } 43 | 44 | c, err := base64.StdEncoding.DecodeString(cb64) 45 | if err != nil { 46 | return nil, err 47 | } 48 | 49 | switch alg { 50 | case "ssh-rsa": 51 | return unmarshalRSAPublicKey(c, comment) 52 | case "ssh-dss": 53 | return unmarshalDSAPublicKey(c, comment) 54 | case "ecdsa-sha2-nistp256", "ecdsa-sha2-nistp384", "ecdsa-sha2-nistp521": 55 | return unmarshalECDSAPublicKey(c, comment) 56 | } 57 | return nil, ErrUnsupportedKey 58 | } 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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/crypto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go cryptography libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.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 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF 11 | GLOBL ·REDMASK51(SB), 8, $8 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/doc.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 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html 7 | package curve25519 // import "golang.org/x/crypto/curve25519" 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | */ 18 | package ssh // import "golang.org/x/crypto/ssh" 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/net/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/sys/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README: -------------------------------------------------------------------------------- 1 | This repository holds supplemental Go packages for low-level interactions with the operating system. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.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 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.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 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.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 windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.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 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows,race 6 | 7 | package windows 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows,!race 6 | 7 | package windows 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/event.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 windows 6 | 7 | package svc 8 | 9 | import ( 10 | "errors" 11 | 12 | "golang.org/x/sys/windows" 13 | ) 14 | 15 | // event represents auto-reset, initially non-signaled Windows event. 16 | // It is used to communicate between go and asm parts of this package. 17 | type event struct { 18 | h windows.Handle 19 | } 20 | 21 | func newEvent() (*event, error) { 22 | h, err := windows.CreateEvent(nil, 0, 0, nil) 23 | if err != nil { 24 | return nil, err 25 | } 26 | return &event{h: h}, nil 27 | } 28 | 29 | func (e *event) Close() error { 30 | return windows.CloseHandle(e.h) 31 | } 32 | 33 | func (e *event) Set() error { 34 | return windows.SetEvent(e.h) 35 | } 36 | 37 | func (e *event) Wait() error { 38 | s, err := windows.WaitForSingleObject(e.h, windows.INFINITE) 39 | switch s { 40 | case windows.WAIT_OBJECT_0: 41 | break 42 | case windows.WAIT_FAILED: 43 | return err 44 | default: 45 | return errors.New("unexpected result from WaitForSingleObject") 46 | } 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.c: -------------------------------------------------------------------------------- 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 windows 6 | // +build !go1.3 7 | 8 | // copied from pkg/runtime 9 | typedef unsigned int uint32; 10 | typedef unsigned long long int uint64; 11 | #ifdef _64BIT 12 | typedef uint64 uintptr; 13 | #else 14 | typedef uint32 uintptr; 15 | #endif 16 | 17 | // from sys_386.s or sys_amd64.s 18 | void ·servicemain(void); 19 | 20 | void 21 | ·getServiceMain(uintptr *r) 22 | { 23 | *r = (uintptr)·servicemain; 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.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 | // +build windows 6 | // +build !go1.3 7 | 8 | package svc 9 | 10 | // from go12.c 11 | func getServiceMain(r *uintptr) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go13.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 | // +build windows 6 | // +build go1.3 7 | 8 | package svc 9 | 10 | import "unsafe" 11 | 12 | const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const 13 | 14 | // Should be a built-in for unsafe.Pointer? 15 | func add(p unsafe.Pointer, x uintptr) unsafe.Pointer { 16 | return unsafe.Pointer(uintptr(p) + x) 17 | } 18 | 19 | // funcPC returns the entry PC of the function f. 20 | // It assumes that f is a func value. Otherwise the behavior is undefined. 21 | func funcPC(f interface{}) uintptr { 22 | return **(**uintptr)(add(unsafe.Pointer(&f), ptrSize)) 23 | } 24 | 25 | // from sys_386.s and sys_amd64.s 26 | func servicectlhandler(ctl uint32) uintptr 27 | func servicemain(argc uint32, argv **uint16) 28 | 29 | func getServiceMain(r *uintptr) { 30 | *r = funcPC(servicemain) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/sys_amd64.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 windows 6 | 7 | // func servicemain(argc uint32, argv **uint16) 8 | TEXT ·servicemain(SB),7,$0 9 | MOVL CX, ·sArgc(SB) 10 | MOVL DX, ·sArgv(SB) 11 | 12 | SUBQ $32, SP // stack for the first 4 syscall params 13 | 14 | MOVQ ·sName(SB), CX 15 | MOVQ $·servicectlhandler(SB), DX 16 | MOVQ ·cRegisterServiceCtrlHandlerW(SB), AX 17 | CALL AX 18 | CMPQ AX, $0 19 | JE exit 20 | MOVQ AX, ·ssHandle(SB) 21 | 22 | MOVQ ·goWaitsH(SB), CX 23 | MOVQ ·cSetEvent(SB), AX 24 | CALL AX 25 | 26 | MOVQ ·cWaitsH(SB), CX 27 | MOVQ $4294967295, DX 28 | MOVQ ·cWaitForSingleObject(SB), AX 29 | CALL AX 30 | 31 | exit: 32 | ADDQ $32, SP 33 | RET 34 | 35 | // I do not know why, but this seems to be the only way to call 36 | // ctlHandlerProc on Windows 7. 37 | 38 | // func servicectlhandler(ctl uint32) uintptr 39 | TEXT ·servicectlhandler(SB),7,$0 40 | MOVQ ·ctlHandlerProc(SB), AX 41 | JMP AX 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/ztypes_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/text/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go libraries for text processing, many involving Unicode. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/doc.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 | //go:generate go run gen.go 6 | 7 | // text is a repository of text-related packages related to internationalization 8 | // (i18n) and localization (l10n), such as character encodings, text 9 | // transformations, and locale-specific text handling. 10 | package text 11 | 12 | // TODO: more documentation on general concepts, such as Transformers, use 13 | // of normalization, etc. 14 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/gen.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 ignore 6 | 7 | package main 8 | 9 | import ( 10 | "log" 11 | 12 | "golang.org/x/text/internal/gen" 13 | "golang.org/x/text/language" 14 | "golang.org/x/text/unicode/cldr" 15 | ) 16 | 17 | func main() { 18 | r := gen.OpenCLDRCoreZip() 19 | defer r.Close() 20 | 21 | d := &cldr.Decoder{} 22 | data, err := d.DecodeZip(r) 23 | if err != nil { 24 | log.Fatalf("DecodeZip: %v", err) 25 | } 26 | 27 | w := gen.NewCodeWriter() 28 | defer w.WriteGoFile("tables.go", "internal") 29 | 30 | // Create parents table. 31 | parents := make([]uint16, language.NumCompactTags) 32 | for _, loc := range data.Locales() { 33 | tag := language.MustParse(loc) 34 | index, ok := language.CompactIndex(tag) 35 | if !ok { 36 | continue 37 | } 38 | parentIndex := 0 // und 39 | for p := tag.Parent(); p != language.Und; p = p.Parent() { 40 | if x, ok := language.CompactIndex(p); ok { 41 | parentIndex = x 42 | break 43 | } 44 | } 45 | parents[index] = uint16(parentIndex) 46 | } 47 | 48 | w.WriteComment(` 49 | Parent maps a compact index of a tag to the compact index of the parent of 50 | this tag.`) 51 | w.WriteVar("Parent", parents) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/internal.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 | //go:generate go run gen.go 6 | 7 | // Package internal contains non-exported functionality that are used by 8 | // packages in the text repository. 9 | package internal // import "golang.org/x/text/internal" 10 | 11 | import ( 12 | "sort" 13 | 14 | "golang.org/x/text/language" 15 | ) 16 | 17 | // SortTags sorts tags in place. 18 | func SortTags(tags []language.Tag) { 19 | sort.Sort(sorter(tags)) 20 | } 21 | 22 | type sorter []language.Tag 23 | 24 | func (s sorter) Len() int { 25 | return len(s) 26 | } 27 | 28 | func (s sorter) Swap(i, j int) { 29 | s[i], s[j] = s[j], s[i] 30 | } 31 | 32 | func (s sorter) Less(i, j int) bool { 33 | return s[i].String() < s[j].String() 34 | } 35 | 36 | // UniqueTags sorts and filters duplicate tags in place and returns a slice with 37 | // only unique tags. 38 | func UniqueTags(tags []language.Tag) []language.Tag { 39 | if len(tags) <= 1 { 40 | return tags 41 | } 42 | SortTags(tags) 43 | k := 0 44 | for i := 1; i < len(tags); i++ { 45 | if tags[k].String() < tags[i].String() { 46 | k++ 47 | tags[k] = tags[i] 48 | } 49 | } 50 | return tags[:k+1] 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/Makefile: -------------------------------------------------------------------------------- 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 | CLEANFILES+=maketables 6 | 7 | maketables: maketables.go 8 | go build $^ 9 | 10 | tables: maketables 11 | ./maketables > tables.go 12 | gofmt -w -s tables.go 13 | 14 | # Build (but do not run) maketables during testing, 15 | # just to make sure it still compiles. 16 | testshort: maketables 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/common.go: -------------------------------------------------------------------------------- 1 | // This file was generated by go generate; DO NOT EDIT 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // langAliasType is the type of an alias in langAliasMap. 8 | type langAliasType int8 9 | 10 | const ( 11 | langDeprecated langAliasType = iota 12 | langMacro 13 | langLegacy 14 | 15 | langAliasTypeUnknown langAliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/gen_common.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 | // +build ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // langAliasType is the type of an alias in langAliasMap. 12 | type langAliasType int8 13 | 14 | const ( 15 | langDeprecated langAliasType = iota 16 | langMacro 17 | langLegacy 18 | 19 | langAliasTypeUnknown langAliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/doc.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 | // unicode holds packages with implementations of Unicode standards that are 6 | // mostly used as building blocks for other packages in golang.org/x/text, 7 | // layout engines, or are otherwise more low-level in nature. 8 | package unicode 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alexcesaro/quotedprintable.v3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alexandre Cesaro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alexcesaro/quotedprintable.v3/README.md: -------------------------------------------------------------------------------- 1 | # quotedprintable 2 | 3 | ## Introduction 4 | 5 | Package quotedprintable implements quoted-printable and message header encoding 6 | as specified by RFC 2045 and RFC 2047. 7 | 8 | It is a copy of the Go 1.5 package `mime/quotedprintable`. It also includes 9 | the new functions of package `mime` concerning RFC 2047. 10 | 11 | This code has minor changes with the standard library code in order to work 12 | with Go 1.0 and newer. 13 | 14 | ## Documentation 15 | 16 | https://godoc.org/gopkg.in/alexcesaro/quotedprintable.v3 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alexcesaro/quotedprintable.v3/pool.go: -------------------------------------------------------------------------------- 1 | // +build go1.3 2 | 3 | package quotedprintable 4 | 5 | import ( 6 | "bytes" 7 | "sync" 8 | ) 9 | 10 | var bufPool = sync.Pool{ 11 | New: func() interface{} { 12 | return new(bytes.Buffer) 13 | }, 14 | } 15 | 16 | func getBuffer() *bytes.Buffer { 17 | return bufPool.Get().(*bytes.Buffer) 18 | } 19 | 20 | func putBuffer(buf *bytes.Buffer) { 21 | if buf.Len() > 1024 { 22 | return 23 | } 24 | buf.Reset() 25 | bufPool.Put(buf) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/alexcesaro/quotedprintable.v3/pool_go12.go: -------------------------------------------------------------------------------- 1 | // +build !go1.3 2 | 3 | package quotedprintable 4 | 5 | import "bytes" 6 | 7 | var ch = make(chan *bytes.Buffer, 32) 8 | 9 | func getBuffer() *bytes.Buffer { 10 | select { 11 | case buf := <-ch: 12 | return buf 13 | default: 14 | } 15 | return new(bytes.Buffer) 16 | } 17 | 18 | func putBuffer(buf *bytes.Buffer) { 19 | buf.Reset() 20 | select { 21 | case ch <- buf: 22 | default: 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/asn1-ber.v1/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/gopkg.in/asn1-ber.v1?status.svg)](https://godoc.org/gopkg.in/asn1-ber.v1) [![Build Status](https://travis-ci.org/go-asn1-ber/asn1-ber.svg)](https://travis-ci.org/go-asn1-ber/asn1-ber) 2 | 3 | 4 | ASN1 BER Encoding / Decoding Library for the GO programming language. 5 | --------------------------------------------------------------------- 6 | 7 | Required libraries: 8 | None 9 | 10 | Working: 11 | Very basic encoding / decoding needed for LDAP protocol 12 | 13 | Tests Implemented: 14 | A few 15 | 16 | TODO: 17 | Fix all encoding / decoding to conform to ASN1 BER spec 18 | Implement Tests / Benchmarks 19 | 20 | --- 21 | 22 | The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/) 23 | The design is licensed under the Creative Commons 3.0 Attributions license. 24 | Read this article for more details: http://blog.golang.org/gopher 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/asn1-ber.v1/content_int.go: -------------------------------------------------------------------------------- 1 | package ber 2 | 3 | func encodeUnsignedInteger(i uint64) []byte { 4 | n := uint64Length(i) 5 | out := make([]byte, n) 6 | 7 | var j int 8 | for ; n > 0; n-- { 9 | out[j] = (byte(i >> uint((n-1)*8))) 10 | j++ 11 | } 12 | 13 | return out 14 | } 15 | 16 | func uint64Length(i uint64) (numBytes int) { 17 | numBytes = 1 18 | 19 | for i > 255 { 20 | numBytes++ 21 | i >>= 8 22 | } 23 | 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/asn1-ber.v1/header.go: -------------------------------------------------------------------------------- 1 | package ber 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | func readHeader(reader io.Reader) (identifier Identifier, length int, read int, err error) { 9 | if i, c, err := readIdentifier(reader); err != nil { 10 | return Identifier{}, 0, read, err 11 | } else { 12 | identifier = i 13 | read += c 14 | } 15 | 16 | if l, c, err := readLength(reader); err != nil { 17 | return Identifier{}, 0, read, err 18 | } else { 19 | length = l 20 | read += c 21 | } 22 | 23 | // Validate length type with identifier (x.600, 8.1.3.2.a) 24 | if length == LengthIndefinite && identifier.TagType == TypePrimitive { 25 | return Identifier{}, 0, read, errors.New("indefinite length used with primitive type") 26 | } 27 | 28 | return identifier, length, read, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/gopkg.in/asn1-ber.v1/util.go: -------------------------------------------------------------------------------- 1 | package ber 2 | 3 | import "io" 4 | 5 | func readByte(reader io.Reader) (byte, error) { 6 | bytes := make([]byte, 1, 1) 7 | _, err := io.ReadFull(reader, bytes) 8 | if err != nil { 9 | if err == io.EOF { 10 | return 0, io.ErrUnexpectedEOF 11 | } 12 | return 0, err 13 | } 14 | return bytes[0], nil 15 | } 16 | 17 | func isEOCPacket(p *Packet) bool { 18 | return p != nil && 19 | p.Tag == TagEOC && 20 | p.ClassType == ClassUniversal && 21 | p.TagType == TypePrimitive && 22 | len(p.ByteValue) == 0 && 23 | len(p.Children) == 0 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bufio.v1/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test gopkg.in/bufio.v1 3 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bufio.v1/README.md: -------------------------------------------------------------------------------- 1 | bufio 2 | ===== 3 | 4 | This is a fork of the http://golang.org/pkg/bufio/ package. It adds `ReadN` method that allows reading next `n` bytes from the internal buffer without allocating intermediate buffer. This method works just like the [Buffer.Next](http://golang.org/pkg/bytes/#Buffer.Next) method, but has slightly different signature. 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/editorconfig/editorconfig-core-go.v1/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | Copyright (c) 2016 The Editorconfig Team 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [2.0.0] - 2015-09-02 6 | 7 | - Mailer has been removed. It has been replaced by Dialer and Sender. 8 | - `File` type and the `CreateFile` and `OpenFile` functions have been removed. 9 | - `Message.Attach` and `Message.Embed` have a new signature. 10 | - `Message.GetBodyWriter` has been removed. Use `Message.AddAlternativeWriter` 11 | instead. 12 | - `Message.Export` has been removed. `Message.WriteTo` can be used instead. 13 | - `Message.DelHeader` has been removed. 14 | - The `Bcc` header field is no longer sent. It is far more simpler and 15 | efficient: the same message is sent to all recipients instead of sending a 16 | different email to each Bcc address. 17 | - LoginAuth has been removed. `NewPlainDialer` now implements the LOGIN 18 | authentication mechanism when needed. 19 | - Go 1.2 is now required instead of Go 1.3. No external dependency are used when 20 | using Go 1.5. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thank you for contributing to Gomail! Here are a few guidelines: 2 | 3 | ## Bugs 4 | 5 | If you think you found a bug, create an issue and supply the minimum amount 6 | of code triggering the bug so it can be reproduced. 7 | 8 | 9 | ## Fixing a bug 10 | 11 | If you want to fix a bug, you can send a pull request. It should contains a 12 | new test or update an existing one to cover that bug. 13 | 14 | 15 | ## New feature proposal 16 | 17 | If you think Gomail lacks a feature, you can open an issue or send a pull 18 | request. I want to keep Gomail code and API as simple as possible so please 19 | describe your needs so we can discuss whether this feature should be added to 20 | Gomail or not. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alexandre Cesaro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/auth.go: -------------------------------------------------------------------------------- 1 | package gomail 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "fmt" 7 | "net/smtp" 8 | ) 9 | 10 | // loginAuth is an smtp.Auth that implements the LOGIN authentication mechanism. 11 | type loginAuth struct { 12 | username string 13 | password string 14 | host string 15 | } 16 | 17 | func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { 18 | if !server.TLS { 19 | advertised := false 20 | for _, mechanism := range server.Auth { 21 | if mechanism == "LOGIN" { 22 | advertised = true 23 | break 24 | } 25 | } 26 | if !advertised { 27 | return "", nil, errors.New("gomail: unencrypted connection") 28 | } 29 | } 30 | if server.Name != a.host { 31 | return "", nil, errors.New("gomail: wrong host name") 32 | } 33 | return "LOGIN", nil, nil 34 | } 35 | 36 | func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 37 | if !more { 38 | return nil, nil 39 | } 40 | 41 | switch { 42 | case bytes.Equal(fromServer, []byte("Username:")): 43 | return []byte(a.username), nil 44 | case bytes.Equal(fromServer, []byte("Password:")): 45 | return []byte(a.password), nil 46 | default: 47 | return nil, fmt.Errorf("gomail: unexpected server challenge: %s", fromServer) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package gomail provides a simple interface to compose emails and to mail them 2 | // efficiently. 3 | // 4 | // More info on Github: https://github.com/go-gomail/gomail 5 | package gomail 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package gomail 4 | 5 | import ( 6 | "mime" 7 | "mime/quotedprintable" 8 | "strings" 9 | ) 10 | 11 | var newQPWriter = quotedprintable.NewWriter 12 | 13 | type mimeEncoder struct { 14 | mime.WordEncoder 15 | } 16 | 17 | var ( 18 | bEncoding = mimeEncoder{mime.BEncoding} 19 | qEncoding = mimeEncoder{mime.QEncoding} 20 | lastIndexByte = strings.LastIndexByte 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime_go14.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package gomail 4 | 5 | import "gopkg.in/alexcesaro/quotedprintable.v3" 6 | 7 | var newQPWriter = quotedprintable.NewWriter 8 | 9 | type mimeEncoder struct { 10 | quotedprintable.WordEncoder 11 | } 12 | 13 | var ( 14 | bEncoding = mimeEncoder{quotedprintable.BEncoding} 15 | qEncoding = mimeEncoder{quotedprintable.QEncoding} 16 | lastIndexByte = func(s string, c byte) int { 17 | for i := len(s) - 1; i >= 0; i-- { 18 | 19 | if s[i] == c { 20 | return i 21 | } 22 | } 23 | return -1 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ldap.v2/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: default install build test quicktest fmt vet lint 2 | 3 | default: fmt vet lint build quicktest 4 | 5 | install: 6 | go get -t -v ./... 7 | 8 | build: 9 | go build -v ./... 10 | 11 | test: 12 | go test -v -cover ./... 13 | 14 | quicktest: 15 | go test ./... 16 | 17 | # Capture output and force failure when there is non-empty output 18 | fmt: 19 | @echo gofmt -l . 20 | @OUTPUT=`gofmt -l . 2>&1`; \ 21 | if [ "$$OUTPUT" ]; then \ 22 | echo "gofmt must be run on the following files:"; \ 23 | echo "$$OUTPUT"; \ 24 | exit 1; \ 25 | fi 26 | 27 | # Only run on go1.5+ 28 | vet: 29 | go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult . 30 | 31 | # https://github.com/golang/lint 32 | # go get github.com/golang/lint/golint 33 | # Capture output and force failure when there is non-empty output 34 | # Only run on go1.5+ 35 | lint: 36 | @echo golint ./... 37 | @OUTPUT=`golint ./... 2>&1`; \ 38 | if [ "$$OUTPUT" ]; then \ 39 | echo "golint errors:"; \ 40 | echo "$$OUTPUT"; \ 41 | exit 1; \ 42 | fi 43 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ldap.v2/client.go: -------------------------------------------------------------------------------- 1 | package ldap 2 | 3 | import ( 4 | "crypto/tls" 5 | "time" 6 | ) 7 | 8 | // Client knows how to interact with an LDAP server 9 | type Client interface { 10 | Start() 11 | StartTLS(config *tls.Config) error 12 | Close() 13 | SetTimeout(time.Duration) 14 | 15 | Bind(username, password string) error 16 | SimpleBind(simpleBindRequest *SimpleBindRequest) (*SimpleBindResult, error) 17 | 18 | Add(addRequest *AddRequest) error 19 | Del(delRequest *DelRequest) error 20 | Modify(modifyRequest *ModifyRequest) error 21 | 22 | Compare(dn, attribute, value string) (bool, error) 23 | PasswordModify(passwordModifyRequest *PasswordModifyRequest) (*PasswordModifyResult, error) 24 | 25 | Search(searchRequest *SearchRequest) (*SearchResult, error) 26 | SearchWithPaging(searchRequest *SearchRequest, pagingSize uint32) (*SearchResult, error) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ldap.v2/debug.go: -------------------------------------------------------------------------------- 1 | package ldap 2 | 3 | import ( 4 | "log" 5 | 6 | "gopkg.in/asn1-ber.v1" 7 | ) 8 | 9 | // debbuging type 10 | // - has a Printf method to write the debug output 11 | type debugging bool 12 | 13 | // write debug output 14 | func (debug debugging) Printf(format string, args ...interface{}) { 15 | if debug { 16 | log.Printf(format, args...) 17 | } 18 | } 19 | 20 | func (debug debugging) PrintPacket(packet *ber.Packet) { 21 | if debug { 22 | ber.PrintPacket(packet) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ldap.v2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package ldap provides basic LDAP v3 functionality. 3 | */ 4 | package ldap 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/macaron.v1/macaronlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabric8io/docker-gogs/c546b8b9a5db9e6dab8e3a7b40e5b18034b168a4/vendor/gopkg.in/macaron.v1/macaronlogo.png -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test gopkg.in/redis.v2 -cpu=1,2,4 3 | go test gopkg.in/redis.v2 -short -race 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package redis implements a Redis client. 3 | */ 4 | package redis 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/error.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Redis nil reply. 8 | var Nil = errorf("redis: nil") 9 | 10 | // Redis transaction failed. 11 | var TxFailedErr = errorf("redis: transaction failed") 12 | 13 | type redisError struct { 14 | s string 15 | } 16 | 17 | func errorf(s string, args ...interface{}) redisError { 18 | return redisError{s: fmt.Sprintf(s, args...)} 19 | } 20 | 21 | func (err redisError) Error() string { 22 | return err.s 23 | } 24 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/rate_limit.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "sync/atomic" 5 | "time" 6 | ) 7 | 8 | type rateLimiter struct { 9 | v int64 10 | 11 | _closed int64 12 | } 13 | 14 | func newRateLimiter(limit time.Duration, bucketSize int) *rateLimiter { 15 | rl := &rateLimiter{ 16 | v: int64(bucketSize), 17 | } 18 | go rl.loop(limit, int64(bucketSize)) 19 | return rl 20 | } 21 | 22 | func (rl *rateLimiter) loop(limit time.Duration, bucketSize int64) { 23 | for { 24 | if rl.closed() { 25 | break 26 | } 27 | if v := atomic.LoadInt64(&rl.v); v < bucketSize { 28 | atomic.AddInt64(&rl.v, 1) 29 | } 30 | time.Sleep(limit) 31 | } 32 | } 33 | 34 | func (rl *rateLimiter) Check() bool { 35 | for { 36 | if v := atomic.LoadInt64(&rl.v); v > 0 { 37 | if atomic.CompareAndSwapInt64(&rl.v, v, v-1) { 38 | return true 39 | } 40 | } else { 41 | return false 42 | } 43 | } 44 | } 45 | 46 | func (rl *rateLimiter) Close() error { 47 | atomic.StoreInt64(&rl._closed, 1) 48 | return nil 49 | } 50 | 51 | func (rl *rateLimiter) closed() bool { 52 | return atomic.LoadInt64(&rl._closed) == 1 53 | } 54 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v2/script.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | "io" 7 | "strings" 8 | ) 9 | 10 | type scripter interface { 11 | Eval(script string, keys []string, args []string) *Cmd 12 | EvalSha(sha1 string, keys []string, args []string) *Cmd 13 | ScriptExists(scripts ...string) *BoolSliceCmd 14 | ScriptLoad(script string) *StringCmd 15 | } 16 | 17 | type Script struct { 18 | src, hash string 19 | } 20 | 21 | func NewScript(src string) *Script { 22 | h := sha1.New() 23 | io.WriteString(h, src) 24 | return &Script{ 25 | src: src, 26 | hash: hex.EncodeToString(h.Sum(nil)), 27 | } 28 | } 29 | 30 | func (s *Script) Load(c scripter) *StringCmd { 31 | return c.ScriptLoad(s.src) 32 | } 33 | 34 | func (s *Script) Exists(c scripter) *BoolSliceCmd { 35 | return c.ScriptExists(s.src) 36 | } 37 | 38 | func (s *Script) Eval(c scripter, keys []string, args []string) *Cmd { 39 | return c.Eval(s.src, keys, args) 40 | } 41 | 42 | func (s *Script) EvalSha(c scripter, keys []string, args []string) *Cmd { 43 | return c.EvalSha(s.hash, keys, args) 44 | } 45 | 46 | func (s *Script) Run(c *Client, keys []string, args []string) *Cmd { 47 | r := s.EvalSha(c, keys, args) 48 | if err := r.Err(); err != nil && strings.HasPrefix(err.Error(), "NOSCRIPT ") { 49 | return s.Eval(c, keys, args) 50 | } 51 | return r 52 | } 53 | --------------------------------------------------------------------------------