Full Code of gohade/coredemo for AI

main efdbf2b0eec6 cached
412 files
69.7 MB
7.0M tokens
2214 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (28,222K chars total). Download the full file to get everything.
Repository: gohade/coredemo
Branch: main
Commit: efdbf2b0eec6
Files: 412
Total size: 69.7 MB

Directory structure:
gitextract_noppvudh/

├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── app/
│   ├── console/
│   │   ├── command/
│   │   │   └── foo/
│   │   │       └── foo.go
│   │   └── kernel.go
│   ├── http/
│   │   ├── kernel.go
│   │   ├── middleware/
│   │   │   ├── .gitkeeper
│   │   │   └── cors/
│   │   │       ├── .github/
│   │   │       │   └── workflows/
│   │   │       │       └── go.yml
│   │   │       ├── .gitignore
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── config.go
│   │   │       ├── cors.go
│   │   │       ├── cors_test.go
│   │   │       ├── examples/
│   │   │       │   └── example.go
│   │   │       └── utils.go
│   │   ├── module/
│   │   │   └── demo/
│   │   │       ├── api.go
│   │   │       ├── api_cache.go
│   │   │       ├── api_orm.go
│   │   │       ├── dto.go
│   │   │       ├── mapper.go
│   │   │       ├── model.go
│   │   │       ├── repository.go
│   │   │       └── service.go
│   │   ├── route.go
│   │   ├── swagger/
│   │   │   ├── docs.go
│   │   │   ├── swagger.json
│   │   │   └── swagger.yaml
│   │   └── swagger.go
│   └── provider/
│       ├── demo/
│       │   ├── contract.go
│       │   ├── provider.go
│       │   └── service.go
│       └── user/
│           ├── contract.go
│           ├── provider.go
│           └── service.go
├── build/
│   ├── build.js
│   ├── check-versions.js
│   ├── utils.js
│   ├── vue-loader.conf.js
│   ├── webpack.base.conf.js
│   ├── webpack.dev.conf.js
│   └── webpack.prod.conf.js
├── config/
│   ├── dev.env.js
│   ├── development/
│   │   ├── app.yaml
│   │   ├── database.yaml
│   │   ├── deploy.yaml
│   │   ├── log.yaml
│   │   └── ssh.yaml
│   ├── index.js
│   ├── prod.env.js
│   ├── production/
│   │   ├── .gitkeeper
│   │   ├── app.yaml
│   │   ├── database.yaml
│   │   ├── deploy.yaml
│   │   ├── gift.yaml
│   │   ├── log.yaml
│   │   └── swagger.yaml
│   ├── test.env.js
│   └── testing/
│       ├── app.yaml
│       ├── cache.yaml
│       ├── database.yaml
│       ├── deploy.yaml
│       ├── log.yaml
│       ├── redis.yaml
│       ├── ssh.yaml
│       └── swagger.yaml
├── docs/
│   ├── .vuepress/
│   │   ├── config.js
│   │   └── enhanceApp.js
│   ├── README.md
│   ├── guide/
│   │   ├── README.md
│   │   ├── app.md
│   │   ├── build.md
│   │   ├── command.md
│   │   ├── cron.md
│   │   ├── dev.md
│   │   ├── env.md
│   │   ├── install.md
│   │   ├── introduce.md
│   │   ├── middleware.md
│   │   ├── provider.md
│   │   ├── structure.md
│   │   ├── swagger.md
│   │   └── todo.md
│   └── provider/
│       ├── README.md
│       ├── app.md
│       ├── config.md
│       ├── env.md
│       └── log.md
├── framework/
│   ├── cobra/
│   │   ├── .gitignore
│   │   ├── .golangci.yml
│   │   ├── .mailmap
│   │   ├── CHANGELOG.md
│   │   ├── CONDUCT.md
│   │   ├── CONTRIBUTING.md
│   │   ├── LICENSE.txt
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── args.go
│   │   ├── args_test.go
│   │   ├── bash_completions.go
│   │   ├── bash_completions.md
│   │   ├── bash_completionsV2.go
│   │   ├── bash_completions_test.go
│   │   ├── cobra/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── cmd/
│   │   │   │   ├── add.go
│   │   │   │   ├── add_test.go
│   │   │   │   ├── golden_test.go
│   │   │   │   ├── helpers.go
│   │   │   │   ├── helpers_test.go
│   │   │   │   ├── init.go
│   │   │   │   ├── init_test.go
│   │   │   │   ├── license_agpl.go
│   │   │   │   ├── license_apache_2.go
│   │   │   │   ├── license_bsd_clause_2.go
│   │   │   │   ├── license_bsd_clause_3.go
│   │   │   │   ├── license_gpl_2.go
│   │   │   │   ├── license_gpl_3.go
│   │   │   │   ├── license_lgpl.go
│   │   │   │   ├── license_mit.go
│   │   │   │   ├── licenses.go
│   │   │   │   ├── project.go
│   │   │   │   ├── project_test.go
│   │   │   │   ├── root.go
│   │   │   │   └── testdata/
│   │   │   │       ├── LICENSE.golden
│   │   │   │       ├── main.go.golden
│   │   │   │       ├── root.go.golden
│   │   │   │       └── test.go.golden
│   │   │   ├── main.go
│   │   │   └── tpl/
│   │   │       └── main.go
│   │   ├── cobra.go
│   │   ├── cobra_test.go
│   │   ├── command.go
│   │   ├── command_notwin.go
│   │   ├── command_test.go
│   │   ├── command_win.go
│   │   ├── completions.go
│   │   ├── completions_test.go
│   │   ├── doc/
│   │   │   ├── README.md
│   │   │   ├── cmd_test.go
│   │   │   ├── man_docs.go
│   │   │   ├── man_docs.md
│   │   │   ├── man_docs_test.go
│   │   │   ├── man_examples_test.go
│   │   │   ├── md_docs.go
│   │   │   ├── md_docs.md
│   │   │   ├── md_docs_test.go
│   │   │   ├── rest_docs.go
│   │   │   ├── rest_docs.md
│   │   │   ├── rest_docs_test.go
│   │   │   ├── util.go
│   │   │   ├── yaml_docs.go
│   │   │   ├── yaml_docs.md
│   │   │   └── yaml_docs_test.go
│   │   ├── fish_completions.go
│   │   ├── fish_completions.md
│   │   ├── fish_completions_test.go
│   │   ├── hade_command.go
│   │   ├── hade_command_contract.go
│   │   ├── hade_command_distributed.go
│   │   ├── powershell_completions.go
│   │   ├── powershell_completions.md
│   │   ├── projects_using_cobra.md
│   │   ├── shell_completions.go
│   │   ├── shell_completions.md
│   │   ├── user_guide.md
│   │   ├── zsh_completions.go
│   │   └── zsh_completions.md
│   ├── command/
│   │   ├── app.go
│   │   ├── build.go
│   │   ├── cmd.go
│   │   ├── config.go
│   │   ├── cron.go
│   │   ├── deploy.go
│   │   ├── dev.go
│   │   ├── env.go
│   │   ├── go_cmd.go
│   │   ├── go_cmd_test.go
│   │   ├── help.go
│   │   ├── kernel.go
│   │   ├── middleware.go
│   │   ├── new.go
│   │   ├── npm.go
│   │   ├── provider.go
│   │   └── swagger.go
│   ├── container.go
│   ├── contract/
│   │   ├── app.go
│   │   ├── cache.go
│   │   ├── config.go
│   │   ├── distributed.go
│   │   ├── env.go
│   │   ├── id.go
│   │   ├── kernel.go
│   │   ├── log.go
│   │   ├── orm.go
│   │   ├── redis.go
│   │   ├── ssh.go
│   │   └── trace.go
│   ├── gin/
│   │   ├── .github/
│   │   │   ├── ISSUE_TEMPLATE.md
│   │   │   └── PULL_REQUEST_TEMPLATE.md
│   │   ├── .gitignore
│   │   ├── .travis.yml
│   │   ├── AUTHORS.md
│   │   ├── BENCHMARKS.md
│   │   ├── CHANGELOG.md
│   │   ├── CODE_OF_CONDUCT.md
│   │   ├── CONTRIBUTING.md
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── auth.go
│   │   ├── auth_test.go
│   │   ├── benchmarks_test.go
│   │   ├── binding/
│   │   │   ├── binding.go
│   │   │   ├── binding_msgpack_test.go
│   │   │   ├── binding_nomsgpack.go
│   │   │   ├── binding_test.go
│   │   │   ├── default_validator.go
│   │   │   ├── default_validator_test.go
│   │   │   ├── form.go
│   │   │   ├── form_mapping.go
│   │   │   ├── form_mapping_benchmark_test.go
│   │   │   ├── form_mapping_test.go
│   │   │   ├── header.go
│   │   │   ├── json.go
│   │   │   ├── json_test.go
│   │   │   ├── msgpack.go
│   │   │   ├── msgpack_test.go
│   │   │   ├── multipart_form_mapping.go
│   │   │   ├── multipart_form_mapping_test.go
│   │   │   ├── protobuf.go
│   │   │   ├── query.go
│   │   │   ├── uri.go
│   │   │   ├── validate_test.go
│   │   │   ├── xml.go
│   │   │   ├── xml_test.go
│   │   │   ├── yaml.go
│   │   │   └── yaml_test.go
│   │   ├── codecov.yml
│   │   ├── context.go
│   │   ├── context_appengine.go
│   │   ├── context_test.go
│   │   ├── debug.go
│   │   ├── debug_test.go
│   │   ├── deprecated.go
│   │   ├── deprecated_test.go
│   │   ├── doc.go
│   │   ├── errors.go
│   │   ├── errors_1.13_test.go
│   │   ├── errors_test.go
│   │   ├── examples/
│   │   │   └── README.md
│   │   ├── fs.go
│   │   ├── gin.go
│   │   ├── ginS/
│   │   │   ├── README.md
│   │   │   └── gins.go
│   │   ├── gin_integration_test.go
│   │   ├── gin_test.go
│   │   ├── githubapi_test.go
│   │   ├── hade_context.go
│   │   ├── hade_context_contract.go
│   │   ├── hade_engine.go
│   │   ├── hade_request.go
│   │   ├── hade_response.go
│   │   ├── internal/
│   │   │   ├── bytesconv/
│   │   │   │   ├── bytesconv.go
│   │   │   │   └── bytesconv_test.go
│   │   │   └── json/
│   │   │       ├── json.go
│   │   │       └── jsoniter.go
│   │   ├── logger.go
│   │   ├── logger_test.go
│   │   ├── middleware_test.go
│   │   ├── mode.go
│   │   ├── mode_test.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   ├── recovery.go
│   │   ├── recovery_test.go
│   │   ├── render/
│   │   │   ├── data.go
│   │   │   ├── html.go
│   │   │   ├── json.go
│   │   │   ├── msgpack.go
│   │   │   ├── protobuf.go
│   │   │   ├── reader.go
│   │   │   ├── reader_test.go
│   │   │   ├── redirect.go
│   │   │   ├── render.go
│   │   │   ├── render_msgpack_test.go
│   │   │   ├── render_test.go
│   │   │   ├── text.go
│   │   │   ├── xml.go
│   │   │   └── yaml.go
│   │   ├── response_writer.go
│   │   ├── response_writer_test.go
│   │   ├── routergroup.go
│   │   ├── routergroup_test.go
│   │   ├── routes_test.go
│   │   ├── test_helpers.go
│   │   ├── testdata/
│   │   │   ├── certificate/
│   │   │   │   ├── cert.pem
│   │   │   │   └── key.pem
│   │   │   ├── protoexample/
│   │   │   │   ├── test.pb.go
│   │   │   │   └── test.proto
│   │   │   └── template/
│   │   │       ├── hello.tmpl
│   │   │       └── raw.tmpl
│   │   ├── tree.go
│   │   ├── tree_test.go
│   │   ├── utils.go
│   │   ├── utils_test.go
│   │   └── version.go
│   ├── middleware/
│   │   ├── cost.go
│   │   ├── gin-swagger/
│   │   │   ├── .gitignore
│   │   │   ├── .travis.yml
│   │   │   ├── LICENSE
│   │   │   ├── README.md
│   │   │   ├── b0x.yml
│   │   │   ├── swagger.go
│   │   │   ├── swaggerFiles/
│   │   │   │   ├── ab0x.go
│   │   │   │   ├── b0xfile__favicon-16x16.png.go
│   │   │   │   ├── b0xfile__favicon-32x32.png.go
│   │   │   │   ├── b0xfile__index.html.go
│   │   │   │   ├── b0xfile__oauth2-redirect.html.go
│   │   │   │   ├── b0xfile__swagger-ui-bundle.js.go
│   │   │   │   ├── b0xfile__swagger-ui-bundle.js.map.go
│   │   │   │   ├── b0xfile__swagger-ui-standalone-preset.js.go
│   │   │   │   ├── b0xfile__swagger-ui-standalone-preset.js.map.go
│   │   │   │   ├── b0xfile__swagger-ui.css.go
│   │   │   │   ├── b0xfile__swagger-ui.css.map.go
│   │   │   │   ├── b0xfile__swagger-ui.js.go
│   │   │   │   └── b0xfile__swagger-ui.js.map.go
│   │   │   └── swagger_test.go
│   │   ├── static/
│   │   │   ├── LICENCE.md
│   │   │   └── static.go
│   │   ├── timeout.go
│   │   └── trace.go
│   ├── provider/
│   │   ├── app/
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── cache/
│   │   │   ├── provider.go
│   │   │   └── services/
│   │   │       ├── cache.go
│   │   │       ├── memory.go
│   │   │       ├── memory_test.go
│   │   │       ├── redis.go
│   │   │       └── redis_test.go
│   │   ├── config/
│   │   │   ├── fake_provider.go
│   │   │   ├── fake_service.go
│   │   │   ├── provider.go
│   │   │   ├── provider_test.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   ├── distributed/
│   │   │   ├── provider_local.go
│   │   │   └── service_local.go
│   │   ├── env/
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   ├── testing_provider.go
│   │   │   └── testing_service.go
│   │   ├── id/
│   │   │   ├── provider.go
│   │   │   ├── provier_test.go
│   │   │   └── service.go
│   │   ├── kernel/
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── log/
│   │   │   ├── formatter/
│   │   │   │   ├── json.go
│   │   │   │   ├── prefix.go
│   │   │   │   └── text.go
│   │   │   ├── provider.go
│   │   │   └── services/
│   │   │       ├── console.go
│   │   │       ├── custom.go
│   │   │       ├── log.go
│   │   │       ├── rotate.go
│   │   │       └── single.go
│   │   ├── orm/
│   │   │   ├── config.go
│   │   │   ├── config_test.go
│   │   │   ├── logger.go
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── redis/
│   │   │   ├── config.go
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   ├── ssh/
│   │   │   ├── config.go
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   └── trace/
│   │       ├── provider.go
│   │       └── service.go
│   ├── provider.go
│   └── util/
│       ├── console.go
│       ├── console_test.go
│       ├── exec.go
│       ├── file.go
│       ├── http.go
│       └── zip.go
├── go.mod
├── go.sum
├── index.html
├── main.go
├── package.json
├── src/
│   ├── App.vue
│   ├── components/
│   │   └── HelloWorld.vue
│   ├── main.js
│   └── router/
│       └── index.js
├── static/
│   └── .gitkeep
└── test/
    ├── e2e/
    │   ├── custom-assertions/
    │   │   └── elementCount.js
    │   ├── nightwatch.conf.js
    │   ├── runner.js
    │   └── specs/
    │       └── test.js
    ├── env.go
    └── unit/
        ├── .eslintrc
        ├── jest.conf.js
        ├── setup.js
        └── specs/
            └── HelloWorld.spec.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
      }
    }],
    "stage-2"
  ],
  "plugins": ["transform-vue-jsx", "transform-runtime"],
  "env": {
    "test": {
      "presets": ["env", "stage-2"],
      "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
    }
  }
}


================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true


================================================
FILE: .eslintignore
================================================
/build/
/config/
/dist/
/*.js
/test/unit/coverage/


================================================
FILE: .eslintrc.js
================================================
// https://eslint.org/docs/user-guide/configuring

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint'
  },
  env: {
    browser: true,
  },
  extends: [
    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
    'plugin:vue/essential',
    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
    'standard'
  ],
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    "space-before-function-paren": 0
  }
}


================================================
FILE: .gitignore
================================================
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
hade
storage
/deploy/

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln


================================================
FILE: .postcssrc.js
================================================
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
  "plugins": {
    "postcss-import": {},
    "postcss-url": {},
    // to edit target browsers: use "browserslist" field in package.json
    "autoprefixer": {}
  }
}


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2021 jianfengye

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:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

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.

================================================
FILE: README.md
================================================
# 官方网站

http://hade.funaio.cn/

# 框架特色:

## 基于协议

服务与服务间的协议是基于协议进行交互的。

## 前后端协同

前后端协同开发

## 命令行

有充分的命令行工具

## 集成定时服务

如果你需要启动定时服务,提供命令进行定时服务的启动

## 文档丰富

提供丰富的文档说明,提供丰富的文档说明

## 开发模式

在开发模式下进行前后端开发,极大提高了开发效率和开发体验

## 使用指南

[介绍](docs/guide/introduce.md)

[安装](docs/guide/install.md)

[编译](docs/guide/build.md)

[目录结构](docs/guide/structure.md)

[运行](docs/guide/app.md)

[环境变量](docs/guide/env.md)

[调试模式](docs/guide/dev.md)

[命令](docs/guide/command.md)

[定时任务](docs/guide/cron.md)

[中间件](docs/guide/middleware.md)

[swagger](docs/guide/swagger.md)

[服务提供者](docs/guide/provider.md)

[待做事项](docs/guide/todo.md)




================================================
FILE: app/console/command/foo/foo.go
================================================
package foo

import (
	"fmt"

	"github.com/gohade/hade/framework/cobra"
)

var FooCommand = &cobra.Command{
	Use:   "foo",
	Short: "foo",
	RunE: func(c *cobra.Command, args []string) error {
        container := c.GetContainer()
		fmt.Println(container)
		return nil
	},
}



================================================
FILE: app/console/kernel.go
================================================
package console

import (
    "github.com/gohade/hade/app/console/command/foo"
    "github.com/gohade/hade/framework"
    "github.com/gohade/hade/framework/cobra"
    "github.com/gohade/hade/framework/command"
)

// RunCommand  初始化根Command并运行
func RunCommand(container framework.Container) error {
    // 根Command
    var rootCmd = &cobra.Command{
        // 定义根命令的关键字
        Use: "hade",
        // 简短介绍
        Short: "hade 命令",
        // 根命令的详细介绍
        Long: "hade 框架提供的命令行工具,使用这个命令行工具能很方便执行框架自带命令,也能很方便编写业务命令",
        // 根命令的执行函数
        RunE: func(cmd *cobra.Command, args []string) error {
            cmd.InitDefaultHelpFlag()
            return cmd.Help()
        },
        // 不需要出现cobra默认的completion子命令
        CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
    }

    // 为根Command设置服务容器
    rootCmd.SetContainer(container)
    // 绑定框架的命令
    command.AddKernelCommands(rootCmd)
    // 绑定业务的命令
    AddAppCommand(rootCmd)

    // 执行RootCommand
    return rootCmd.Execute()
}

// 绑定业务的命令
func AddAppCommand(rootCmd *cobra.Command) {

    rootCmd.AddCommand(foo.FooCommand)
    // 每秒调用一次Foo命令
    //rootCmd.AddCronCommand("* * * * * *", demo.FooCommand)

    // 启动一个分布式任务调度,调度的服务名称为init_func_for_test,每个节点每5s调用一次Foo命令,抢占到了调度任务的节点将抢占锁持续挂载2s才释放
    //rootCmd.AddDistributedCronCommand("foo_func_for_test", "*/5 * * * * *", demo.FooCommand, 2*time.Second)
}


================================================
FILE: app/http/kernel.go
================================================
package http

import (
	"github.com/gohade/hade/framework"
	"github.com/gohade/hade/framework/gin"
)

// NewHttpEngine 创建了一个绑定了路由的Web引擎
func NewHttpEngine(container framework.Container) (*gin.Engine, error) {
	// 设置为Release,为的是默认在启动中不输出调试信息
	gin.SetMode(gin.ReleaseMode)
	// 默认启动一个Web引擎
	r := gin.New()
	// 设置了Engine
	r.SetContainer(container)

	// 默认注册recovery中间件
	r.Use(gin.Recovery())

	// 业务绑定路由操作
	Routes(r)
	// 返回绑定路由后的Web引擎
	return r, nil
}


================================================
FILE: app/http/middleware/.gitkeeper
================================================


================================================
FILE: app/http/middleware/cors/.github/workflows/go.yml
================================================
name: Run Tests

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: '^1.16'
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Setup golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: v1.42.1
          args: --verbose
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        go: [1.13, 1.14, 1.15, 1.16, 1.17]
        include:
          - os: ubuntu-latest
            go-build: ~/.cache/go-build
          - os: macos-latest
            go-build: ~/Library/Caches/go-build
    name: ${{ matrix.os }} @ Go ${{ matrix.go }}
    runs-on: ${{ matrix.os }}
    env:
      GO111MODULE: on
      GOPROXY: https://proxy.golang.org
    steps:
      - name: Set up Go ${{ matrix.go }}
        uses: actions/setup-go@v2
        with:
          go-version: ${{ matrix.go }}

      - name: Checkout Code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}

      - uses: actions/cache@v2
        with:
          path: |
            ${{ matrix.go-build }}
            ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-
      - name: Run Tests
        run: |
          go test -v -covermode=atomic -coverprofile=coverage.out

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v2
        with:
          flags: ${{ matrix.os }},go-${{ matrix.go }}


================================================
FILE: app/http/middleware/cors/.gitignore
================================================
*.o
*.a
*.so

_obj
_test

*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof

coverage.out


================================================
FILE: app/http/middleware/cors/LICENSE
================================================
MIT License

Copyright (c) 2016 Gin-Gonic

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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.


================================================
FILE: app/http/middleware/cors/README.md
================================================
# CORS gin's middleware

[![Run Tests](https://github.com/gin-contrib/cors/actions/workflows/go.yml/badge.svg)](https://github.com/gin-contrib/cors/actions/workflows/go.yml)
[![codecov](https://codecov.io/gh/gin-contrib/cors/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/cors)
[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/cors)](https://goreportcard.com/report/github.com/gin-contrib/cors)
[![GoDoc](https://godoc.org/github.com/gin-contrib/cors?status.svg)](https://godoc.org/github.com/gin-contrib/cors)

Gin middleware/handler to enable CORS support.

## Usage

### Start using it

Download and install it:

```sh
go get github.com/gin-contrib/cors
```

Import it in your code:

```go
import "github.com/gin-contrib/cors"
```

### Canonical example

```go
package main

import (
  "time"

  "github.com/gin-contrib/cors"
  "github.com/gin-gonic/gin"
)

func main() {
  router := gin.Default()
  // CORS for https://foo.com and https://github.com origins, allowing:
  // - PUT and PATCH methods
  // - Origin header
  // - Credentials share
  // - Preflight requests cached for 12 hours
  router.Use(cors.New(cors.Config{
    AllowOrigins:     []string{"https://foo.com"},
    AllowMethods:     []string{"PUT", "PATCH"},
    AllowHeaders:     []string{"Origin"},
    ExposeHeaders:    []string{"Content-Length"},
    AllowCredentials: true,
    AllowOriginFunc: func(origin string) bool {
      return origin == "https://github.com"
    },
    MaxAge: 12 * time.Hour,
  }))
  router.Run()
}
```

### Using DefaultConfig as start point

```go
func main() {
  router := gin.Default()
  // - No origin allowed by default
  // - GET,POST, PUT, HEAD methods
  // - Credentials share disabled
  // - Preflight requests cached for 12 hours
  config := cors.DefaultConfig()
  config.AllowOrigins = []string{"http://google.com"}
  // config.AllowOrigins == []string{"http://google.com", "http://facebook.com"}

  router.Use(cors.New(config))
  router.Run()
}
```

### Default() allows all origins

```go
func main() {
  router := gin.Default()
  // same as
  // config := cors.DefaultConfig()
  // config.AllowAllOrigins = true
  // router.Use(cors.New(config))
  router.Use(cors.Default())
  router.Run()
}
```


================================================
FILE: app/http/middleware/cors/config.go
================================================
package cors

import (
	"net/http"
	"strings"

	"github.com/gohade/hade/framework/gin"
)

type cors struct {
	allowAllOrigins  bool
	allowCredentials bool
	allowOriginFunc  func(string) bool
	allowOrigins     []string
	normalHeaders    http.Header
	preflightHeaders http.Header
	wildcardOrigins  [][]string
}

var (
	DefaultSchemas = []string{
		"http://",
		"https://",
	}
	ExtensionSchemas = []string{
		"chrome-extension://",
		"safari-extension://",
		"moz-extension://",
		"ms-browser-extension://",
	}
	FileSchemas = []string{
		"file://",
	}
	WebSocketSchemas = []string{
		"ws://",
		"wss://",
	}
)

func newCors(config Config) *cors {
	if err := config.Validate(); err != nil {
		panic(err.Error())
	}

	for _, origin := range config.AllowOrigins {
		if origin == "*" {
			config.AllowAllOrigins = true
		}
	}

	return &cors{
		allowOriginFunc:  config.AllowOriginFunc,
		allowAllOrigins:  config.AllowAllOrigins,
		allowCredentials: config.AllowCredentials,
		allowOrigins:     normalize(config.AllowOrigins),
		normalHeaders:    generateNormalHeaders(config),
		preflightHeaders: generatePreflightHeaders(config),
		wildcardOrigins:  config.parseWildcardRules(),
	}
}

func (cors *cors) applyCors(c *gin.Context) {
	origin := c.Request.Header.Get("Origin")
	if len(origin) == 0 {
		// request is not a CORS request
		return
	}
	host := c.Request.Host

	if origin == "http://"+host || origin == "https://"+host {
		// request is not a CORS request but have origin header.
		// for example, use fetch api
		return
	}

	if !cors.validateOrigin(origin) {
		c.AbortWithStatus(http.StatusForbidden)
		return
	}

	if c.Request.Method == "OPTIONS" {
		cors.handlePreflight(c)
		defer c.AbortWithStatus(http.StatusNoContent) // Using 204 is better than 200 when the request status is OPTIONS
	} else {
		cors.handleNormal(c)
	}

	if !cors.allowAllOrigins {
		c.Header("Access-Control-Allow-Origin", origin)
	}
}

func (cors *cors) validateWildcardOrigin(origin string) bool {
	for _, w := range cors.wildcardOrigins {
		if w[0] == "*" && strings.HasSuffix(origin, w[1]) {
			return true
		}
		if w[1] == "*" && strings.HasPrefix(origin, w[0]) {
			return true
		}
		if strings.HasPrefix(origin, w[0]) && strings.HasSuffix(origin, w[1]) {
			return true
		}
	}

	return false
}

func (cors *cors) validateOrigin(origin string) bool {
	if cors.allowAllOrigins {
		return true
	}
	for _, value := range cors.allowOrigins {
		if value == origin {
			return true
		}
	}
	if len(cors.wildcardOrigins) > 0 && cors.validateWildcardOrigin(origin) {
		return true
	}
	if cors.allowOriginFunc != nil {
		return cors.allowOriginFunc(origin)
	}
	return false
}

func (cors *cors) handlePreflight(c *gin.Context) {
	header := c.Writer.Header()
	for key, value := range cors.preflightHeaders {
		header[key] = value
	}
}

func (cors *cors) handleNormal(c *gin.Context) {
	header := c.Writer.Header()
	for key, value := range cors.normalHeaders {
		header[key] = value
	}
}


================================================
FILE: app/http/middleware/cors/cors.go
================================================
package cors

import (
	"errors"
	"strings"
	"time"

	"github.com/gohade/hade/framework/gin"
)

// Config represents all available options for the middleware.
type Config struct {
	AllowAllOrigins bool

	// AllowOrigins is a list of origins a cross-domain request can be executed from.
	// If the special "*" value is present in the list, all origins will be allowed.
	// Default value is []
	AllowOrigins []string

	// AllowOriginFunc is a custom function to validate the origin. It take the origin
	// as argument and returns true if allowed or false otherwise. If this option is
	// set, the content of AllowOrigins is ignored.
	AllowOriginFunc func(origin string) bool

	// AllowMethods is a list of methods the client is allowed to use with
	// cross-domain requests. Default value is simple methods (GET and POST)
	AllowMethods []string

	// AllowHeaders is list of non simple headers the client is allowed to use with
	// cross-domain requests.
	AllowHeaders []string

	// AllowCredentials indicates whether the request can include user credentials like
	// cookies, HTTP authentication or client side SSL certificates.
	AllowCredentials bool

	// ExposeHeaders indicates which headers are safe to expose to the API of a CORS
	// API specification
	ExposeHeaders []string

	// MaxAge indicates how long (with second-precision) the results of a preflight request 
	// can be cached
	MaxAge time.Duration

	// Allows to add origins like http://some-domain/*, https://api.* or http://some.*.subdomain.com
	AllowWildcard bool

	// Allows usage of popular browser extensions schemas
	AllowBrowserExtensions bool

	// Allows usage of WebSocket protocol
	AllowWebSockets bool

	// Allows usage of file:// schema (dangerous!) use it only when you 100% sure it's needed
	AllowFiles bool
}

// AddAllowMethods is allowed to add custom methods
func (c *Config) AddAllowMethods(methods ...string) {
	c.AllowMethods = append(c.AllowMethods, methods...)
}

// AddAllowHeaders is allowed to add custom headers
func (c *Config) AddAllowHeaders(headers ...string) {
	c.AllowHeaders = append(c.AllowHeaders, headers...)
}

// AddExposeHeaders is allowed to add custom expose headers
func (c *Config) AddExposeHeaders(headers ...string) {
	c.ExposeHeaders = append(c.ExposeHeaders, headers...)
}

func (c Config) getAllowedSchemas() []string {
	allowedSchemas := DefaultSchemas
	if c.AllowBrowserExtensions {
		allowedSchemas = append(allowedSchemas, ExtensionSchemas...)
	}
	if c.AllowWebSockets {
		allowedSchemas = append(allowedSchemas, WebSocketSchemas...)
	}
	if c.AllowFiles {
		allowedSchemas = append(allowedSchemas, FileSchemas...)
	}
	return allowedSchemas
}

func (c Config) validateAllowedSchemas(origin string) bool {
	allowedSchemas := c.getAllowedSchemas()
	for _, schema := range allowedSchemas {
		if strings.HasPrefix(origin, schema) {
			return true
		}
	}
	return false
}

// Validate is check configuration of user defined.
func (c Config) Validate() error {
	if c.AllowAllOrigins && (c.AllowOriginFunc != nil || len(c.AllowOrigins) > 0) {
		return errors.New("conflict settings: all origins are allowed. AllowOriginFunc or AllowOrigins is not needed")
	}
	if !c.AllowAllOrigins && c.AllowOriginFunc == nil && len(c.AllowOrigins) == 0 {
		return errors.New("conflict settings: all origins disabled")
	}
	for _, origin := range c.AllowOrigins {
		if !strings.Contains(origin, "*") && !c.validateAllowedSchemas(origin) {
			return errors.New("bad origin: origins must contain '*' or include " + strings.Join(c.getAllowedSchemas(), ","))
		}
	}
	return nil
}

func (c Config) parseWildcardRules() [][]string {
	var wRules [][]string

	if !c.AllowWildcard {
		return wRules
	}

	for _, o := range c.AllowOrigins {
		if !strings.Contains(o, "*") {
			continue
		}

		if c := strings.Count(o, "*"); c > 1 {
			panic(errors.New("only one * is allowed").Error())
		}

		i := strings.Index(o, "*")
		if i == 0 {
			wRules = append(wRules, []string{"*", o[1:]})
			continue
		}
		if i == (len(o) - 1) {
			wRules = append(wRules, []string{o[:i-1], "*"})
			continue
		}

		wRules = append(wRules, []string{o[:i], o[i+1:]})
	}

	return wRules
}

// DefaultConfig returns a generic default configuration mapped to localhost.
func DefaultConfig() Config {
	return Config{
		AllowMethods:     []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"},
		AllowHeaders:     []string{"Origin", "Content-Length", "Content-Type"},
		AllowCredentials: false,
		MaxAge:           12 * time.Hour,
	}
}

// Default returns the location middleware with default configuration.
func Default() gin.HandlerFunc {
	config := DefaultConfig()
	config.AllowAllOrigins = true
	return New(config)
}

// New returns the location middleware with user-defined custom configuration.
func New(config Config) gin.HandlerFunc {
	cors := newCors(config)
	return func(c *gin.Context) {
		cors.applyCors(c)
	}
}


================================================
FILE: app/http/middleware/cors/cors_test.go
================================================
package cors

import (
	"net/http"
	"net/http/httptest"
	"strings"
	"testing"
	"time"

	"github.com/gohade/hade/framework/gin"
	"github.com/stretchr/testify/assert"
)

func init() {
	gin.SetMode(gin.TestMode)
}

func newTestRouter(config Config) *gin.Engine {
	router := gin.New()
	router.Use(New(config))
	router.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "get")
	})
	router.POST("/", func(c *gin.Context) {
		c.String(http.StatusOK, "post")
	})
	router.PATCH("/", func(c *gin.Context) {
		c.String(http.StatusOK, "patch")
	})
	return router
}

func performRequest(r http.Handler, method, origin string) *httptest.ResponseRecorder {
	return performRequestWithHeaders(r, method, origin, http.Header{})
}

func performRequestWithHeaders(r http.Handler, method, origin string, header http.Header) *httptest.ResponseRecorder {
	req, _ := http.NewRequest(method, "/", nil)
	// From go/net/http/request.go:
	// For incoming requests, the Host header is promoted to the
	// Request.Host field and removed from the Header map.
	req.Host = header.Get("Host")
	header.Del("Host")
	if len(origin) > 0 {
		header.Set("Origin", origin)
	}
	req.Header = header
	w := httptest.NewRecorder()
	r.ServeHTTP(w, req)
	return w
}

func TestConfigAddAllow(t *testing.T) {
	config := Config{}
	config.AddAllowMethods("POST")
	config.AddAllowMethods("GET", "PUT")
	config.AddExposeHeaders()

	config.AddAllowHeaders("Some", " cool")
	config.AddAllowHeaders("header")
	config.AddExposeHeaders()

	config.AddExposeHeaders()
	config.AddExposeHeaders("exposed", "header")
	config.AddExposeHeaders("hey")

	assert.Equal(t, config.AllowMethods, []string{"POST", "GET", "PUT"})
	assert.Equal(t, config.AllowHeaders, []string{"Some", " cool", "header"})
	assert.Equal(t, config.ExposeHeaders, []string{"exposed", "header", "hey"})

}

func TestBadConfig(t *testing.T) {
	assert.Panics(t, func() { New(Config{}) })
	assert.Panics(t, func() {
		New(Config{
			AllowAllOrigins: true,
			AllowOrigins:    []string{"http://google.com"},
		})
	})
	assert.Panics(t, func() {
		New(Config{
			AllowAllOrigins: true,
			AllowOriginFunc: func(origin string) bool { return false },
		})
	})
	assert.Panics(t, func() {
		New(Config{
			AllowOrigins: []string{"google.com"},
		})
	})
}

func TestNormalize(t *testing.T) {
	values := normalize([]string{
		"http-Access ", "Post", "POST", " poSt  ",
		"HTTP-Access", "",
	})
	assert.Equal(t, values, []string{"http-access", "post", ""})

	values = normalize(nil)
	assert.Nil(t, values)

	values = normalize([]string{})
	assert.Equal(t, values, []string{})
}

func TestConvert(t *testing.T) {
	methods := []string{"Get", "GET", "get"}
	headers := []string{"X-CSRF-TOKEN", "X-CSRF-Token", "x-csrf-token"}

	assert.Equal(t, []string{"GET", "GET", "GET"}, convert(methods, strings.ToUpper))
	assert.Equal(t, []string{"X-Csrf-Token", "X-Csrf-Token", "X-Csrf-Token"}, convert(headers, http.CanonicalHeaderKey))
}

func TestGenerateNormalHeaders_AllowAllOrigins(t *testing.T) {
	header := generateNormalHeaders(Config{
		AllowAllOrigins: false,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Origin"), "")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 1)

	header = generateNormalHeaders(Config{
		AllowAllOrigins: true,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Origin"), "*")
	assert.Equal(t, header.Get("Vary"), "")
	assert.Len(t, header, 1)
}

func TestGenerateNormalHeaders_AllowCredentials(t *testing.T) {
	header := generateNormalHeaders(Config{
		AllowCredentials: true,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Credentials"), "true")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestGenerateNormalHeaders_ExposedHeaders(t *testing.T) {
	header := generateNormalHeaders(Config{
		ExposeHeaders: []string{"X-user", "xPassword"},
	})
	assert.Equal(t, header.Get("Access-Control-Expose-Headers"), "X-User,Xpassword")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestGeneratePreflightHeaders(t *testing.T) {
	header := generatePreflightHeaders(Config{
		AllowAllOrigins: false,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Origin"), "")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 1)

	header = generateNormalHeaders(Config{
		AllowAllOrigins: true,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Origin"), "*")
	assert.Equal(t, header.Get("Vary"), "")
	assert.Len(t, header, 1)
}

func TestGeneratePreflightHeaders_AllowCredentials(t *testing.T) {
	header := generatePreflightHeaders(Config{
		AllowCredentials: true,
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Credentials"), "true")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestGeneratePreflightHeaders_AllowMethods(t *testing.T) {
	header := generatePreflightHeaders(Config{
		AllowMethods: []string{"GET ", "post", "PUT", " put  "},
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Methods"), "GET,POST,PUT")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestGeneratePreflightHeaders_AllowHeaders(t *testing.T) {
	header := generatePreflightHeaders(Config{
		AllowHeaders: []string{"X-user", "Content-Type"},
	})
	assert.Equal(t, header.Get("Access-Control-Allow-Headers"), "X-User,Content-Type")
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestGeneratePreflightHeaders_MaxAge(t *testing.T) {
	header := generatePreflightHeaders(Config{
		MaxAge: 12 * time.Hour,
	})
	assert.Equal(t, header.Get("Access-Control-Max-Age"), "43200") // 12*60*60
	assert.Equal(t, header.Get("Vary"), "Origin")
	assert.Len(t, header, 2)
}

func TestValidateOrigin(t *testing.T) {
	cors := newCors(Config{
		AllowAllOrigins: true,
	})
	assert.True(t, cors.validateOrigin("http://google.com"))
	assert.True(t, cors.validateOrigin("https://google.com"))
	assert.True(t, cors.validateOrigin("example.com"))
	assert.True(t, cors.validateOrigin("chrome-extension://random-extension-id"))

	cors = newCors(Config{
		AllowOrigins: []string{"https://google.com", "https://github.com"},
		AllowOriginFunc: func(origin string) bool {
			return (origin == "http://news.ycombinator.com")
		},
		AllowBrowserExtensions: true,
	})
	assert.False(t, cors.validateOrigin("http://google.com"))
	assert.True(t, cors.validateOrigin("https://google.com"))
	assert.True(t, cors.validateOrigin("https://github.com"))
	assert.True(t, cors.validateOrigin("http://news.ycombinator.com"))
	assert.False(t, cors.validateOrigin("http://example.com"))
	assert.False(t, cors.validateOrigin("google.com"))
	assert.False(t, cors.validateOrigin("chrome-extension://random-extension-id"))

	cors = newCors(Config{
		AllowOrigins: []string{"https://google.com", "https://github.com"},
	})
	assert.False(t, cors.validateOrigin("chrome-extension://random-extension-id"))
	assert.False(t, cors.validateOrigin("file://some-dangerous-file.js"))
	assert.False(t, cors.validateOrigin("wss://socket-connection"))

	cors = newCors(Config{
		AllowOrigins:           []string{"chrome-extension://*", "safari-extension://my-extension-*-app", "*.some-domain.com"},
		AllowBrowserExtensions: true,
		AllowWildcard:          true,
	})
	assert.True(t, cors.validateOrigin("chrome-extension://random-extension-id"))
	assert.True(t, cors.validateOrigin("chrome-extension://another-one"))
	assert.True(t, cors.validateOrigin("safari-extension://my-extension-one-app"))
	assert.True(t, cors.validateOrigin("safari-extension://my-extension-two-app"))
	assert.False(t, cors.validateOrigin("moz-extension://ext-id-we-not-allow"))
	assert.True(t, cors.validateOrigin("http://api.some-domain.com"))
	assert.False(t, cors.validateOrigin("http://api.another-domain.com"))

	cors = newCors(Config{
		AllowOrigins:    []string{"file://safe-file.js", "wss://some-session-layer-connection"},
		AllowFiles:      true,
		AllowWebSockets: true,
	})
	assert.True(t, cors.validateOrigin("file://safe-file.js"))
	assert.False(t, cors.validateOrigin("file://some-dangerous-file.js"))
	assert.True(t, cors.validateOrigin("wss://some-session-layer-connection"))
	assert.False(t, cors.validateOrigin("ws://not-what-we-expected"))

	cors = newCors(Config{
		AllowOrigins: []string{"*"},
	})
	assert.True(t, cors.validateOrigin("http://google.com"))
	assert.True(t, cors.validateOrigin("https://google.com"))
	assert.True(t, cors.validateOrigin("example.com"))
	assert.True(t, cors.validateOrigin("chrome-extension://random-extension-id"))
}

func TestPassesAllowOrigins(t *testing.T) {
	router := newTestRouter(Config{
		AllowOrigins:     []string{"http://google.com"},
		AllowMethods:     []string{" GeT ", "get", "post", "PUT  ", "Head", "POST"},
		AllowHeaders:     []string{"Content-type", "timeStamp "},
		ExposeHeaders:    []string{"Data", "x-User"},
		AllowCredentials: false,
		MaxAge:           12 * time.Hour,
		AllowOriginFunc: func(origin string) bool {
			return origin == "http://github.com"
		},
	})

	// no CORS request, origin == ""
	w := performRequest(router, "GET", "")
	assert.Equal(t, "get", w.Body.String())
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Empty(t, w.Header().Get("Access-Control-Expose-Headers"))

	// no CORS request, origin == host
	h := http.Header{}
	h.Set("Host", "facebook.com")
	w = performRequestWithHeaders(router, "GET", "http://facebook.com", h)
	assert.Equal(t, "get", w.Body.String())
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Empty(t, w.Header().Get("Access-Control-Expose-Headers"))

	// allowed CORS request
	w = performRequest(router, "GET", "http://google.com")
	assert.Equal(t, "get", w.Body.String())
	assert.Equal(t, "http://google.com", w.Header().Get("Access-Control-Allow-Origin"))
	assert.Equal(t, "", w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Equal(t, "Data,X-User", w.Header().Get("Access-Control-Expose-Headers"))

	w = performRequest(router, "GET", "http://github.com")
	assert.Equal(t, "get", w.Body.String())
	assert.Equal(t, "http://github.com", w.Header().Get("Access-Control-Allow-Origin"))
	assert.Equal(t, "", w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Equal(t, "Data,X-User", w.Header().Get("Access-Control-Expose-Headers"))

	// deny CORS request
	w = performRequest(router, "GET", "https://google.com")
	assert.Equal(t, http.StatusForbidden, w.Code)
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Empty(t, w.Header().Get("Access-Control-Expose-Headers"))

	// allowed CORS prefligh request
	w = performRequest(router, "OPTIONS", "http://github.com")
	assert.Equal(t, http.StatusNoContent, w.Code)
	assert.Equal(t, "http://github.com", w.Header().Get("Access-Control-Allow-Origin"))
	assert.Equal(t, "", w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Equal(t, "GET,POST,PUT,HEAD", w.Header().Get("Access-Control-Allow-Methods"))
	assert.Equal(t, "Content-Type,Timestamp", w.Header().Get("Access-Control-Allow-Headers"))
	assert.Equal(t, "43200", w.Header().Get("Access-Control-Max-Age"))

	// deny CORS prefligh request
	w = performRequest(router, "OPTIONS", "http://example.com")
	assert.Equal(t, http.StatusForbidden, w.Code)
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Methods"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Headers"))
	assert.Empty(t, w.Header().Get("Access-Control-Max-Age"))
}

func TestPassesAllowAllOrigins(t *testing.T) {
	router := newTestRouter(Config{
		AllowAllOrigins:  true,
		AllowMethods:     []string{" Patch ", "get", "post", "POST"},
		AllowHeaders:     []string{"Content-type", "  testheader "},
		ExposeHeaders:    []string{"Data2", "x-User2"},
		AllowCredentials: false,
		MaxAge:           10 * time.Hour,
	})

	// no CORS request, origin == ""
	w := performRequest(router, "GET", "")
	assert.Equal(t, "get", w.Body.String())
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Empty(t, w.Header().Get("Access-Control-Expose-Headers"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))

	// allowed CORS request
	w = performRequest(router, "POST", "example.com")
	assert.Equal(t, "post", w.Body.String())
	assert.Equal(t, "*", w.Header().Get("Access-Control-Allow-Origin"))
	assert.Equal(t, "Data2,X-User2", w.Header().Get("Access-Control-Expose-Headers"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
	assert.Equal(t, "*", w.Header().Get("Access-Control-Allow-Origin"))

	// allowed CORS prefligh request
	w = performRequest(router, "OPTIONS", "https://facebook.com")
	assert.Equal(t, http.StatusNoContent, w.Code)
	assert.Equal(t, "*", w.Header().Get("Access-Control-Allow-Origin"))
	assert.Equal(t, "PATCH,GET,POST", w.Header().Get("Access-Control-Allow-Methods"))
	assert.Equal(t, "Content-Type,Testheader", w.Header().Get("Access-Control-Allow-Headers"))
	assert.Equal(t, "36000", w.Header().Get("Access-Control-Max-Age"))
	assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))

}

func TestWildcard(t *testing.T) {
	router := newTestRouter(Config{
		AllowOrigins:  []string{"https://*.github.com", "https://api.*", "http://*", "https://facebook.com", "*.golang.org"},
		AllowMethods:  []string{"GET"},
		AllowWildcard: true,
	})

	w := performRequest(router, "GET", "https://gist.github.com")
	assert.Equal(t, 200, w.Code)

	w = performRequest(router, "GET", "https://api.github.com/v1/users")
	assert.Equal(t, 200, w.Code)

	w = performRequest(router, "GET", "https://giphy.com/")
	assert.Equal(t, 403, w.Code)

	w = performRequest(router, "GET", "http://hard-to-find-http-example.com")
	assert.Equal(t, 200, w.Code)

	w = performRequest(router, "GET", "https://facebook.com")
	assert.Equal(t, 200, w.Code)

	w = performRequest(router, "GET", "https://something.golang.org")
	assert.Equal(t, 200, w.Code)

	w = performRequest(router, "GET", "https://something.go.org")
	assert.Equal(t, 403, w.Code)

	router = newTestRouter(Config{
		AllowOrigins: []string{"https://github.com", "https://facebook.com"},
		AllowMethods: []string{"GET"},
	})

	w = performRequest(router, "GET", "https://gist.github.com")
	assert.Equal(t, 403, w.Code)

	w = performRequest(router, "GET", "https://github.com")
	assert.Equal(t, 200, w.Code)
}


================================================
FILE: app/http/middleware/cors/examples/example.go
================================================
package main

import (
	"time"

	"github.com/gin-contrib/cors"
	"github.com/gohade/hade/framework/gin"
)

func main() {
	router := gin.Default()
	// CORS for https://foo.com and https://github.com origins, allowing:
	// - PUT and PATCH methods
	// - Origin header
	// - Credentials share
	// - Preflight requests cached for 12 hours
	router.Use(cors.New(cors.Config{
		AllowOrigins:     []string{"https://foo.com"},
		AllowMethods:     []string{"PUT", "PATCH"},
		AllowHeaders:     []string{"Origin"},
		ExposeHeaders:    []string{"Content-Length"},
		AllowCredentials: true,
		AllowOriginFunc: func(origin string) bool {
			return origin == "https://github.com"
		},
		MaxAge: 12 * time.Hour,
	}))
	router.Run()
}


================================================
FILE: app/http/middleware/cors/utils.go
================================================
package cors

import (
	"net/http"
	"strconv"
	"strings"
	"time"
)

type converter func(string) string

func generateNormalHeaders(c Config) http.Header {
	headers := make(http.Header)
	if c.AllowCredentials {
		headers.Set("Access-Control-Allow-Credentials", "true")
	}
	if len(c.ExposeHeaders) > 0 {
		exposeHeaders := convert(normalize(c.ExposeHeaders), http.CanonicalHeaderKey)
		headers.Set("Access-Control-Expose-Headers", strings.Join(exposeHeaders, ","))
	}
	if c.AllowAllOrigins {
		headers.Set("Access-Control-Allow-Origin", "*")
	} else {
		headers.Set("Vary", "Origin")
	}
	return headers
}

func generatePreflightHeaders(c Config) http.Header {
	headers := make(http.Header)
	if c.AllowCredentials {
		headers.Set("Access-Control-Allow-Credentials", "true")
	}
	if len(c.AllowMethods) > 0 {
		allowMethods := convert(normalize(c.AllowMethods), strings.ToUpper)
		value := strings.Join(allowMethods, ",")
		headers.Set("Access-Control-Allow-Methods", value)
	}
	if len(c.AllowHeaders) > 0 {
		allowHeaders := convert(normalize(c.AllowHeaders), http.CanonicalHeaderKey)
		value := strings.Join(allowHeaders, ",")
		headers.Set("Access-Control-Allow-Headers", value)
	}
	if c.MaxAge > time.Duration(0) {
		value := strconv.FormatInt(int64(c.MaxAge/time.Second), 10)
		headers.Set("Access-Control-Max-Age", value)
	}
	if c.AllowAllOrigins {
		headers.Set("Access-Control-Allow-Origin", "*")
	} else {
		// Always set Vary headers
		// see https://github.com/rs/cors/issues/10,
		// https://github.com/rs/cors/commit/dbdca4d95feaa7511a46e6f1efb3b3aa505bc43f#commitcomment-12352001

		headers.Add("Vary", "Origin")
		headers.Add("Vary", "Access-Control-Request-Method")
		headers.Add("Vary", "Access-Control-Request-Headers")
	}
	return headers
}

func normalize(values []string) []string {
	if values == nil {
		return nil
	}
	distinctMap := make(map[string]bool, len(values))
	normalized := make([]string, 0, len(values))
	for _, value := range values {
		value = strings.TrimSpace(value)
		value = strings.ToLower(value)
		if _, seen := distinctMap[value]; !seen {
			normalized = append(normalized, value)
			distinctMap[value] = true
		}
	}
	return normalized
}

func convert(s []string, c converter) []string {
	var out []string
	for _, i := range s {
		out = append(out, c(i))
	}
	return out
}


================================================
FILE: app/http/module/demo/api.go
================================================
package demo

import (
	demoService "github.com/gohade/hade/app/provider/demo"
	"github.com/gohade/hade/framework/gin"
)

type DemoApi struct {
	service *Service
}

func Register(r *gin.Engine) error {
	api := NewDemoApi()
	r.Bind(&demoService.DemoProvider{})

	r.GET("/demo/demo", api.Demo)
	r.GET("/demo/demo2", api.Demo2)
	r.POST("/demo/demo_post", api.DemoPost)
	r.GET("/demo/orm", api.DemoOrm)
	r.GET("/demo/cache/redis", api.DemoRedis)
	return nil
}

func NewDemoApi() *DemoApi {
	service := NewService()
	return &DemoApi{service: service}
}

// Demo godoc
// @Summary 获取所有用户
// @Description 获取所有用户
// @Produce  json
// @Tags demo
// @Success 200 array []UserDTO
// @Router /demo/demo [get]
func (api *DemoApi) Demo(c *gin.Context) {
	c.JSON(200, "this is demo for dev all")
}

// Demo2  for godoc
// @Summary 获取所有学生
// @Description 获取所有学生,不进行分页
// @Produce  json
// @Tags demo
// @Success 200 {array} UserDTO
// @Router /demo/demo2 [get]
func (api *DemoApi) Demo2(c *gin.Context) {
	demoProvider := c.MustMake(demoService.DemoKey).(demoService.IService)
	students := demoProvider.GetAllStudent()
	usersDTO := StudentsToUserDTOs(students)
	c.JSON(200, usersDTO)
}

func (api *DemoApi) DemoPost(c *gin.Context) {
	type Foo struct {
		Name string
	}
	foo := &Foo{}
	err := c.BindJSON(&foo)
	if err != nil {
		c.AbortWithError(500, err)
	}
	c.JSON(200, nil)
}


================================================
FILE: app/http/module/demo/api_cache.go
================================================
package demo

import (
	"github.com/gohade/hade/framework/contract"
	"github.com/gohade/hade/framework/gin"
	"github.com/gohade/hade/framework/provider/redis"
	"time"
)

// DemoRedis redis的路由方法
func (api *DemoApi) DemoRedis(c *gin.Context) {
	logger := c.MustMakeLog()
	logger.Info(c, "request start", nil)

	// 初始化一个redis
	redisService := c.MustMake(contract.RedisKey).(contract.RedisService)
	client, err := redisService.GetClient(redis.WithConfigPath("cache.default"), redis.WithRedisConfig(func(options *contract.RedisConfig) {
		options.MaxRetries = 3
	}))
	if err != nil {
		logger.Error(c, err.Error(), nil)
		c.AbortWithError(50001, err)
		return
	}
	if err := client.Set(c, "foo", "bar", 1*time.Hour).Err(); err != nil {
		c.AbortWithError(500, err)
		return
	}
	val := client.Get(c, "foo").String()
	logger.Info(c, "redis get", map[string]interface{}{
		"val": val,
	})

	if err := client.Del(c, "foo").Err(); err != nil {
		c.AbortWithError(500, err)
		return
	}

	c.JSON(200, "ok")
}

// DemoCache cache的简单例子
func (api *DemoApi) DemoCache(c *gin.Context) {
	logger := c.MustMakeLog()
	logger.Info(c, "request start", nil)
	// 初始化cache服务
	cacheService := c.MustMake(contract.CacheKey).(contract.CacheService)
	// 设置key为foo
	err := cacheService.Set(c, "foo", "bar", 1*time.Hour)
	if err != nil {
		c.AbortWithError(500, err)
		return
	}
	// 获取key为foo
	val, err := cacheService.Get(c, "foo")
	if err != nil {
		c.AbortWithError(500, err)
		return
	}
	logger.Info(c, "cache get", map[string]interface{}{
		"val": val,
	})
	// 删除key为foo
	if err := cacheService.Del(c, "foo"); err != nil {
		c.AbortWithError(500, err)
		return
	}
	c.JSON(200, "ok")
}


================================================
FILE: app/http/module/demo/api_orm.go
================================================
package demo

import (
    "database/sql"
    "github.com/gohade/hade/framework/contract"
    "github.com/gohade/hade/framework/gin"
    "github.com/gohade/hade/framework/provider/orm"
    "time"
)

// DemoOrm Orm的路由方法
func (api *DemoApi) DemoOrm(c *gin.Context) {
    logger := c.MustMakeLog()
    logger.Info(c, "request start", nil)

    // 初始化一个orm.DB
    gormService := c.MustMake(contract.ORMKey).(contract.ORMService)
    db, err := gormService.GetDB(orm.WithConfigPath("database.default"))
    if err != nil {
        logger.Error(c, err.Error(), nil)
        c.AbortWithError(50001, err)
        return
    }
    db.WithContext(c)

    // 将User模型创建到数据库中
    err = db.AutoMigrate(&User{})
    if err != nil {
        c.AbortWithError(500, err)
        return
    }
    logger.Info(c, "migrate ok", nil)

    // 插入一条数据
    email := "foo@gmail.com"
    name := "foo"
    age := uint8(25)
    birthday := time.Date(2001, 1, 1, 1, 1, 1, 1, time.Local)
    user := &User{
        Name:         name,
        Email:        &email,
        Age:          age,
        Birthday:     &birthday,
        MemberNumber: sql.NullString{},
        ActivatedAt:  sql.NullTime{},
        CreatedAt:    time.Now(),
        UpdatedAt:    time.Now(),
    }
    err = db.Create(user).Error
    logger.Info(c, "insert user", map[string]interface{}{
        "id":  user.ID,
        "err": err,
    })

    // 更新一条数据
    user.Name = "bar"
    err = db.Save(user).Error
    logger.Info(c, "update user", map[string]interface{}{
        "err": err,
        "id":  user.ID,
    })

    // 查询一条数据
    queryUser := &User{ID: user.ID}

    err = db.First(queryUser).Error
    logger.Info(c, "query user", map[string]interface{}{
        "err":  err,
        "name": queryUser.Name,
    })

    // 删除一条数据
    err = db.Delete(queryUser).Error
    logger.Info(c, "delete user", map[string]interface{}{
        "err": err,
        "id":  user.ID,
    })
    c.JSON(200, "ok")
}


================================================
FILE: app/http/module/demo/dto.go
================================================
package demo

type UserDTO struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}


================================================
FILE: app/http/module/demo/mapper.go
================================================
package demo

import (
	demoService "github.com/gohade/hade/app/provider/demo"
)

func UserModelsToUserDTOs(models []UserModel) []UserDTO {
	ret := []UserDTO{}
	for _, model := range models {
		t := UserDTO{
			ID:   model.UserId,
			Name: model.Name,
		}
		ret = append(ret, t)
	}
	return ret
}

func StudentsToUserDTOs(students []demoService.Student) []UserDTO {
	ret := []UserDTO{}
	for _, student := range students {
		t := UserDTO{
			ID:   student.ID,
			Name: student.Name,
		}
		ret = append(ret, t)
	}
	return ret
}


================================================
FILE: app/http/module/demo/model.go
================================================
package demo

import (
	"database/sql"
	"time"
)

type UserModel struct {
	UserId int
	Name   string
	Age    int
}

// User is gorm model
type User struct {
	ID           uint
	Name         string
	Email        *string
	Age          uint8
	Birthday     *time.Time
	MemberNumber sql.NullString
	ActivatedAt  sql.NullTime
	CreatedAt    time.Time
	UpdatedAt    time.Time
}


================================================
FILE: app/http/module/demo/repository.go
================================================
package demo

type Repository struct {
}

func NewRepository() *Repository {
	return &Repository{}
}

func (r *Repository) GetUserIds() []int {
	return []int{1, 2}
}

func (r *Repository) GetUserByIds([]int) []UserModel {
	return []UserModel{
		{
			UserId: 1,
			Name:   "foo",
			Age:    11,
		},
		{
			UserId: 2,
			Name:   "bar",
			Age:    12,
		},
	}
}


================================================
FILE: app/http/module/demo/service.go
================================================
package demo

type Service struct {
	repository *Repository
}

func NewService() *Service {
	repository := NewRepository()
	return &Service{
		repository: repository,
	}
}

func (s *Service) GetUsers() []UserModel {
	ids := s.repository.GetUserIds()
	return s.repository.GetUserByIds(ids)
}


================================================
FILE: app/http/route.go
================================================
package http

import (
	"github.com/gohade/hade/app/http/middleware/cors"
	"github.com/gohade/hade/app/http/module/demo"
	"github.com/gohade/hade/framework/contract"
	"github.com/gohade/hade/framework/gin"
	ginSwagger "github.com/gohade/hade/framework/middleware/gin-swagger"
	"github.com/gohade/hade/framework/middleware/gin-swagger/swaggerFiles"
	"github.com/gohade/hade/framework/middleware/static"
)

// Routes 绑定业务层路由
func Routes(r *gin.Engine) {
	container := r.GetContainer()
	configService := container.MustMake(contract.ConfigKey).(contract.Config)

	// /路径先去./dist目录下查找文件是否存在,找到使用文件服务提供服务
	r.Use(static.Serve("/", static.LocalFile("./dist", false)))
	// 使用cors中间件
	r.Use(cors.Default())

	// 如果配置了swagger,则显示swagger的中间件
	if configService.GetBool("app.swagger") == true {
		r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	}

	// 动态路由定义
	demo.Register(r)
}


================================================
FILE: app/http/swagger/docs.go
================================================
// Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package swagger

import (
	"bytes"
	"encoding/json"
	"strings"
	"text/template"

	"github.com/swaggo/swag"
)

var doc = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "termsOfService": "https://github.com/swaggo/swag",
        "contact": {
            "name": "yejianfeng1",
            "email": "yejianfeng"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/demo/demo": {
            "get": {
                "description": "获取所有用户",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "demo"
                ],
                "summary": "获取所有用户",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/definitions/demo.UserDTO"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/demo/demo2": {
            "get": {
                "description": "获取所有学生,不进行分页",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "demo"
                ],
                "summary": "获取所有学生",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/demo.UserDTO"
                            }
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "demo.UserDTO": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        },
        "BasicAuth": {
            "type": "basic"
        }
    },
    "x-extension-openapi": {
        "example": "value on a json format"
    }
}`

type swaggerInfo struct {
	Version     string
	Host        string
	BasePath    string
	Schemes     []string
	Title       string
	Description string
}

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
	Version:     "1.1",
	Host:        "",
	BasePath:    "/",
	Schemes:     []string{},
	Title:       "hade",
	Description: "hade测试",
}

type s struct{}

func (s *s) ReadDoc() string {
	sInfo := SwaggerInfo
	sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)

	t, err := template.New("swagger_info").Funcs(template.FuncMap{
		"marshal": func(v interface{}) string {
			a, _ := json.Marshal(v)
			return string(a)
		},
		"escape": func(v interface{}) string {
			// escape tabs
			str := strings.Replace(v.(string), "\t", "\\t", -1)
			// replace " with \", and if that results in \\", replace that with \\\"
			str = strings.Replace(str, "\"", "\\\"", -1)
			return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
		},
	}).Parse(doc)
	if err != nil {
		return doc
	}

	var tpl bytes.Buffer
	if err := t.Execute(&tpl, sInfo); err != nil {
		return doc
	}

	return tpl.String()
}

func init() {
	swag.Register(swag.Name, &s{})
}


================================================
FILE: app/http/swagger/swagger.json
================================================
{
    "swagger": "2.0",
    "info": {
        "description": "hade测试",
        "title": "hade",
        "termsOfService": "https://github.com/swaggo/swag",
        "contact": {
            "name": "yejianfeng1",
            "email": "yejianfeng"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "1.1"
    },
    "basePath": "/",
    "paths": {
        "/demo/demo": {
            "get": {
                "description": "获取所有用户",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "demo"
                ],
                "summary": "获取所有用户",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/definitions/demo.UserDTO"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/demo/demo2": {
            "get": {
                "description": "获取所有学生,不进行分页",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "demo"
                ],
                "summary": "获取所有学生",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/demo.UserDTO"
                            }
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "demo.UserDTO": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        },
        "BasicAuth": {
            "type": "basic"
        }
    },
    "x-extension-openapi": {
        "example": "value on a json format"
    }
}

================================================
FILE: app/http/swagger/swagger.yaml
================================================
basePath: /
definitions:
  demo.UserDTO:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
info:
  contact:
    email: yejianfeng
    name: yejianfeng1
  description: hade测试
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: https://github.com/swaggo/swag
  title: hade
  version: "1.1"
paths:
  /demo/demo:
    get:
      description: 获取所有用户
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              items:
                $ref: '#/definitions/demo.UserDTO'
              type: array
            type: array
      summary: 获取所有用户
      tags:
      - demo
  /demo/demo2:
    get:
      description: 获取所有学生,不进行分页
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/demo.UserDTO'
            type: array
      summary: 获取所有学生
      tags:
      - demo
securityDefinitions:
  ApiKeyAuth:
    in: header
    name: Authorization
    type: apiKey
  BasicAuth:
    type: basic
swagger: "2.0"
x-extension-openapi:
  example: value on a json format


================================================
FILE: app/http/swagger.go
================================================
// Package http API.
// @title hade
// @version 1.1
// @description hade测试
// @termsOfService https://github.com/swaggo/swag

// @contact.name yejianfeng1
// @contact.email yejianfeng

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @BasePath /
// @query.collection.format multi

// @securityDefinitions.basic BasicAuth

// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization

// @x-extension-openapi {"example": "value on a json format"}

package http

import (
    _ "github.com/gohade/hade/app/http/swagger"
)


================================================
FILE: app/provider/demo/contract.go
================================================
package demo

const DemoKey = "demo"

type IService interface {
	GetAllStudent() []Student
}

type Student struct {
	ID   int
	Name string
}


================================================
FILE: app/provider/demo/provider.go
================================================
package demo

import (
	"github.com/gohade/hade/framework"
)

type DemoProvider struct {
	framework.ServiceProvider

	c framework.Container
}

func (sp *DemoProvider) Name() string {
	return DemoKey
}

func (sp *DemoProvider) Register(c framework.Container) framework.NewInstance {
	return NewService
}

func (sp *DemoProvider) IsDefer() bool {
	return false
}

func (sp *DemoProvider) Params(c framework.Container) []interface{} {
	return []interface{}{sp.c}
}

func (sp *DemoProvider) Boot(c framework.Container) error {
	sp.c = c
	return nil
}


================================================
FILE: app/provider/demo/service.go
================================================
package demo

import "github.com/gohade/hade/framework"

type Service struct {
	container framework.Container
}

func NewService(params ...interface{}) (interface{}, error) {
	container := params[0].(framework.Container)
	return &Service{container: container}, nil
}

func (s *Service) GetAllStudent() []Student {
	return []Student{
		{
			ID:   1,
			Name: "foo",
		},
		{
			ID:   2,
			Name: "bar",
		},
	}
}


================================================
FILE: app/provider/user/contract.go
================================================
package user

const UserKey = "user"

type Service interface {
	// 请在这里定义你的方法
    Foo() string
}


================================================
FILE: app/provider/user/provider.go
================================================
package user

import (
	"github.com/gohade/hade/framework"
)

type UserProvider struct {
	framework.ServiceProvider

	c framework.Container
}

func (sp *UserProvider) Name() string {
	return UserKey
}

func (sp *UserProvider) Register(c framework.Container) framework.NewInstance {
	return NewUserService
}

func (sp *UserProvider) IsDefer() bool {
	return false
}

func (sp *UserProvider) Params(c framework.Container) []interface{} {
	return []interface{}{c}
}

func (sp *UserProvider) Boot(c framework.Container) error {
	return nil
}



================================================
FILE: app/provider/user/service.go
================================================
package user

import "github.com/gohade/hade/framework"

type UserService struct {
	container framework.Container
}

func NewUserService(params ...interface{}) (interface{}, error) {
	container := params[0].(framework.Container)
	return &UserService{container: container}, nil
}

func (s *UserService) Foo() string {
    return ""
}


================================================
FILE: build/build.js
================================================
'use strict'
require('./check-versions')()

process.env.NODE_ENV = 'production'

const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')

const spinner = ora('building for production...')
spinner.start()

rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
  if (err) throw err
  webpack(webpackConfig, (err, stats) => {
    spinner.stop()
    if (err) throw err
    process.stdout.write(stats.toString({
      colors: true,
      modules: false,
      children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
      chunks: false,
      chunkModules: false
    }) + '\n\n')

    if (stats.hasErrors()) {
      console.log(chalk.red('  Build failed with errors.\n'))
      process.exit(1)
    }

    console.log(chalk.cyan('  Build complete.\n'))
    console.log(chalk.yellow(
      '  Tip: built files are meant to be served over an HTTP server.\n' +
      '  Opening index.html over file:// won\'t work.\n'
    ))
  })
})


================================================
FILE: build/check-versions.js
================================================
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')

function exec (cmd) {
  return require('child_process').execSync(cmd).toString().trim()
}

const versionRequirements = [
  {
    name: 'node',
    currentVersion: semver.clean(process.version),
    versionRequirement: packageConfig.engines.node
  }
]

if (shell.which('npm')) {
  versionRequirements.push({
    name: 'npm',
    currentVersion: exec('npm --version'),
    versionRequirement: packageConfig.engines.npm
  })
}

module.exports = function () {
  const warnings = []

  for (let i = 0; i < versionRequirements.length; i++) {
    const mod = versionRequirements[i]

    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
      warnings.push(mod.name + ': ' +
        chalk.red(mod.currentVersion) + ' should be ' +
        chalk.green(mod.versionRequirement)
      )
    }
  }

  if (warnings.length) {
    console.log('')
    console.log(chalk.yellow('To use this template, you must update following to modules:'))
    console.log()

    for (let i = 0; i < warnings.length; i++) {
      const warning = warnings[i]
      console.log('  ' + warning)
    }

    console.log()
    process.exit(1)
  }
}


================================================
FILE: build/utils.js
================================================
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')

exports.assetsPath = function (_path) {
  const assetsSubDirectory = process.env.NODE_ENV === 'production'
    ? config.build.assetsSubDirectory
    : config.dev.assetsSubDirectory

  return path.posix.join(assetsSubDirectory, _path)
}

exports.cssLoaders = function (options) {
  options = options || {}

  const cssLoader = {
    loader: 'css-loader',
    options: {
      sourceMap: options.sourceMap
    }
  }

  const postcssLoader = {
    loader: 'postcss-loader',
    options: {
      sourceMap: options.sourceMap
    }
  }

  // generate loader string to be used with extract text plugin
  function generateLoaders (loader, loaderOptions) {
    const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]

    if (loader) {
      loaders.push({
        loader: loader + '-loader',
        options: Object.assign({}, loaderOptions, {
          sourceMap: options.sourceMap
        })
      })
    }

    // Extract CSS when that option is specified
    // (which is the case during production build)
    if (options.extract) {
      return ExtractTextPlugin.extract({
        use: loaders,
        fallback: 'vue-style-loader'
      })
    } else {
      return ['vue-style-loader'].concat(loaders)
    }
  }

  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
  return {
    css: generateLoaders(),
    postcss: generateLoaders(),
    less: generateLoaders('less'),
    sass: generateLoaders('sass', { indentedSyntax: true }),
    scss: generateLoaders('sass'),
    stylus: generateLoaders('stylus'),
    styl: generateLoaders('stylus')
  }
}

// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
  const output = []
  const loaders = exports.cssLoaders(options)

  for (const extension in loaders) {
    const loader = loaders[extension]
    output.push({
      test: new RegExp('\\.' + extension + '$'),
      use: loader
    })
  }

  return output
}

exports.createNotifierCallback = () => {
  const notifier = require('node-notifier')

  return (severity, errors) => {
    if (severity !== 'error') return

    const error = errors[0]
    const filename = error.file && error.file.split('!').pop()

    notifier.notify({
      title: packageConfig.name,
      message: severity + ': ' + error.name,
      subtitle: filename || '',
      icon: path.join(__dirname, 'logo.png')
    })
  }
}


================================================
FILE: build/vue-loader.conf.js
================================================
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
  ? config.build.productionSourceMap
  : config.dev.cssSourceMap

module.exports = {
  loaders: utils.cssLoaders({
    sourceMap: sourceMapEnabled,
    extract: isProduction
  }),
  cssSourceMap: sourceMapEnabled,
  cacheBusting: config.dev.cacheBusting,
  transformToRequire: {
    video: ['src', 'poster'],
    source: 'src',
    img: 'src',
    image: 'xlink:href'
  }
}


================================================
FILE: build/webpack.base.conf.js
================================================
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')

function resolve (dir) {
  return path.join(__dirname, '..', dir)
}

const createLintingRule = () => ({
  test: /\.(js|vue)$/,
  loader: 'eslint-loader',
  enforce: 'pre',
  include: [resolve('src'), resolve('test')],
  options: {
    formatter: require('eslint-friendly-formatter'),
    emitWarning: !config.dev.showEslintErrorsInOverlay
  }
})

module.exports = {
  context: path.resolve(__dirname, '../'),
  entry: {
    app: './src/main.js'
  },
  output: {
    path: config.build.assetsRoot,
    filename: '[name].js',
    publicPath: process.env.NODE_ENV === 'production'
      ? config.build.assetsPublicPath
      : config.dev.assetsPublicPath
  },
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': resolve('src'),
    }
  },
  module: {
    rules: [
      ...(config.dev.useEslint ? [createLintingRule()] : []),
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: vueLoaderConfig
      },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
      },
      {
        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('img/[name].[hash:7].[ext]')
        }
      },
      {
        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('media/[name].[hash:7].[ext]')
        }
      },
      {
        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
        }
      }
    ]
  },
  node: {
    // prevent webpack from injecting useless setImmediate polyfill because Vue
    // source contains it (although only uses it if it's native).
    setImmediate: false,
    // prevent webpack from injecting mocks to Node native modules
    // that does not make sense for the client
    dgram: 'empty',
    fs: 'empty',
    net: 'empty',
    tls: 'empty',
    child_process: 'empty'
  }
}


================================================
FILE: build/webpack.dev.conf.js
================================================
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')

const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)

const devWebpackConfig = merge(baseWebpackConfig, {
  module: {
    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
  },
  // cheap-module-eval-source-map is faster for development
  devtool: config.dev.devtool,

  // these devServer options should be customized in /config/index.js
  devServer: {
    clientLogLevel: 'warning',
    historyApiFallback: {
      rewrites: [
        { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
      ],
    },
    hot: true,
    contentBase: false, // since we use CopyWebpackPlugin.
    compress: true,
    host: HOST || config.dev.host,
    port: PORT || config.dev.port,
    open: config.dev.autoOpenBrowser,
    overlay: config.dev.errorOverlay
      ? { warnings: false, errors: true }
      : false,
    publicPath: config.dev.assetsPublicPath,
    proxy: config.dev.proxyTable,
    quiet: true, // necessary for FriendlyErrorsPlugin
    watchOptions: {
      poll: config.dev.poll,
    }
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': require('../config/dev.env')
    }),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
    new webpack.NoEmitOnErrorsPlugin(),
    // https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      inject: true
    }),
    // copy custom static assets
    new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../static'),
        to: config.dev.assetsSubDirectory,
        ignore: ['.*']
      }
    ])
  ]
})

module.exports = new Promise((resolve, reject) => {
  portfinder.basePort = process.env.PORT || config.dev.port
  portfinder.getPort((err, port) => {
    if (err) {
      reject(err)
    } else {
      // publish the new Port, necessary for e2e tests
      process.env.PORT = port
      // add port to devServer config
      devWebpackConfig.devServer.port = port

      // Add FriendlyErrorsPlugin
      devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
        compilationSuccessInfo: {
          messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
        },
        onErrors: config.dev.notifyOnErrors
        ? utils.createNotifierCallback()
        : undefined
      }))

      resolve(devWebpackConfig)
    }
  })
})


================================================
FILE: build/webpack.prod.conf.js
================================================
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

const env = process.env.NODE_ENV === 'testing'
  ? require('../config/test.env')
  : require('../config/prod.env')

const webpackConfig = merge(baseWebpackConfig, {
  module: {
    rules: utils.styleLoaders({
      sourceMap: config.build.productionSourceMap,
      extract: true,
      usePostCSS: true
    })
  },
  devtool: config.build.productionSourceMap ? config.build.devtool : false,
  output: {
    path: config.build.assetsRoot,
    filename: utils.assetsPath('js/[name].[chunkhash].js'),
    chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
  },
  plugins: [
    // http://vuejs.github.io/vue-loader/en/workflow/production.html
    new webpack.DefinePlugin({
      'process.env': env
    }),
    new UglifyJsPlugin({
      uglifyOptions: {
        compress: {
          warnings: false
        }
      },
      sourceMap: config.build.productionSourceMap,
      parallel: true
    }),
    // extract css into its own file
    new ExtractTextPlugin({
      filename: utils.assetsPath('css/[name].[contenthash].css'),
      // Setting the following option to `false` will not extract CSS from codesplit chunks.
      // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
      // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
      allChunks: true,
    }),
    // Compress extracted CSS. We are using this plugin so that possible
    // duplicated CSS from different components can be deduped.
    new OptimizeCSSPlugin({
      cssProcessorOptions: config.build.productionSourceMap
        ? { safe: true, map: { inline: false } }
        : { safe: true }
    }),
    // generate dist index.html with correct asset hash for caching.
    // you can customize output by editing /index.html
    // see https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: process.env.NODE_ENV === 'testing'
        ? 'index.html'
        : config.build.index,
      template: 'index.html',
      inject: true,
      minify: {
        removeComments: true,
        collapseWhitespace: true,
        removeAttributeQuotes: true
        // more options:
        // https://github.com/kangax/html-minifier#options-quick-reference
      },
      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
      chunksSortMode: 'dependency'
    }),
    // keep module.id stable when vendor modules does not change
    new webpack.HashedModuleIdsPlugin(),
    // enable scope hoisting
    new webpack.optimize.ModuleConcatenationPlugin(),
    // split vendor js into its own file
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor',
      minChunks (module) {
        // any required modules inside node_modules are extracted to vendor
        return (
          module.resource &&
          /\.js$/.test(module.resource) &&
          module.resource.indexOf(
            path.join(__dirname, '../node_modules')
          ) === 0
        )
      }
    }),
    // extract webpack runtime and module manifest to its own file in order to
    // prevent vendor hash from being updated whenever app bundle is updated
    new webpack.optimize.CommonsChunkPlugin({
      name: 'manifest',
      minChunks: Infinity
    }),
    // This instance extracts shared chunks from code splitted chunks and bundles them
    // in a separate chunk, similar to the vendor chunk
    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
    new webpack.optimize.CommonsChunkPlugin({
      name: 'app',
      async: 'vendor-async',
      children: true,
      minChunks: 3
    }),

    // copy custom static assets
    new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../static'),
        to: config.build.assetsSubDirectory,
        ignore: ['.*']
      }
    ])
  ]
})

if (config.build.productionGzip) {
  const CompressionWebpackPlugin = require('compression-webpack-plugin')

  webpackConfig.plugins.push(
    new CompressionWebpackPlugin({
      asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig


================================================
FILE: config/dev.env.js
================================================
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
  NODE_ENV: '"development"'
})


================================================
FILE: config/development/app.yaml
================================================
swagger: true

path:
#  log_folder: "/home/jianfengye/hade/log/"
#  runtime_folder: "/home/jianfengye/hade/runtime/"

dev: # 调试模式
    port: 8070 # 调试模式最终监听的端口,默认为8070
    backend: # 后端调试模式配置
        refresh_time: 3  # 调试模式后端更新时间,如果文件变更,等待3s才进行一次更新,能让频繁保存变更更为顺畅, 默认1s
        port: 8072 # 后端监听端口,默认8072
        monitor_folder: "" # 监听文件夹地址,为空或者不填默认为AppFolder
    frontend: # 前端调试模式配置
        port: 8071 # 前端监听端口, 默认8071


================================================
FILE: config/development/database.yaml
================================================
conn_max_idle: 10 # 通用配置,连接池最大空闲连接数
conn_max_open: 100 # 通用配置,连接池最大连接数
conn_max_lifetime: 1h # 通用配置,连接数最大生命周期
protocol: tcp # 通用配置,传输协议
loc: Local # 通用配置,时区

default:
    driver: mysql # 连接驱动
    dsn: "" # dsn,如果设置了dsn, 以下的所有设置都不生效
    host: localhost # ip地址
    port: 3306 # 端口
    database: coredemo # 数据库
    username: jianfengye # 用户名
    password: "123456789" # 密码
    charset: utf8mb4 # 字符集
    collation: utf8mb4_unicode_ci # 字符序
    timeout: 10s # 连接超时
    read_timeout: 2s # 读超时
    write_timeout: 2s # 写超时
    parse_time: true # 是否解析时间
    protocol: tcp # 传输协议
    loc: Local # 时区


================================================
FILE: config/development/deploy.yaml
================================================
connections: # 要自动化部署的连接
    - ssh.web-01

remote_folder: "/home/yejianfeng/coredemo/"  # 远端的部署文件夹

frontend: # 前端部署配置
    pre_action: # 部署前置命令
        - "pwd"
    post_action: # 部署后置命令
        - "pwd"

backend: # 后端部署配置
    goos: linux # 部署目标操作系统
    goarch: amd64 # 部署目标cpu架构
    pre_action: # 部署前置命令
        - "rm /home/yejianfeng/coredemo/hade"
    post_action: # 部署后置命令
        - "chmod 777 /home/yejianfeng/coredemo/hade"
        - "/home/yejianfeng/coredemo/hade app restart"


================================================
FILE: config/development/log.yaml
================================================
#driver: console
#formatter: text
#level: trace

#driver: single
#level: trace
#folder: /tmp/
#file: coredemo.log

driver: rotate # 切割日志
level: trace # 日志级别
#file: coredemo.log # 保存的日志文件
rotate_count: 10  # 最多日志文件个数
#rotate_size: 120000
#rotate_time: "1m"
max_age: "10d" # 文件保存时间
date_format: "%Y-%m-%d-%H-%M" # 文件后缀格式


================================================
FILE: config/development/ssh.yaml
================================================
timeout: 3s
network: tcp
web-01:
    host: 111.222.333.444 # ip地址
    port: 22 # 端口
    username: yejianfeng # 用户名
    password: "123456" # 密码
web-02:
    network: tcp
    host: localhost # ip地址
    port: 3306 # 端口
    username: jianfengye # 用户名
    rsa_key: "/Users/user/.ssh/id_rsa"
    known_hosts: "/Users/user/.ssh/known_hosts"


#host: localhost # ip地址
#port: 3306 # 端口
#username: jianfengye # 用户名
#password: "123456789" # 密码
#rsa_key: "~/.ssh/id_rsa"
#timeout: 1000
#network: tcp


================================================
FILE: config/index.js
================================================
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},

    // Various Dev Server settings
    host: 'localhost', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

    // Use Eslint Loader?
    // If true, your code will be linted during bundling and
    // linting errors and warnings will be shown in the console.
    useEslint: true,
    // If true, eslint errors and warnings will also be shown in the error overlay
    // in the browser.
    showEslintErrorsInOverlay: false,

    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    cssSourceMap: true
  },

  build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    /**
     * Source Maps
     */

    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}


================================================
FILE: config/prod.env.js
================================================
'use strict'
module.exports = {
  NODE_ENV: '"production"'
}


================================================
FILE: config/production/.gitkeeper
================================================


================================================
FILE: config/production/app.yaml
================================================
url: http://127.0.0.1:8066

swagger_open: true

dev_fresh: 1

path:
  storage: "/hade_sts/testdata/storage/"
  log: ""
  pid: ""
  cache: ""

================================================
FILE: config/production/database.yaml
================================================
mysql:
    hostname: 127.0.0.1
    username: yejianfeng
    password:  env(DB_PASSWORD)
    timeout: 1
    readtime: 2.3

default:
    driver: mysql
    hostname: localhost 
    database: hade
    username: root
    password: "123456"
    charset: utf8mb4
    collation: utf8mb4_unicode_ci

================================================
FILE: config/production/deploy.yaml
================================================
host: 127.0.0.1
user: yejianfeng
password: 123abc 
rsa_key: 
timeout: 1000
remote_path: "/home/yejianfeng/"
post_shell: 
  - "./hade serve restart"
  - "pwd"
goos: linux
goarch: amd64

================================================
FILE: config/production/gift.yaml
================================================
endpoint: ""
access_key: ""
secret_key: ""
use_ssl: true

================================================
FILE: config/production/log.yaml
================================================
driver: console 
level: trace

================================================
FILE: config/production/swagger.yaml
================================================
url: http://127.0.0.1:8069

================================================
FILE: config/test.env.js
================================================
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')

module.exports = merge(devEnv, {
  NODE_ENV: '"testing"'
})


================================================
FILE: config/testing/app.yaml
================================================
swagger: true

path:
#  log_folder: "/home/jianfengye/hade/log/"
#  runtime_folder: "/home/jianfengye/hade/runtime/"

dev: # 调试模式
    port: 8070 # 调试模式最终监听的端口,默认为8070
    backend: # 后端调试模式配置
        refresh_time: 3  # 调试模式后端更新时间,如果文件变更,等待3s才进行一次更新,能让频繁保存变更更为顺畅, 默认1s
        port: 8072 # 后端监听端口,默认8072
        monitor_folder: "" # 监听文件夹地址,为空或者不填默认为AppFolder
    frontend: # 前端调试模式配置
        port: 8071 # 前端监听端口, 默认8071


================================================
FILE: config/testing/cache.yaml
================================================
driver: redis # 连接驱动
host: 127.0.0.1 # ip地址
port: 6379 # 端口
db: 0 #db
timeout: 10s # 连接超时
read_timeout: 2s # 读超时
write_timeout: 2s # 写超时

#driver: memory # 连接驱动


================================================
FILE: config/testing/database.yaml
================================================
conn_max_idle: 10 # 通用配置,连接池最大空闲连接数
conn_max_open: 100 # 通用配置,连接池最大连接数
conn_max_lifetime: 1h # 通用配置,连接数最大生命周期
protocol: tcp # 通用配置,传输协议
loc: Local # 通用配置,时区

default:
    driver: mysql # 连接驱动
    dsn: "" # dsn,如果设置了dsn, 以下的所有设置都不生效
    host: localhost # ip地址
    port: 3306 # 端口
    database: coredemo # 数据库
    username: jianfengye # 用户名
    password: "123456789" # 密码
    charset: utf8mb4 # 字符集
    collation: utf8mb4_unicode_ci # 字符序
    timeout: 10s # 连接超时
    read_timeout: 2s # 读超时
    write_timeout: 2s # 写超时
    parse_time: true # 是否解析时间
    protocol: tcp # 传输协议
    loc: Local # 时区
    conn_max_idle: 10 # 连接池最大空闲连接数
    conn_max_open: 20 # 连接池最大连接数
    conn_max_lifetime: 1h # 连接数最大生命周期

read:
    driver: mysql # 连接驱动
    dsn: "" # dsn,如果设置了dsn, 以下的所有设置都不生效
    host: localhost # ip地址
    port: 3306 # 端口
    database: coredemo # 数据库
    username: jianfengye # 用户名
    password: "123456789" # 密码
    charset: utf8mb4 # 字符集
    collation: utf8mb4_unicode_ci # 字符序


================================================
FILE: config/testing/deploy.yaml
================================================
connections:
    - ssh.web-01
    - ssh.web-02

remote_path: "/home/jianfengye/hade"

frontend:
    pre_action:
        - "pwd"
    post_action:
        - "pwd"

backend:
    goos: linux
    goarch: amd64
    pre_action:
        - "pwd"
    post_action:
        - "./hade serve restart"


================================================
FILE: config/testing/log.yaml
================================================
#driver: console
#formatter: text
#level: trace

#driver: single
#level: trace
#folder: /tmp/
#file: coredemo.log

driver: rotate # 切割日志
level: trace # 日志级别
#file: coredemo.log # 保存的日志文件
rotate_count: 10  # 最多日志文件个数
#rotate_size: 120000
#rotate_time: "1m"
max_age: "10d" # 文件保存时间
date_format: "%Y-%m-%d-%H-%M" # 文件后缀格式


================================================
FILE: config/testing/redis.yaml
================================================
timeout: 10s # 连接超时
read_timeout: 2s # 读超时
write_timeout: 2s # 写超时

write:
    host: 127.0.0.1 # ip地址
    port: 6379 # 端口
    db: 0 #db
    timeout: 10s # 连接超时
    read_timeout: 2s # 读超时
    write_timeout: 2s # 写超时


================================================
FILE: config/testing/ssh.yaml
================================================
timeout: 1s
network: tcp
web-01:
    host: 118.190.3.55 # ip地址
    port: 22 # 端口
    username: yejianfeng # 用户名
    password: "123456" # 密码
web-02:
    network: tcp
    host: localhost # ip地址
    port: 3306 # 端口
    username: jianfengye # 用户名
    rsa_key: "/Users/user/.ssh/id_rsa"
    known_hosts: "/Users/user/.ssh/known_hosts"


#host: localhost # ip地址
#port: 3306 # 端口
#username: jianfengye # 用户名
#password: "123456789" # 密码
#rsa_key: "~/.ssh/id_rsa"
#timeout: 1000
#network: tcp


================================================
FILE: config/testing/swagger.yaml
================================================
url: http://127.0.0.1:8069

================================================
FILE: docs/.vuepress/config.js
================================================
module.exports = {
    title: "hade框架", // 设置网站标题
    description: "一个支持前后端开发的基于协议的框架", //描述
    dest: "./dist/", // 设置输出目录
    port: 2333, //端口
    base: "/v1.0/",
    head: [["link", {rel: "icon", href: "/assets/img/head.png"}]],
    themeConfig: {
        //主题配置
        // logo: "/assets/img/head.png",
        // 添加导航栏
        nav: [
            {text: "主页", link: "/"}, // 导航条
            {text: "使用文档", link: "/guide/"},
            {text: "服务提供者", link: "/provider/"},
            {
                text: "github",
                // 这里是下拉列表展现形式。
                items: [
                    {
                        text: "hade",
                        link: "https://github.com/gohade/hade",
                    },
                ],
            },
        ],
        // 为以下路由添加侧边栏
        sidebar: {
            "/guide/": [
                {
                    title: "指南",
                    collapsable: false,
                    children: [
                        "introduce",
                        "install",
                        "build",
                        "structure",
                        "app",
                        "env",
                        "dev",
                        "command",
                        "cron",
                        "middleware",
                        "swagger",
                        "provider",
                        "todo",
                    ],
                },
            ],
            "/provider/": [
                {
                    title: "服务提供者",
                    collapsable: false,
                    children: [
                        "app",
                        "env",
                        "config",
                        "log",
                    ],
                },
            ],
        },
    },
};



================================================
FILE: docs/.vuepress/enhanceApp.js
================================================

export default ({ Vue }) => {
};


================================================
FILE: docs/README.md
================================================
---
home: true
actionText: 开始体验
actionLink: /guide/introduce
footer: MIT Licensed | Copyright © 2020-present jianfengye
features:
  - title: 基于协议 
    details: 服务与服务间的协议是基于协议进行交互的。
  - title: 前后端协同 
    details: 前后端协同开发 
  - title: 命令行 
    details: 有充分的命令行工具 
  - title: 集成定时服务
    details: 如果你需要启动定时服务,提供命令进行定时服务的启动 
  - title: 文档丰富 
    details: 提供丰富的文档说明,提供丰富的文档说明 
  - title: 开发模式
    details: 在开发模式下进行前后端开发,极大提高了开发效率和开发体验

================================================
FILE: docs/guide/README.md
================================================
# 指南 

---

hade是一个注重协议,注重开发效率的前后端一体化框架。hade框架的目标在于将go+vue模型的应用开发最简化,并且提供统一,一体化的脚手架工具促进业务开发。

================================================
FILE: docs/guide/app.md
================================================
# 运行

## 命令

这里的运行是运行整个 app,这个 app 可以只包含后端,也可以只包含前端,但是后端也是隐藏在前端后面运行。具体可以参考 app/http/route.go

```
package http

import (
	"github.com/gohade/hade/app/http/controller/demo"
	"github.com/gohade/hade/framework/gin"
)

func Routes(r *gin.Engine) {
	r.Static("/dist/", "./dist/")
	r.GET("/demo/demo", demo.Demo)
}

```

运行相关的命令为 app。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade app
start app serve

Usage:
  hade app [flags]
  hade app [command]

Available Commands:
  restart     restart app server
  start       start app server
  state       get app pid
  stop        stop app server

Flags:
  -h, --help   help for app

Use "hade app [command] --help" for more information about a command.
```

## 启动

可以使用 `./hade app start` 启动一个应用。

也可以使用 `./hade app start -d` 使用 deamon 模式启动一个应用。应用名称为 `hade app`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade app start -d
app serve started
log file: /Users/Documents/workspace/hade_workspace/demo5/storage/log/app.log
```

app 应用的输出记录在 `/storage/log/app.log`

进程 id 记录在 `/storage/pid/app.pid`

## 状态

当使用 deamon 模式启动的时候,需要查看当前应用是否有启动,如果启动了,进程号是多少,可以使用命令 `./hade app state`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade app state
app server started, pid: 28170
```

## 重启

当使用 deamon 模式启动的时候,需要重启应用,可以使用命令 `./hade app restart`

::: tip
如果程序还未启动,调用 restart 命令,效果和 start 命令一样,deamon 模式启动应用
:::

## 停止

当使用 deamon 模式启动的时候,需要关闭应用,可以使用命令 `./hade app stop`


================================================
FILE: docs/guide/build.md
================================================
# 编译

---

## 命令

应用分为前端(frontend)和后端(backend),所以编译也分为三类
- 编译前端 
- 编译后端 
- 自编译
- 同时编译

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade build
build hade command

Usage:
  hade build [flags]
  hade build [command]

Available Commands:
  all         build fronend and backend
  backend     build backend use go
  frontend    build frontend use npm
  self        build ./hade command

Flags:
  -h, --help   help for build

Use "hade build [command] --help" for more information about a command.
```

## 编译前端

要求当前编译机器安装 npm 软件,并且当前项目已经运行了 npm install,安装完成前端依赖。

运行命令 `./hade build frontend`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade build frontend

> hade@0.1.0 build /Users/Documents/workspace/hade_workspace/demo5
> vue-cli-service build


-  Building for production...
 DONE  Compiled successfully in 5012ms下午5:44:47

  File                                      Size             Gzipped

  dist/asset/js/chunk-vendors.222f9fef.j    117.96 KiB       42.76 KiB
  s
  dist/asset/js/index.0ed60f05.js           4.63 KiB         1.66 KiB
  dist/asset/css/index.fa7f2f34.css         0.33 KiB         0.23 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

front end build success
```

编译后的前端文件在 dist 目录中

实际上 build 就是调用 `npm build` 来编译前端项目。


## 编译后端

要求当前编译机器安装 go 软件,版本 > 1.3。

运行命令: `./hade build backend`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade build backend
build success please run ./hade direct
```

在项目根目录下就看到生成的可执行文件 hade。 后续可以通过 ./hade 直接运行。

## 自编译

在项目根目录下,hade 可以通过 hade 命令编译出 hade 命令自己。通过命令 `hade build self`

```
[~/Documents/workspace/hade_workspace/demo5]$ hade build self
build success please run ./hade direct
```

在项目根目录下就看到生成的可执行文件 hade。 后续可以通过 ./hade 直接运行。

::: tip
其实自编译和后端编译是同样效果,但是为了命令语义化,增加了自编译的命令。
:::

## 同时编译

顾名思义,同时编译前端和后端,命令为 `./hade build all`

================================================
FILE: docs/guide/command.md
================================================
# 命令

## 指南

hade 允许自定义命令,挂载到 hade 上。并且提供了`./hade command` 系列命令。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade command
all about commond

Usage:
  hade command [flags]
  hade command [command]

Available Commands:
  list        show all command list
  new         create a command

Flags:
  -h, --help   help for command

Use "hade command [command] --help" for more information about a command.
```

- list  // 列出当前所有已经挂载的命令列表
- new   // 创建一个新的自定义命令

## 创建

创建一个新命令,可以使用 `./hade command new`

这是一个交互式的命令行工具。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade command new
create a new command...
? please input command name: test
? please input file name(default: command name):
create new command success,file path: /Users/Documents/workspace/hade_workspace/demo5/app/console/command/test.go
please remember add command to console/kernel.go
```

创建完成之后,会在应用的 app/console/command/ 目录下创建一个新的文件。

## 自定义

hade 中的命令使用的是 cobra 库。 https://github.com/spf13/cobra

```
package command

import (
        "fmt"

        "github.com/gohade/hade/framework/cobra"
        "github.com/gohade/hade/framework/command/util"
)

var TestCommand = &cobra.Command{
        Use:   "test",
        Short: "test",
        RunE: func(c *cobra.Command, args []string) error {
                container := util.GetContainer(c.Root())
                fmt.Println(container)
                return nil
        },
}

```

基本上,我们要求实现 
- Use // 命令行的关键字
- Short // 命令行的简短说明
- RunE // 命令行实际运行的程序

更多配置和参数可以参考 [cobra 的 github 页面](https://github.com/spf13/cobra)

## 挂载

编写完自定义命令后,请记得挂载到 console/kernel.go 中。

``` golang
func RunCommand(container framework.Container) error {
	var rootCmd = &cobra.Command{
		Use:   "hade",
		Short: "main",
		Long:  "hade commands",
	}

	ctx := commandUtil.RegiestContainer(container, rootCmd)

	hadeCommand.AddKernelCommands(rootCmd)

    rootCmd.AddCommand(command.DemoCommand)

	return rootCmd.ExecuteContext(ctx)
}

```

================================================
FILE: docs/guide/cron.md
================================================
# 定时任务

## 指南

hade 中的定时任务是以命令的形式存在。hade 中也定义了一个命令 `./hade cron` 来对定时任务服务进行管理。

```
about cron command

Usage:
  hade cron [flags]
  hade cron [command]

Available Commands:
  list        list all cron command
  restart     restart cron command
  start       start cron command
  state       cron serve state
  stop        stop cron command

Flags:
  -h, --help   help for cron

Use "hade cron [command] --help" for more information about a command.
```

# 创建

创建一个定时任务和创建命令(command)是一致的。具体参考[command](/guide/command)

# 挂载

和挂载命令稍微有些不同,使用的方法是 `AddCronCommand`

```
rootCmd.AddCronCommand("* * * * *", command.DemoCommand)
```

# 查询

查询哪些定时任务挂载在服务上,使用命令 `./hade cron list`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade cron list
* * * * *  demo  demo
```

# 启动

使用命令 `./hade cron start` 启动一个定时服务
```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade cron start
start cron job
[PID] 35453
```

也可以通过 `./hade cron start -d` 使用 deamon 模式启动一个定时服务

定时服务的输出记录在 `/storage/log/cron.log`

进程 id 记录在 `/storage/pid/app.pid`

# 状态

使用 deamon 模式启动定时服务的时候,可以使用命令 `./hade cron state` 查询定时任务状态

# 停止

使用 deamon 模式启动定时服务的时候,可以使用命令 `./hade cron stop` 停止定时任务

# 重启

使用 deamon 模式启动定时服务的时候,可以使用命令 `./hade cron restart` 重启定时任务


::: tip
如果程序还未启动,调用 restart 命令,效果和 start 命令一样,deamon 模式启动定时服务
:::




================================================
FILE: docs/guide/dev.md
================================================
# 调试模式

## 命令

hade 框架自带调试模式,不管是前端还是后端,都可以启动调试模式,边修改代码,边编译运行服务。

对应的命令为 `./hade dev`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade dev
dev mode

Usage:
  hade dev [flags]
  hade dev [command]

Available Commands:
  all         dev mode from both frontend and backend
  backend     dev mode for backend, hot reload
  frontend    dev mode for frontend

Flags:
  -h, --help   help for dev

Use "hade dev [command] --help" for more information about a command.
```

- 调试前端
- 调试后端
- 同时调试

## 调试前端

使用命令 `./hade dev frontend`

要求当前编译机器安装 npm 软件,并且当前项目已经运行了 npm install,安装完成前端依赖。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade dev frontend

> hade@0.1.0 serve /Users/Documents/workspace/hade_workspace/demo5
> vue-cli-service serve

 INFO  Starting development server...
98% after emitting

 DONE  Compiled successfully in 2589ms                                                                                                     下午6:07:06


  App running at:
  - Local:   http://localhost:8080
  - Network: http://172.24.34.34:8080

  Note that the development build is not optimized.
  To create a production build, run npm run build.
```

实际上是调用 `npm run dev` 来调试前端

## 调试后端

使用命令 `./hade dev backend`

要求当前编译机器安装 go 软件,版本 > 1.3。

```
[~/Documents/workspace/hade_workspace/demo5]$  ./hade dev backend
./hade dev backend
build success please run ./hade direct
backend server: http://127.0.0.1:15060
proxy backend server: http://0.0.0.0:8073
[PID] 29034
app serve url: http://127.0.0.1:15060
```

可以通过 proxy backend server 地址进行访问: 

`http://0.0.0.0:8073/demo/demo`

::: tip
后端调试默认是最后一次操作后3秒启动后端编译启动命令。

hade 也允许通过配置修改这个等待时间。

可以配置 `development/app.yaml` 里面的 `dev_fresh` 参数修改这个等待时间。
:::

# 同时调试

也可以选择同时调试,这个时候会同时运行调试前端和调试后端的程序

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade dev all

> hade@0.1.0 serve /Users/Documents/workspace/hade_workspace/demo5
> vue-cli-service serve

 INFO  Starting development server...
build success please run ./hade direct
backend server: http://127.0.0.1:19866
proxy backend server: http://0.0.0.0:8073
proxy frontend server: http://0.0.0.0:8073/dist/#/
[PID] 29761
app serve url: http://127.0.0.1:19866
98% after emitting

 DONE  Compiled successfully in 1421ms                                                                                                     下午6:19:51


  App running at:
  - Local:   http://localhost:19073
  - Network: http://172.24.34.34:19073

  Note that the development build is not optimized.
  To create a production build, run npm run build.

[GIN] 2020/09/16 - 18:20:26 | 200 |     134.079µs |       127.0.0.1 | GET      /demo/demo

```

前端和后端的访问地址分别为:

```
proxy backend server: http://0.0.0.0:8073
proxy frontend server: http://0.0.0.0:8073/dist/#/
```

================================================
FILE: docs/guide/env.md
================================================
# 环境变量

## 设置

hade 支持使用应用默认下的隐藏文件 `.env` 来配置各个机器不同的环境变量。

```
APP_ENV=development

DB_PASSWORD=mypassword
```

环境变量的设置可以在配置文件中通过 `env([环境变量])` 来获取到。

比如:

```
mysql:
    hostname: 127.0.0.1
    username: yejianfeng
    password:  env(DB_PASSWORD)
    timeout: 1
    readtime: 2.3
```


## 应用环境

hade 启动应用的默认应用环境为 development。

你可以通过设置 .env 文件中的 APP_ENV 设置应用环境。

应用环境建议选择:
- development // 开发使用
- production // 线上使用
- testing //测试环境

应用环境对应配置的文件夹,配置服务会去对应应用环境的文件夹中寻找配置。

比如应用环境为 development,在代码中使用
```
configService := container.MustMake(contract.ConfigKey).(contract.Config)
url := configService.GetString("app.url")
```

查找文件为:`config/development/app.yaml`

通过命令`./hade env`也可以获取当前应用环境:

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade env
environment: development
```

================================================
FILE: docs/guide/install.md
================================================
# 安装

---
## 可执行文件

我们有两种方式来获取可执行的hade文件,第一种是直接下载对应操作系统的hade文件,另外一种是下载源码自己编译

### 直接下载

下载地址:
xxx

将生成的可执行文件 hade 放到 $PATH 目录中:
`cp hade /usr/local/bin/`

### 源码编译

下载 git 地址:`git@github.com/jianfengye/hade:cloud/hade.git` 到目录 hade

在 hade 目录中运行命令 `go run main.go build self` 

将生成的可执行文件 hade 放到 $PATH 目录中:
`cp hade /usr/local/bin/`


## 初始化项目

使用命令 `hade new [app]` 在当前目录创建子项目

```
[~/Documents/workspace/hade_workspace]$ hade new --help
create a new app

Usage:
  hade new [app] [flags]

Aliases:
  new, create, init

Flags:
  -f, --force        if app exist, overwrite app, default: false
  -h, --help         help for new
  -m, --mod string   go mod name, default: folder name
```

你可以通过 --mod 来定义项目名字的模块名字,默认项目名,目录名,模块名是相同的

接下来,可以通过命令 `go run main.go` 看到如下信息:

```
[~/Documents/workspace/hade_workspace/demo5]$ go run main.go
hade commands

Usage:
  hade [command]

Available Commands:
  app         start app serve
  build       build hade command
  command     all about commond
  cron        about cron command
  deploy      deploy app by ssh
  dev         dev mode
  env         get current environment
  help        get help info
  middleware  hade middleware
  new         create a new app
  provider    about hade service provider
  swagger     swagger operator

Flags:
  -h, --help   help for hade

Use "hade [command] --help" for more information about a command.
```

至此,项目安装成功。


================================================
FILE: docs/guide/introduce.md
================================================
# 介绍

---

hade是一个注重协议,注重开发效率的前后端一体化框架。hade框架的目标在于将go+vue模型的应用开发最简化,并且提供统一,一体化的脚手架工具促进业务开发。

我们相信在GO的框架开发中,指定协议比实现更为重要。hade框架对于具体应用开发者来说最便利的功能,在于其制定了一系列的基本协议,在具体的业务逻辑中,可以通过每个协议独特的Key来从全局容器中获取已经注入的服务实例。所有的具体应用开发,在业务逻辑中,都是按照hade约定的协议进行逻辑处理,从而脱离了具体的每个服务所定义的个性化差异。


================================================
FILE: docs/guide/middleware.md
================================================
# 中间件

## 指南
hade 的 HTTP 路由服务并没有自己开发,而是使用 gin。gin 生态已经有非常完善的(中间件体系)[https://github.com/gin-contrib]。

我们没有必要重新开发这些中间件。所以 hade 框架提供了 middleware 命令来获取这些中间件。(不能直接使用go get 的方式来获取,因为 hade 在 gin 基础上做了一些微调)

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade middleware
hade middleware

Usage:
  hade middleware [flags]
  hade middleware [command]

Available Commands:
  add         add middleware to app, https://github.com/gin-contrib/[middleware].git
  list        list all installed middleware
  remove      remove middleware from app

Flags:
  -h, --help   help for middleware

Use "hade middleware [command] --help" for more information about a command.
```

## 安装

可以安装 https://github.com/gin-contrib/ 项目中的任何中间件,使用命令 `./hade middleware add gzip`

命令会从 https://github.com/gin-contrib/gzip.git 项目中下载中间件,并且安装到 `app/http/middleware` 中。

## 查询

检查目前已经安装了哪些中间件,可以使用命令 `./hade middleware list`

## 删除

删除某个中间件,可以使用命令 `./hade middleware remove`

================================================
FILE: docs/guide/provider.md
================================================
# 服务提供者

## 指南

hade框架使用ServiceProvider机制来满足协议,通过service Provder提供某个协议服务的具体实现。这样如果开发者对具体的实现协议的服务类的具体实现不满意,则可以很方便的通过切换具体协议的Service Provider来进行具体服务的切换。

一个ServiceProvider是一个单独的文件夹,它包含服务提供和服务实现。具体可以参考framework/provider/demo

一个SerivceProvider就是一个独立的包,这个包可以作为插件独立地发布和分享。

你也可以定义一个无contract的ServiceProvider,其中的Name()需要保证唯一。

## 创建

我们可以使用命令 `./hade provider new` 来创建一个新的service provider

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade provider new
create a provider
? please input provider name test
? please input provider folder(default: provider name):
create provider success, folder path: /Users/Documents/workspace/hade_workspace/demo5/app/provider/test
please remember add provider to kernel
```

该命令会在`app/provider/` 目录下创建一个对应的服务提供者。并且初始化好三个文件: `contract.go`, `provider.go`, `service.go`

## 自定义

我们需要编写这三个文件:

### contract.go

contract.go 定义了这个服务提供方提供的协议接口。hade 框架任务,作为一个业务的服务提供者,定义一个好的协议是最重要的事情。

所以 contract.go 中定义了一个 Service 接口,在其中定义各种方法,包含输入参数和返回参数。

```
package demo

const DemoKey = "demo"

type IService interface {
	GetAllStudent() []Student
}

type Student struct {
	ID   int
	Name string
}

```

其中还定义了一个Key, 这个 Key 是全应用唯一的,服务提供者将服务以 Key 关键字注入到容器中。服务使用者使用 Key 关键字获取服务。

### provider

provider.go 提供服务适配的实现,实现一个Provider必须实现对应的五个方法
```
package demo

import (
	"github.com/gohade/hade/framework"
)

type DemoProvider struct {
	framework.ServiceProvider

	c framework.Container
}

func (sp *DemoProvider) Name() string {
	return DemoKey
}

func (sp *DemoProvider) Register(c framework.Container) framework.NewInstance {
	return NewService
}

func (sp *DemoProvider) IsDefer() bool {
	return false
}

func (sp *DemoProvider) Params() []interface{} {
	return []interface{}{sp.c}
}

func (sp *DemoProvider) Boot(c framework.Container) error {
	sp.c = c
	return nil
}
```

- Name() // 指定这个服务提供者提供的服务对应的接口的关键字
- Register() // 这个服务提供者注册的时候调用的方法,一般是指定初始化服务的函数名
- IsDefer() // 这个服务是否是使用时候再进行初始化,false为注册的时候直接进行初始化服务
- Params() // 初始化服务的时候对服务注入什么参数,一般把 container 注入到服务中
- Boot() // 初始化之前调用的函数,一般设置一些全局的Provider


### service.go

service.go提供具体的实现,它至少需要提供一个实例化的方法 `NewService(params ...interface{}) (interface{}, error)`。

```
package demo

import "github.com/gohade/hade/framework"

type Service struct {
	container framework.Container
}

func NewService(params ...interface{}) (interface{}, error) {
	container := params[0].(framework.Container)
	return &Service{container: container}, nil
}

func (s *Service) GetAllStudent() []Student {
	return []Student{
		{
			ID:   1,
			Name: "foo",
		},
		{
			ID:   2,
			Name: "bar",
		},
	}
}

```

## 注入

hade的路由,controller的定义是选择基于gin框架进行扩展的。所有的gin框架的路由,参数获取,验证,context都和gin框架是相同的。唯一不同的是gin的全局路由gin.Engine实现了hade的容器结构,可以对gin.Engine进行服务提供的注入,且可以从context中获取具体的服务。

hade提供两种服务注入的方法:
* Bind: 将一个ServiceProvider绑定到容器中,可以控制其是否是单例
* Singleton: 将一个单例ServiceProvider绑定到容器中

建议在文件夹 `app/provider/kernel.go` 中进行服务注入

``` golang 
func RegisterCustomProvider(c framework.Container) {
	c.Bind(&demo.DemoProvider{}, true)
}
```

当然你也可以在某个业务模块路由注册的时候进行服务注入

``` golang
func Register(r *gin.Engine) error {
	api := NewDemoApi()
	r.Container().Singleton(&demoService.DemoProvider{})

	r.GET("/demo/demo", api.Demo)
	r.GET("/demo/demo2", api.Demo2)
	return nil
}
```

## 获取

hade提供了三种服务获取的方法:
* Make: 根据一个Key获取服务,获取不到获取报错
* MustMake: 根据一个Key获取服务,获取不到返回空
* MakeNew: 根据一个Key获取服务,每次获取都实例化,对应的ServiceProvider必须是以非单例形式注入

你可以在任意一个可以获取到 container 的地方进行服务的获取。

业务模块中:

```
func (api *DemoApi) Demo2(c *gin.Context) {
	demoProvider := c.MustMake(demoService.DemoKey).(demoService.IService)
	students := demoProvider.GetAllStudent()
	usersDTO := StudentsToUserDTOs(students)
	c.JSON(200, usersDTO)
}
```

命令行中:

``` golang
var CenterCommand = &cobra.Command{
	Use:   "direct_center",
	Short: "计算区域中心点",
	RunE: func(c *cobra.Command, args []string) error {
		container := util.GetContainer(c.Root())
		app := container.MustMake(contract.AppKey).(contract.App)
        return nil
    }
```

甚至于另外一个服务提供者中:

``` golang 
type Service struct {
	c framework.Container

	baseURL string
	userID  string
	token   string
	logger  contract.Log
}

func NewService(params ...interface{}) (interface{}, error) {
	c := params[0].(framework.Container)
	config := c.MustMake(contract.ConfigKey).(contract.Config)
	baseURL := config.GetString("app.stsmap.url")
	userID := config.GetString("app.stsmap.user_id")
	token := config.GetString("app.stsmap.token")

	logger := c.MustMake(contract.LogKey).(contract.Log)
	return &Service{baseURL: baseURL, logger: logger, userID: userID, token: token}, nil
}

```

## hade provider

hade 框架默认自带了一些服务提供者,提供基础的服务接口协议,可以通过 `./hade provider list` 来获取已经安装的服务提供者。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade provider list
hade:app
hade:env
hade:config
hade:log
hade:ssh
hade:kernel
```

hade 框架自带的服务提供者的 key 是以 `hade:` 开头。目的为的是与自定义服务提供者的 key 区别开。

hade 框架自带的服务提供者具体定义的协议可以参考:[provider](/provider/)

================================================
FILE: docs/guide/structure.md
================================================
# 目录结构

hade 框架不仅仅是一个类库,也是一个定义了开发模式和目录结构的框架。 hade 希望所有使用这个框架的开发人员遵照统一的项目结构进行开发。

## 默认目录结构
默认创建的项目结构为:

```
[~/Documents/workspace/hade_workspace/demo5]$ tree
.
├── README.md
├── app // 服务端应用地址
│   ├── console  // 存放自定义命令
│   │   ├── command
│   │   │   └── demo.go
│   │   └── kernel.go
│   ├── http  // 存放http服务
│   │   ├── helper // 帮助类库
│   │   │   ├── request.go
│   │   │   └── response.go
│   │   ├── kernel.go
│   │   ├── middleware // 中间件
│   │   ├── module // 业务模块
│   │   │   └── demo 
│   │   │       ├── api.go // 业务模块接口
│   │   │       ├── dto.go // 业务模块输出结构
│   │   │       ├── mapper.go // 将服务结构转换为业务模块输出结构
│   │   │       ├── model.go // 数据库结构定义
│   │   │       ├── repository.go // 数据库逻辑封装层
│   │   │       └── service.go // 服务层
│   │   ├── route.go // 路由配置
│   │   ├── swagger // swagger文件自动生成 
│   │   └── swagger.go
│   └── provider // 服务提供方
│       ├── demo
│       │   ├── contract.go // 服务接口层
│       │   ├── provider.go // 服务提供方
│       │   └── service.go // 服务实现层
│       └── kernel.go // 服务提供方注入
├── babel.config.js
├── config // 配置文件
│   ├── development // development环境
│   │   ├── app.yaml // app主应用的配置
│   │   ├── database.yaml // 数据库相关配置
│   │   ├── deploy.yaml // 部署相关配置
│   │   ├── log.yaml // 日志相关配置
│   │   └── swagger.yaml // swagger相关配置
│   ├── production
│   └── testing
├── dist // 编译生成地址
├── frontend // 前端应用地址
│   ├── App.vue // vue入口文件
│   ├── assets
│   │   └── logo.png
│   ├── components // vue组件
│   │   └── HelloWorld.vue
│   └── main.js // 前端入口文件
├── go.mod
├── go.sum
├── main.go // app入口
├── package.json // 前端package
├── storage // 存储目录
│   ├── cache // 存放本地缓存
│   ├── coverage // 存放覆盖率报告
│   ├── log // 存放业务日志
│   └── pid // 存放pid
│       └── app.pid
├── tests // 测试相关数据
│   └── env.go // 设置测试环境相关参数
└── vue.config.js // vue配置

25 directories, 37 files
```

这里主要介绍下业务模块的分层结构

# 业务模块分层

业务模块的分层设计两种分层模型:简化模型和标准模型。基本稍微复杂一些的业务,都需要使用标准模型开发。

## 简化模型

对于比较简单的业务,每个模块各自定义自己的 model 和 service,在一个 module 文件的文件夹中进行各自模块的业务开发

![20200916111330](http://tuchuang.funaio.cn/md/20200916111330.png)

```
├── api.go // 业务模块接口
├── dto.go // 业务模块输出结构
├── mapper.go // 将服务结构转换为业务模块输出结构
├── model.go // 数据库结构定义
├── repository.go // 数据库逻辑封装层
└── service.go // 服务
```

具体实现可以参考初始化代码的 Demo 接口实现

## 标准模型

对于比较复杂的业务,模块与模块间的交互比较复杂,有很多公用性,所以提取 service provider 服务作为服务间的相互调用。

::: tip
强烈建议使用这种开发模型
:::


![20200916111454](http://tuchuang.funaio.cn/md/20200916111454.png)


第一步:创建当前业务的 provider。可以使用命令行 `./hade provider new` 来创建。
```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade provider new
create a provider
? please input provider name car
? please input provider folder(default: provider name):
create provider success, folder path: /Users/xxx/Documents/workspace/hade_workspace/demo5/app/provider/car
please remember add provider to kernel
```

定义好 provider 的协议

```
package demo

const DemoKey = "demo"

type IService interface {
	GetAllStudent() []Student
}

type Student struct {
	ID   int
	Name string
}

```

实现对应协议:

```
package demo

import "github.com/gohade/hade/framework"

type Service struct {
	container framework.Container
}

func NewService(params ...interface{}) (interface{}, error) {
	container := params[0].(framework.Container)
	return &Service{container: container}, nil
}

func (s *Service) GetAllStudent() []Student {
	return []Student{
		{
			ID:   1,
			Name: "foo",
		},
		{
			ID:   2,
			Name: "bar",
		},
	}
}

```

第二步:创建当前业务的模块。

可以按照demo文件夹中文件编写。

![20200916172527](http://tuchuang.funaio.cn/md/20200916172527.png)

第三步:在当前业务中挂载业务模块。

![20200916172752](http://tuchuang.funaio.cn/md/20200916172752.png)

第四步:使用 provider 来开发当前业务。

``` golang
// Demo godoc
// @Summary 获取所有学生
// @Description 获取所有学生
// @Produce  json
// @Tags demo
// @Success 200 array []UserDTO
// @Router /demo/demo2 [get]
func (api *DemoApi) Demo2(c *gin.Context) {
	demoProvider := c.MustMake(demoService.DemoKey).(demoService.IService)
	students := demoProvider.GetAllStudent()
	usersDTO := StudentsToUserDTOs(students)
	c.JSON(200, usersDTO)
}
```

具体实现可以参考初始化代码的 Demo2 接口实现


================================================
FILE: docs/guide/swagger.md
================================================
# swagger

## 命令

hade 使用 [swaggo](https://github.com/swaggo/swag) 集成了 swagger 生成和服务项目。并且封装了 `./hade swagger` 命令。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade swagger
swagger operator

Usage:
  hade swagger [flags]
  hade swagger [command]

Available Commands:
  gen         generate swagger file, contain swagger.yaml, doc.go
  serve       use gen serve

Flags:
  -h, --help   help for swagger

Use "hade swagger [command] --help" for more information about a command.
```

- gen  // 生成swagger文件
- serve // 提供swagger服务

## 注释

hade 使用 [swaggo](https://github.com/swaggo/swag) 来实现注释生成 swagger 功能。

全局注释在文件  `app/http/swagger.go` 中:
```
// Package http API.
// @title hade
// @version 1.0
// @description hade测试
// @termsOfService https://github.com/swaggo/swag

// @contact.name yejianfeng
// @contact.email yejianfeng

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host localhost:8989
// @BasePath /api
// @query.collection.format multi

// @securityDefinitions.basic BasicAuth

// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization

// @x-extension-openapi {"example": "value on a json format"}

package http

```

接口注释请写在各自模块的 api.go 中

```
// Demo godoc
// @Summary 获取所有用户
// @Description 获取所有用户
// @Produce  json
// @Tags demo
// @Success 200 array []UserDTO
// @Router /demo/demo [get]
func (api *DemoApi) Demo(c *gin.Context) {
	users := api.service.GetUsers()
	usersDTO := UserModelsToUserDTOs(users)
	c.JSON(200, usersDTO)
}
```

swagger 注释的格式和关键词可以参考:[swaggo](https://github.com/swaggo/swag)

## 生成

使用命令 `./hade swagger gen`

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade swagger gen
2020/09/16 19:57:33 Generate swagger docs....
2020/09/16 19:57:33 Generate general API Info, search dir:./app/http/
2020/09/16 19:57:33 Generating demo.UserDTO
2020/09/16 19:57:33 create docs.go at /Users/Documents/workspace/hade_workspace/demo5/app/http/swagger/docs.go
2020/09/16 19:57:33 create swagger.json at /Users/Documents/workspace/hade_workspace/demo5/app/http/swagger/swagger.json
2020/09/16 19:57:33 create swagger.yaml at /Users/Documents/workspace/hade_workspace/demo5/app/http/swagger/swagger.yaml
```

在目录 `app/http/swagger/` 下自动生成swagger相关文件。

## 服务

可以使用命令 `./hade swagger serve` 启动当前应用的 swagger ui 服务。

```
[~/Documents/workspace/hade_workspace/demo5]$ ./hade swagger serve
swagger success: http://0.0.0.0:8069/swagger/index.html
if you want to replace, remember use command: swagger gen
```

::: tip
如果你的 swagger 服务已经启动,更新 swagger 只需要重新运行 `./hade swagger gen` 就能更新。因为 swagger 服务读取的是生成的 swagger.json 这个文件。
:::

服务端口,我们也可以通过配置文件 `config/[env]/swagger.yaml` 中的配置 
```
url: http://127.0.0.1:8069
```

来配置swagger serve 启动的服务。

================================================
FILE: docs/guide/todo.md
================================================
# 待做事项
---

hade 框架目前还没有到完善地步,这里列一下计划后续做的工作,有兴趣的同学可以一起进行开发。

git 地址: https://hade

- 增加traceid机制
- 调试deploy命令
- 增加module相关自动化命令
- 引入rpc机制
- service provider 自动生成 http 和 rpc 的命令

================================================
FILE: docs/provider/README.md
================================================
# 服务提供者 

---

这里列出了 hade 框架自带的服务提供者接口和协议说明

================================================
FILE: docs/provider/app.md
================================================
# hade:app

提供基础的 app 框架目录结构

``` golang
package contract

// AppKey is the key in container
const AppKey = "hade:app"

// App define application structure
type App interface {
	// application version
	Version() string
	// base path which is the base folder
	BasePath() string
	// config folder which contains config
	ConfigPath() string
	// environmentPath which contain .env
	EnvironmentPath() string
	// storagePath define storage folder
	StoragePath() string
	// logPath define logPath
	LogPath() string
	// frameworkPath define frameworkPath
	FrameworkPath() string
}

```

================================================
FILE: docs/provider/config.md
================================================
# hade:config

提供基础的配置文件获取方法

``` golang
package contract

import "time"

const (
	// ConfigKey is config key in container
	ConfigKey = "hade:config"
)

// Config define setting from files, it support key contains dov。
// for example:
// .Get("user.name")
// suggest use yaml format, https://yaml.org/spec/1.2/spec.html
type Config interface {
	// IsExist check setting is exist
	IsExist(key string) bool

	// Get a new interface
	Get(key string) interface{}
	// GetBool get bool type
	GetBool(key string) bool
	// GetInt get Int type
	GetInt(key string) int
	// GetFloat64 get float64
	GetFloat64(key string) float64
	// GetTime get time type
	GetTime(key string) time.Time
	// GetString get string typen
	GetString(key string) string

	// GetIntSlice get int slice type
	GetIntSlice(key string) []int
	// GetStringSlice get string slice type
	GetStringSlice(key string) []string

	// GetStringMap get map which key is string, value is interface
	GetStringMap(key string) map[string]interface{}
	// GetStringMapString get map which key is string, value is string
	GetStringMapString(key string) map[string]string
	// GetStringMapStringSlice get map which key is string, value is string slice
	GetStringMapStringSlice(key string) map[string][]string

	// Load a config to a struct, val should be an pointer
	Load(key string, val interface{}) error
}

```

================================================
FILE: docs/provider/env.md
================================================
# hade:env

提供环境变量相关方法

``` golang
package contract

const (
	// EnvProduction represent the environment which build for production
	EnvProduction = "production"
	// EnvTesting represent the environment which build for test
	EnvTesting = "testing"
	// EnvDevelopment represent the environment which build for development
	EnvDevelopment = "development"

	// EnvKey is the key in container
	EnvKey = "hade:env"
)

// Env define golang run enviornment
// it set some config which want ignored in git
type Env interface {
	// AppEnv get current environment
	AppEnv() string

	// IsExist check setting is exist
	IsExist(string) bool
	// Get environment setting, if not exist, return ""
	Get(string) string
	// All return all settings
	All() map[string]string
}

```

================================================
FILE: docs/provider/log.md
================================================
# hade:log

提供日志记录相关操作

``` golang
type Log interface {
	// Panic will call panic(fields) for debug
	Panic(ctx context.Context, msg string, fields []interface{})
	// Fatal will add fatal record which contains msg and fields
	Fatal(ctx context.Context, msg string, fields []interface{})
	// Error will add error record which contains msg and fields
	Error(ctx context.Context, msg string, fields []interface{})
	// Warn will add warn record which contains msg and fields
	Warn(ctx context.Context, msg string, fields []interface{})
	// Info will add info record which contains msg and fields
	Info(ctx context.Context, msg string, fields []interface{})
	// Debug will add debug record which contains msg and fields
	Debug(ctx context.Context, msg string, fields []interface{})
	// Trace will add trace info which contains msg and fields
	Trace(ctx context.Context, msg string, fields []interface{})

	// SetLevel set log level, and higher level will be recorded
	SetLevel(level LogLevel)
	// SetCxtFielder will get fields from context
	SetCxtFielder(handler CtxFielder)
	// SetFormatter will set formatter handler will covert data to string for recording
	SetFormatter(formatter Formatter)
}

```

================================================
FILE: framework/cobra/.gitignore
================================================
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

# Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

*.exe
cobra.test
bin

.idea/
*.iml


================================================
FILE: framework/cobra/.golangci.yml
================================================
run:
  deadline: 5m

linters:
  disable-all: true
  enable:
    #- bodyclose
    - deadcode
    #- depguard
    #- dogsled
    #- dupl
    - errcheck
    #- exhaustive
    #- funlen
    - gas
    #- gochecknoinits
    - goconst
    #- gocritic
    #- gocyclo
    #- gofmt
    - goimports
    - golint
    #- gomnd
    #- goprintffuncname
    #- gosec
    #- gosimple
    - govet
    - ineffassign
    - interfacer
    #- lll
    - maligned
    - megacheck
    #- misspell
    #- nakedret
    #- noctx
    #- nolintlint
    #- rowserrcheck
    #- scopelint
    #- staticcheck
    - structcheck
    #- stylecheck
    #- typecheck
    - unconvert
    #- unparam
    #- unused
    - varcheck
    #- whitespace
  fast: false


================================================
FILE: framework/cobra/.mailmap
================================================
Steve Francia <steve.francia@gmail.com>
Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fabiano Franz <ffranz@redhat.com>                   <contact@fabianofranz.com>


================================================
FILE: framework/cobra/CHANGELOG.md
================================================
# Cobra Changelog

## v1.1.3

* **Fix:** release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility

## v1.1.2

### Notable Changes

* Bump license year to 2021 in golden files (#1309) @Bowbaq
* Enhance PowerShell completion with custom comp (#1208) @Luap99
* Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670
* Documentation readability improvements (#1228 etc.) @zaataylor etc.
* Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor

## v1.1.1

* **Fix:** yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See https://github.com/spf13/cobra/pull/1259 for context.
* **Fix:** correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See https://github.com/spf13/cobra/issues/1049 for context.

## v1.1.0

### Notable Changes

* Extend Go completions and revamp zsh comp (#1070)
* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` (#1104) @jpmcb
* Add completion for help command (#1136)
* Complete subcommands when TraverseChildren is set (#1171)
* Fix stderr printing functions (#894)
* fix: fish output redirection (#1247)

## v1.0.0

Announcing v1.0.0 of Cobra. 🎉

### Notable Changes
* Fish completion (including support for Go custom completion) @marckhouzam
* API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam
* Remove/replace SetOutput on Command - deprecated @jpmcb
* add support for autolabel stale PR @xchapter7x
* Add Labeler Actions @xchapter7x
* Custom completions coded in Go (instead of Bash) @marckhouzam
* Partial Revert of #922 @jharshman
* Add Makefile to project @jharshman
* Correct documentation for InOrStdin @desponda
* Apply formatting to templates @jharshman
* Revert change so help is printed on stdout again @marckhouzam
* Update md2man to v2.0.0 @pdf
* update viper to v1.4.0 @umarcor
* Update cmd/root.go example in README.md @jharshman


================================================
FILE: framework/cobra/CONDUCT.md
================================================
## Cobra User Contract

### Versioning
Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release.

### Backward Compatibility
We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released.

### Deprecation
Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github.

### CVE
Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one.

### Communication
Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors.

### Breaking Changes
Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra.

There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version.

Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release.

Examples of breaking changes include:
- Removing or renaming exported constant, variable, type, or function.
- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc...
  - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing.

There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging.

### CI Testing
Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang.

### Disclaimer
Changes to this document and the contents therein are at the discretion of the maintainers.
None of the contents of this document are legally binding in any way to the maintainers or the users.


================================================
FILE: framework/cobra/CONTRIBUTING.md
================================================
# Contributing to Cobra

Thank you so much for contributing to Cobra. We appreciate your time and help.
Here are some guidelines to help you get started.

## Code of Conduct

Be kind and respectful to the members of the community. Take time to educate
others who are seeking help. Harassment of any kind will not be tolerated.

## Questions

If you have questions regarding Cobra, feel free to ask it in the community
[#cobra Slack channel][cobra-slack]

## Filing a bug or feature

1. Before filing an issue, please check the existing issues to see if a
   similar one was already opened. If there is one already opened, feel free
   to comment on it.
1. If you believe you've found a bug, please provide detailed steps of
   reproduction, the version of Cobra and anything else you believe will be
   useful to help troubleshoot it (e.g. OS environment, environment variables,
   etc...). Also state the current behavior vs. the expected behavior.
1. If you'd like to see a feature or an enhancement please open an issue with
   a clear title and description of what the feature is and why it would be
   beneficial to the project and its users.

## Submitting changes

1. CLA: Upon submitting a Pull Request (PR), contributors will be prompted to
   sign a CLA. Please sign the CLA :slightly_smiling_face:
1. Tests: If you are submitting code, please ensure you have adequate tests
   for the feature. Tests can be run via `go test ./...` or `make test`.
1. Since this is golang project, ensure the new code is properly formatted to
   ensure code consistency. Run `make all`.

### Quick steps to contribute

1. Fork the project.
1. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`)
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Make changes and run tests (`make test`)
1. Add them to staging (`git add .`)
1. Commit your changes (`git commit -m 'Add some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new pull request

<!-- Links -->
[cobra-slack]: https://gophers.slack.com/archives/CD3LP1199


================================================
FILE: framework/cobra/LICENSE.txt
================================================
                                Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.


================================================
FILE: framework/cobra/Makefile
================================================
BIN="./bin"
SRC=$(shell find . -name "*.go")

ifeq (, $(shell which golangci-lint))
$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")
endif

ifeq (, $(shell which richgo))
$(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo")
endif

.PHONY: fmt lint test cobra_generator install_deps clean

default: all

all: fmt test cobra_generator

fmt:
	$(info ******************** checking formatting ********************)
	@test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1)

lint:
	$(info ******************** running lint tools ********************)
	golangci-lint run -v

test: install_deps lint
	$(info ******************** running tests ********************)
	richgo test -v ./...

cobra_generator: install_deps
	$(info ******************** building generator ********************)
	mkdir -p $(BIN)
	make -C cobra all

install_deps:
	$(info ******************** downloading dependencies ********************)
	go get -v ./...

clean:
	rm -rf $(BIN)


================================================
FILE: framework/cobra/README.md
================================================
![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)

Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files.

Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/),
[Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to
name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra.

[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest)
[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra)
[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra)
[![Slack](https://img.shields.io/badge/Slack-cobra-brightgreen)](https://gophers.slack.com/archives/CD3LP1199)

# Table of Contents

- [Overview](#overview)
- [Concepts](#concepts)
  * [Commands](#commands)
  * [Flags](#flags)
- [Installing](#installing)
- [Usage](#usage)
  * [Using the Cobra Generator](user_guide.md#using-the-cobra-generator)
  * [Using the Cobra Library](user_guide.md#using-the-cobra-library)
  * [Working with Flags](user_guide.md#working-with-flags)
  * [Positional and Custom Arguments](user_guide.md#positional-and-custom-arguments)
  * [Example](user_guide.md#example)
  * [Help Command](user_guide.md#help-command)
  * [Usage Message](user_guide.md#usage-message)
  * [PreRun and PostRun Hooks](user_guide.md#prerun-and-postrun-hooks)
  * [Suggestions when "unknown command" happens](user_guide.md#suggestions-when-unknown-command-happens)
  * [Generating documentation for your command](user_guide.md#generating-documentation-for-your-command)
  * [Generating shell completions](user_guide.md#generating-shell-completions)
- [Contributing](CONTRIBUTING.md)
- [License](#license)

# Overview

Cobra is a library providing a simple interface to create powerful modern CLI
interfaces similar to git & go tools.

Cobra is also an application that will generate your application scaffolding to rapidly
develop a Cobra-based application.

Cobra provides:
* Easy subcommand-based CLIs: `app server`, `app fetch`, etc.
* Fully POSIX-compliant flags (including short & long versions)
* Nested subcommands
* Global, local and cascading flags
* Easy generation of applications & commands with `cobra init appname` & `cobra add cmdname`
* Intelligent suggestions (`app srver`... did you mean `app server`?)
* Automatic help generation for commands and flags
* Automatic help flag recognition of `-h`, `--help`, etc.
* Automatically generated shell autocomplete for your application (bash, zsh, fish, powershell)
* Automatically generated man pages for your application
* Command aliases so you can change things without breaking them
* The flexibility to define your own help, usage, etc.
* Optional tight integration with [viper](http://github.com/spf13/viper) for 12-factor apps

# Concepts

Cobra is built on a structure of commands, arguments & flags.

**Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions.

The best applications read like sentences when used, and as a result, users
intuitively know how to interact with them.

The pattern to follow is
`APPNAME VERB NOUN --ADJECTIVE.`
    or
`APPNAME COMMAND ARG --FLAG`

A few good real world examples may better illustrate this point.

In the following example, 'server' is a command, and 'port' is a flag:

    hugo server --port=1313

In this command we are telling Git to clone the url bare.

    git clone URL --bare

## Commands

Command is the central point of the application. Each interaction that
the application supports will be contained in a Command. A command can
have children commands and optionally run an action.

In the example above, 'server' is the command.

[More about cobra.Command](https://godoc.org/github.com/spf13/cobra#Command)

## Flags

A flag is a way to modify the behavior of a command. Cobra supports
fully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/).
A Cobra command can define flags that persist through to children commands
and flags that are only available to that command.

In the example above, 'port' is the flag.

Flag functionality is provided by the [pflag
library](https://github.com/spf13/pflag), a fork of the flag standard library
which maintains the same interface while adding POSIX compliance.

# Installing
Using Cobra is easy. First, use `go get` to install the latest version
of the library. This command will install the `cobra` generator executable
along with the library and its dependencies:

    go get -u github.com/spf13/cobra

Next, include Cobra in your application:

```go
import "github.com/spf13/cobra"
```

# Usage

See [User Guide](user_guide.md).

# License

Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)


================================================
FILE: framework/cobra/args.go
================================================
package cobra

import (
	"fmt"
	"strings"
)

type PositionalArgs func(cmd *Command, args []string) error

// Legacy arg validation has the following behaviour:
// - root commands with no subcommands can take arbitrary arguments
// - root commands with subcommands will do subcommand validity checking
// - subcommands will always accept arbitrary arguments
func legacyArgs(cmd *Command, args []string) error {
	// no subcommand, always take args
	if !cmd.HasSubCommands() {
		return nil
	}

	// root command with subcommands, do subcommand checking.
	if !cmd.HasParent() && len(args) > 0 {
		return fmt.Errorf("unknown command %q for %q%s", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0]))
	}
	return nil
}

// NoArgs returns an error if any args are included.
func NoArgs(cmd *Command, args []string) error {
	if len(args) > 0 {
		return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath())
	}
	return nil
}

// OnlyValidArgs returns an error if any args are not in the list of ValidArgs.
func OnlyValidArgs(cmd *Command, args []string) error {
	if len(cmd.ValidArgs) > 0 {
		// Remove any description that may be included in ValidArgs.
		// A description is following a tab character.
		var validArgs []string
		for _, v := range cmd.ValidArgs {
			validArgs = append(validArgs, strings.Split(v, "\t")[0])
		}

		for _, v := range args {
			if !stringInSlice(v, validArgs) {
				return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0]))
			}
		}
	}
	return nil
}

// ArbitraryArgs never returns an error.
func ArbitraryArgs(cmd *Command, args []string) error {
	return nil
}

// MinimumNArgs returns an error if there is not at least N args.
func MinimumNArgs(n int) PositionalArgs {
	return func(cmd *Command, args []string) error {
		if len(args) < n {
			return fmt.Errorf("requires at least %d arg(s), only received %d", n, len(args))
		}
		return nil
	}
}

// MaximumNArgs returns an error if there are more than N args.
func MaximumNArgs(n int) PositionalArgs {
	return func(cmd *Command, args []string) error {
		if len(args) > n {
			return fmt.Errorf("accepts at most %d arg(s), received %d", n, len(args))
		}
		return nil
	}
}

// ExactArgs returns an error if there are not exactly n args.
func ExactArgs(n int) PositionalArgs {
	return func(cmd *Command, args []string) error {
		if len(args) != n {
			return fmt.Errorf("accepts %d arg(s), received %d", n, len(args))
		}
		return nil
	}
}

// ExactValidArgs returns an error if
// there are not exactly N positional args OR
// there are any positional args that are not in the `ValidArgs` field of `Command`
func ExactValidArgs(n int) PositionalArgs {
	return func(cmd *Command, args []string) error {
		if err := ExactArgs(n)(cmd, args); err != nil {
			return err
		}
		return OnlyValidArgs(cmd, args)
	}
}

// RangeArgs returns an error if the number of args is not within the expected range.
func RangeArgs(min int, max int) PositionalArgs {
	return func(cmd *Command, args []string) error {
		if len(args) < min || len(args) > max {
			return fmt.Errorf("accepts between %d and %d arg(s), received %d", min, max, len(args))
		}
		return nil
	}
}


================================================
FILE: framework/cobra/args_test.go
================================================
package cobra

import (
	"strings"
	"testing"
)

func TestNoArgs(t *testing.T) {
	c := &Command{Use: "c", Args: NoArgs, Run: emptyRun}

	output, err := executeCommand(c)
	if output != "" {
		t.Errorf("Unexpected string: %v", output)
	}
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}
}

func TestNoArgsWithArgs(t *testing.T) {
	c := &Command{Use: "c", Args: NoArgs, Run: emptyRun}

	_, err := executeCommand(c, "illegal")
	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := `unknown command "illegal" for "c"`
	if got != expected {
		t.Errorf("Expected: %q, got: %q", expected, got)
	}
}

func TestOnlyValidArgs(t *testing.T) {
	c := &Command{
		Use:       "c",
		Args:      OnlyValidArgs,
		ValidArgs: []string{"one", "two"},
		Run:       emptyRun,
	}

	output, err := executeCommand(c, "one", "two")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}
}

func TestOnlyValidArgsWithInvalidArgs(t *testing.T) {
	c := &Command{
		Use:       "c",
		Args:      OnlyValidArgs,
		ValidArgs: []string{"one", "two"},
		Run:       emptyRun,
	}

	_, err := executeCommand(c, "three")
	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := `invalid argument "three" for "c"`
	if got != expected {
		t.Errorf("Expected: %q, got: %q", expected, got)
	}
}

func TestArbitraryArgs(t *testing.T) {
	c := &Command{Use: "c", Args: ArbitraryArgs, Run: emptyRun}
	output, err := executeCommand(c, "a", "b")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestMinimumNArgs(t *testing.T) {
	c := &Command{Use: "c", Args: MinimumNArgs(2), Run: emptyRun}
	output, err := executeCommand(c, "a", "b", "c")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestMinimumNArgsWithLessArgs(t *testing.T) {
	c := &Command{Use: "c", Args: MinimumNArgs(2), Run: emptyRun}
	_, err := executeCommand(c, "a")

	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := "requires at least 2 arg(s), only received 1"
	if got != expected {
		t.Fatalf("Expected %q, got %q", expected, got)
	}
}

func TestMaximumNArgs(t *testing.T) {
	c := &Command{Use: "c", Args: MaximumNArgs(3), Run: emptyRun}
	output, err := executeCommand(c, "a", "b")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestMaximumNArgsWithMoreArgs(t *testing.T) {
	c := &Command{Use: "c", Args: MaximumNArgs(2), Run: emptyRun}
	_, err := executeCommand(c, "a", "b", "c")

	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := "accepts at most 2 arg(s), received 3"
	if got != expected {
		t.Fatalf("Expected %q, got %q", expected, got)
	}
}

func TestExactArgs(t *testing.T) {
	c := &Command{Use: "c", Args: ExactArgs(3), Run: emptyRun}
	output, err := executeCommand(c, "a", "b", "c")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestExactArgsWithInvalidCount(t *testing.T) {
	c := &Command{Use: "c", Args: ExactArgs(2), Run: emptyRun}
	_, err := executeCommand(c, "a", "b", "c")

	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := "accepts 2 arg(s), received 3"
	if got != expected {
		t.Fatalf("Expected %q, got %q", expected, got)
	}
}

func TestExactValidArgs(t *testing.T) {
	c := &Command{Use: "c", Args: ExactValidArgs(3), ValidArgs: []string{"a", "b", "c"}, Run: emptyRun}
	output, err := executeCommand(c, "a", "b", "c")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestExactValidArgsWithInvalidCount(t *testing.T) {
	c := &Command{Use: "c", Args: ExactValidArgs(2), Run: emptyRun}
	_, err := executeCommand(c, "a", "b", "c")

	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := "accepts 2 arg(s), received 3"
	if got != expected {
		t.Fatalf("Expected %q, got %q", expected, got)
	}
}

func TestExactValidArgsWithInvalidArgs(t *testing.T) {
	c := &Command{
		Use:       "c",
		Args:      ExactValidArgs(1),
		ValidArgs: []string{"one", "two"},
		Run:       emptyRun,
	}

	_, err := executeCommand(c, "three")
	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := `invalid argument "three" for "c"`
	if got != expected {
		t.Errorf("Expected: %q, got: %q", expected, got)
	}
}

func TestRangeArgs(t *testing.T) {
	c := &Command{Use: "c", Args: RangeArgs(2, 4), Run: emptyRun}
	output, err := executeCommand(c, "a", "b", "c")
	if output != "" {
		t.Errorf("Unexpected output: %v", output)
	}
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestRangeArgsWithInvalidCount(t *testing.T) {
	c := &Command{Use: "c", Args: RangeArgs(2, 4), Run: emptyRun}
	_, err := executeCommand(c, "a")

	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := "accepts between 2 and 4 arg(s), received 1"
	if got != expected {
		t.Fatalf("Expected %q, got %q", expected, got)
	}
}

func TestRootTakesNoArgs(t *testing.T) {
	rootCmd := &Command{Use: "root", Run: emptyRun}
	childCmd := &Command{Use: "child", Run: emptyRun}
	rootCmd.AddCommand(childCmd)

	_, err := executeCommand(rootCmd, "illegal", "args")
	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := `unknown command "illegal" for "root"`
	if !strings.Contains(got, expected) {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func TestRootTakesArgs(t *testing.T) {
	rootCmd := &Command{Use: "root", Args: ArbitraryArgs, Run: emptyRun}
	childCmd := &Command{Use: "child", Run: emptyRun}
	rootCmd.AddCommand(childCmd)

	_, err := executeCommand(rootCmd, "legal", "args")
	if err != nil {
		t.Errorf("Unexpected error: %v", err)
	}
}

func TestChildTakesNoArgs(t *testing.T) {
	rootCmd := &Command{Use: "root", Run: emptyRun}
	childCmd := &Command{Use: "child", Args: NoArgs, Run: emptyRun}
	rootCmd.AddCommand(childCmd)

	_, err := executeCommand(rootCmd, "child", "illegal", "args")
	if err == nil {
		t.Fatal("Expected an error")
	}

	got := err.Error()
	expected := `unknown command "illegal" for "root child"`
	if !strings.Contains(got, expected) {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func TestChildTakesArgs(t *testing.T) {
	rootCmd := &Command{Use: "root", Run: emptyRun}
	childCmd := &Command{Use: "child", Args: ArbitraryArgs, Run: emptyRun}
	rootCmd.AddCommand(childCmd)

	_, err := executeCommand(rootCmd, "child", "legal", "args")
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}
}


================================================
FILE: framework/cobra/bash_completions.go
================================================
package cobra

import (
	"bytes"
	"fmt"
	"io"
	"os"
	"sort"
	"strings"

	"github.com/spf13/pflag"
)

// Annotations for Bash completion.
const (
	BashCompFilenameExt     = "cobra_annotation_bash_completion_filename_extensions"
	BashCompCustom          = "cobra_annotation_bash_completion_custom"
	BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag"
	BashCompSubdirsInDir    = "cobra_annotation_bash_completion_subdirs_in_dir"
)

func writePreamble(buf io.StringWriter, name string) {
	WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name))
	WriteStringAndCheck(buf, fmt.Sprintf(`
__%[1]s_debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
}

# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
# _init_completion. This is a very minimal version of that function.
__%[1]s_init_completion()
{
    COMPREPLY=()
    _get_comp_words_by_ref "$@" cur prev words cword
}

__%[1]s_index_of_word()
{
    local w word=$1
    shift
    index=0
    for w in "$@"; do
        [[ $w = "$word" ]] && return
        index=$((index+1))
    done
    index=-1
}

__%[1]s_contains_word()
{
    local w word=$1; shift
    for w in "$@"; do
        [[ $w = "$word" ]] && return
    done
    return 1
}

__%[1]s_handle_go_custom_completion()
{
    __%[1]s_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}"

    local shellCompDirectiveError=%[3]d
    local shellCompDirectiveNoSpace=%[4]d
    local shellCompDirectiveNoFileComp=%[5]d
    local shellCompDirectiveFilterFileExt=%[6]d
    local shellCompDirectiveFilterDirs=%[7]d

    local out requestComp lastParam lastChar comp directive args

    # Prepare the command to request completions for the program.
    # Calling ${words[0]} instead of directly %[1]s allows to handle aliases
    args=("${words[@]:1}")
    requestComp="${words[0]} %[2]s ${args[*]}"

    lastParam=${words[$((${#words[@]}-1))]}
    lastChar=${lastParam:$((${#lastParam}-1)):1}
    __%[1]s_debug "${FUNCNAME[0]}: lastParam ${lastParam}, lastChar ${lastChar}"

    if [ -z "${cur}" ] && [ "${lastChar}" != "=" ]; then
        # If the last parameter is complete (there is a space following it)
        # We add an extra empty parameter so we can indicate this to the go method.
        __%[1]s_debug "${FUNCNAME[0]}: Adding extra empty parameter"
        requestComp="${requestComp} \"\""
    fi

    __%[1]s_debug "${FUNCNAME[0]}: calling ${requestComp}"
    # Use eval to handle any environment variables and such
    out=$(eval "${requestComp}" 2>/dev/null)

    # Extract the directive integer at the very end of the output following a colon (:)
    directive=${out##*:}
    # Remove the directive
    out=${out%%:*}
    if [ "${directive}" = "${out}" ]; then
        # There is not directive specified
        directive=0
    fi
    __%[1]s_debug "${FUNCNAME[0]}: the completion directive is: ${directive}"
    __%[1]s_debug "${FUNCNAME[0]}: the completions are: ${out[*]}"

    if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
        # Error code.  No completion.
        __%[1]s_debug "${FUNCNAME[0]}: received error from custom completion go code"
        return
    else
        if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
            if [[ $(type -t compopt) = "builtin" ]]; then
                __%[1]s_debug "${FUNCNAME[0]}: activating no space"
                compopt -o nospace
            fi
        fi
        if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
            if [[ $(type -t compopt) = "builtin" ]]; then
                __%[1]s_debug "${FUNCNAME[0]}: activating no file completion"
                compopt +o default
            fi
        fi
    fi

    if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
        # File extension filtering
        local fullFilter filter filteringCmd
        # Do not use quotes around the $out variable or else newline
        # characters will be kept.
        for filter in ${out[*]}; do
            fullFilter+="$filter|"
        done

        filteringCmd="_filedir $fullFilter"
        __%[1]s_debug "File filtering command: $filteringCmd"
        $filteringCmd
    elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
        # File completion for directories only
        local subDir
        # Use printf to strip any trailing newline
        subdir=$(printf "%%s" "${out[0]}")
        if [ -n "$subdir" ]; then
            __%[1]s_debug "Listing directories in $subdir"
            __%[1]s_handle_subdirs_in_dir_flag "$subdir"
        else
            __%[1]s_debug "Listing directories in ."
            _filedir -d
        fi
    else
        while IFS='' read -r comp; do
            COMPREPLY+=("$comp")
        done < <(compgen -W "${out[*]}" -- "$cur")
    fi
}

__%[1]s_handle_reply()
{
    __%[1]s_debug "${FUNCNAME[0]}"
    local comp
    case $cur in
        -*)
            if [[ $(type -t compopt) = "builtin" ]]; then
                compopt -o nospace
            fi
            local allflags
            if [ ${#must_have_one_flag[@]} -ne 0 ]; then
                allflags=("${must_have_one_flag[@]}")
            else
                allflags=("${flags[*]} ${two_word_flags[*]}")
            fi
            while IFS='' read -r comp; do
                COMPREPLY+=("$comp")
            done < <(compgen -W "${allflags[*]}" -- "$cur")
            if [[ $(type -t compopt) = "builtin" ]]; then
                [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
            fi

            # complete after --flag=abc
            if [[ $cur == *=* ]]; then
                if [[ $(type -t compopt) = "builtin" ]]; then
                    compopt +o nospace
                fi

                local index flag
                flag="${cur%%=*}"
                __%[1]s_index_of_word "${flag}" "${flags_with_completion[@]}"
                COMPREPLY=()
                if [[ ${index} -ge 0 ]]; then
                    PREFIX=""
                    cur="${cur#*=}"
                    ${flags_completion[${index}]}
                    if [ -n "${ZSH_VERSION}" ]; then
                        # zsh completion needs --flag= prefix
                        eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )"
                    fi
                fi
            fi
            return 0;
            ;;
    esac

    # check if we are handling a flag with special work handling
    local index
    __%[1]s_index_of_word "${prev}" "${flags_with_completion[@]}"
    if [[ ${index} -ge 0 ]]; then
        ${flags_completion[${index}]}
        return
    fi

    # we are parsing a flag and don't have a special handler, no completion
    if [[ ${cur} != "${words[cword]}" ]]; then
        return
    fi

    local completions
    completions=("${commands[@]}")
    if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
        completions+=("${must_have_one_noun[@]}")
    elif [[ -n "${has_completion_function}" ]]; then
        # if a go completion function is provided, defer to that function
        __%[1]s_handle_go_custom_completion
    fi
    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
        completions+=("${must_have_one_flag[@]}")
    fi
    while IFS='' read -r comp; do
        COMPREPLY+=("$comp")
    done < <(compgen -W "${completions[*]}" -- "$cur")

    if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
        while IFS='' read -r comp; do
            COMPREPLY+=("$comp")
        done < <(compgen -W "${noun_aliases[*]}" -- "$cur")
    fi

    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
		if declare -F __%[1]s_custom_func >/dev/null; then
			# try command name qualified custom func
			__%[1]s_custom_func
		else
			# otherwise fall back to unqualified for compatibility
			declare -F __custom_func >/dev/null && __custom_func
		fi
    fi

    # available in bash-completion >= 2, not always present on macOS
    if declare -F __ltrim_colon_completions >/dev/null; then
        __ltrim_colon_completions "$cur"
    fi

    # If there is only 1 completion and it is a flag with an = it will be completed
    # but we don't want a space after the =
    if [[ "${#COMPREPLY[@]}" -eq "1" ]] && [[ $(type -t compopt) = "builtin" ]] && [[ "${COMPREPLY[0]}" == --*= ]]; then
       compopt -o nospace
    fi
}

# The arguments should be in the form "ext1|ext2|extn"
__%[1]s_handle_filename_extension_flag()
{
    local ext="$1"
    _filedir "@(${ext})"
}

__%[1]s_handle_subdirs_in_dir_flag()
{
    local dir="$1"
    pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
}

__%[1]s_handle_flag()
{
    __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    # if a command required a flag, and we found it, unset must_have_one_flag()
    local flagname=${words[c]}
    local flagvalue
    # if the word contained an =
    if [[ ${words[c]} == *"="* ]]; then
        flagvalue=${flagname#*=} # take in as flagvalue after the =
        flagname=${flagname%%=*} # strip everything after the =
        flagname="${flagname}=" # but put the = back
    fi
    __%[1]s_debug "${FUNCNAME[0]}: looking for ${flagname}"
    if __%[1]s_contains_word "${flagname}" "${must_have_one_flag[@]}"; then
        must_have_one_flag=()
    fi

    # if you set a flag which only applies to this command, don't show subcommands
    if __%[1]s_contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then
      commands=()
    fi

    # keep flag value with flagname as flaghash
    # flaghash variable is an associative array which is only supported in bash > 3.
    if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then
        if [ -n "${flagvalue}" ] ; then
            flaghash[${flagname}]=${flagvalue}
        elif [ -n "${words[ $((c+1)) ]}" ] ; then
            flaghash[${flagname}]=${words[ $((c+1)) ]}
        else
            flaghash[${flagname}]="true" # pad "true" for bool flag
        fi
    fi

    # skip the argument to a two word flag
    if [[ ${words[c]} != *"="* ]] && __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then
			  __%[1]s_debug "${FUNCNAME[0]}: found a flag ${words[c]}, skip the next argument"
        c=$((c+1))
        # if we are looking for a flags value, don't show commands
        if [[ $c -eq $cword ]]; then
            commands=()
        fi
    fi

    c=$((c+1))

}

__%[1]s_handle_noun()
{
    __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    if __%[1]s_contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
        must_have_one_noun=()
    elif __%[1]s_contains_word "${words[c]}" "${noun_aliases[@]}"; then
        must_have_one_noun=()
    fi

    nouns+=("${words[c]}")
    c=$((c+1))
}

__%[1]s_handle_command()
{
    __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    local next_command
    if [[ -n ${last_command} ]]; then
        next_command="_${last_command}_${words[c]//:/__}"
    else
        if [[ $c -eq 0 ]]; then
            next_command="_%[1]s_root_command"
        else
            next_command="_${words[c]//:/__}"
        fi
    fi
    c=$((c+1))
    __%[1]s_debug "${FUNCNAME[0]}: looking for ${next_command}"
    declare -F "$next_command" >/dev/null && $next_command
}

__%[1]s_handle_word()
{
    if [[ $c -ge $cword ]]; then
        __%[1]s_handle_reply
        return
    fi
    __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
    if [[ "${words[c]}" == -* ]]; then
        __%[1]s_handle_flag
    elif __%[1]s_contains_word "${words[c]}" "${commands[@]}"; then
        __%[1]s_handle_command
    elif [[ $c -eq 0 ]]; then
        __%[1]s_handle_command
    elif __%[1]s_contains_word "${words[c]}" "${command_aliases[@]}"; then
        # aliashash variable is an associative array which is only supported in bash > 3.
        if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then
            words[c]=${aliashash[${words[c]}]}
            __%[1]s_handle_command
        else
            __%[1]s_handle_noun
        fi
    else
        __%[1]s_handle_noun
    fi
    __%[1]s_handle_word
}

`, name, ShellCompNoDescRequestCmd,
		ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
		ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs))
}

func writePostscript(buf io.StringWriter, name string) {
	name = strings.Replace(name, ":", "__", -1)
	WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name))
	WriteStringAndCheck(buf, fmt.Sprintf(`{
    local cur prev words cword split
    declare -A flaghash 2>/dev/null || :
    declare -A aliashash 2>/dev/null || :
    if declare -F _init_completion >/dev/null 2>&1; then
        _init_completion -s || return
    else
        __%[1]s_init_completion -n "=" || return
    fi

    local c=0
    local flags=()
    local two_word_flags=()
    local local_nonpersistent_flags=()
    local flags_with_completion=()
    local flags_completion=()
    local commands=("%[1]s")
    local command_aliases=()
    local must_have_one_flag=()
    local must_have_one_noun=()
    local has_completion_function
    local last_command
    local nouns=()
    local noun_aliases=()

    __%[1]s_handle_word
}

`, name))
	WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then
    complete -o default -F __start_%s %s
else
    complete -o default -o nospace -F __start_%s %s
fi

`, name, name, name, name))
	WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n")
}

func writeCommands(buf io.StringWriter, cmd *Command) {
	WriteStringAndCheck(buf, "    commands=()\n")
	for _, c := range cmd.Commands() {
		if !c.IsAvailableCommand() && c != cmd.helpCommand {
			continue
		}
		WriteStringAndCheck(buf, fmt.Sprintf("    commands+=(%q)\n", c.Name()))
		writeCmdAliases(buf, c)
	}
	WriteStringAndCheck(buf, "\n")
}

func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) {
	for key, value := range annotations {
		switch key {
		case BashCompFilenameExt:
			WriteStringAndCheck(buf, fmt.Sprintf("    flags_with_completion+=(%q)\n", name))

			var ext string
			if len(value) > 0 {
				ext = fmt.Sprintf("__%s_handle_filename_extension_flag ", cmd.Root().Name()) + strings.Join(value, "|")
			} else {
				ext = "_filedir"
			}
			WriteStringAndCheck(buf, fmt.Sprintf("    flags_completion+=(%q)\n", ext))
		case BashCompCustom:
			WriteStringAndCheck(buf, fmt.Sprintf("    flags_with_completion+=(%q)\n", name))

			if len(value) > 0 {
				handlers := strings.Join(value, "; ")
				WriteStringAndCheck(buf, fmt.Sprintf("    flags_completion+=(%q)\n", handlers))
			} else {
				WriteStringAndCheck(buf, "    flags_completion+=(:)\n")
			}
		case BashCompSubdirsInDir:
			WriteStringAndCheck(buf, fmt.Sprintf("    flags_with_completion+=(%q)\n", name))

			var ext string
			if len(value) == 1 {
				ext = fmt.Sprintf("__%s_handle_subdirs_in_dir_flag ", cmd.Root().Name()) + value[0]
			} else {
				ext = "_filedir -d"
			}
			WriteStringAndCheck(buf, fmt.Sprintf("    flags_completion+=(%q)\n", ext))
		}
	}
}

const cbn = "\")\n"

func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) {
	name := flag.Shorthand
	format := "    "
	if len(flag.NoOptDefVal) == 0 {
		format += "two_word_"
	}
	format += "flags+=(\"-%s" + cbn
	WriteStringAndCheck(buf, fmt.Sprintf(format, name))
	writeFlagHandler(buf, "-"+name, flag.Annotations, cmd)
}

func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) {
	name := flag.Name
	format := "    flags+=(\"--%s"
	if len(flag.NoOptDefVal) == 0 {
		format += "="
	}
	format += cbn
	WriteStringAndCheck(buf, fmt.Sprintf(format, name))
	if len(flag.NoOptDefVal) == 0 {
		format = "    two_word_flags+=(\"--%s" + cbn
		WriteStringAndCheck(buf, fmt.Sprintf(format, name))
	}
	writeFlagHandler(buf, "--"+name, flag.Annotations, cmd)
}

func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) {
	name := flag.Name
	format := "    local_nonpersistent_flags+=(\"--%[1]s" + cbn
	if len(flag.NoOptDefVal) == 0 {
		format += "    local_nonpersistent_flags+=(\"--%[1]s=" + cbn
	}
	WriteStringAndCheck(buf, fmt.Sprintf(format, name))
	if len(flag.Shorthand) > 0 {
		WriteStringAndCheck(buf, fmt.Sprintf("    local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand))
	}
}

// Setup annotations for go completions for registered flags
func prepareCustomAnnotationsForFlags(cmd *Command) {
	flagCompletionMutex.RLock()
	defer flagCompletionMutex.RUnlock()
	for flag := range flagCompletionFunctions {
		// Make sure the completion script calls the __*_go_custom_completion function for
		// every registered flag.  We need to do this here (and not when the flag was registered
		// for completion) so that we can know the root command name for the prefix
		// of __<prefix>_go_custom_completion
		if flag.Annotations == nil {
			flag.Annotations = map[string][]string{}
		}
		flag.Annotations[BashCompCustom] = []string{fmt.Sprintf("__%[1]s_handle_go_custom_completion", cmd.Root().Name())}
	}
}

func writeFlags(buf io.StringWriter, cmd *Command) {
	prepareCustomAnnotationsForFlags(cmd)
	WriteStringAndCheck(buf, `    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

`)
	localNonPersistentFlags := cmd.LocalNonPersistentFlags()
	cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
		if nonCompletableFlag(flag) {
			return
		}
		writeFlag(buf, flag, cmd)
		if len(flag.Shorthand) > 0 {
			writeShortFlag(buf, flag, cmd)
		}
		// localNonPersistentFlags are used to stop the completion of subcommands when one is set
		// if TraverseChildren is true we should allow to complete subcommands
		if localNonPersistentFlags.Lookup(flag.Name) != nil && !cmd.Root().TraverseChildren {
			writeLocalNonPersistentFlag(buf, flag)
		}
	})
	cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {
		if nonCompletableFlag(flag) {
			return
		}
		writeFlag(buf, flag, cmd)
		if len(flag.Shorthand) > 0 {
			writeShortFlag(buf, flag, cmd)
		}
	})

	WriteStringAndCheck(buf, "\n")
}

func writeRequiredFlag(buf io.StringWriter, cmd *Command) {
	WriteStringAndCheck(buf, "    must_have_one_flag=()\n")
	flags := cmd.NonInheritedFlags()
	flags.VisitAll(func(flag *pflag.Flag) {
		if nonCompletableFlag(flag) {
			return
		}
		for key := range flag.Annotations {
			switch key {
			case BashCompOneRequiredFlag:
				format := "    must_have_one_flag+=(\"--%s"
				if flag.Value.Type() != "bool" {
					format += "="
				}
				format += cbn
				WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name))

				if len(flag.Shorthand) > 0 {
					WriteStringAndCheck(buf, fmt.Sprintf("    must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand))
				}
			}
		}
	})
}

func writeRequiredNouns(buf io.StringWriter, cmd *Command) {
	WriteStringAndCheck(buf, "    must_have_one_noun=()\n")
	sort.Strings(cmd.ValidArgs)
	for _, value := range cmd.ValidArgs {
		// Remove any description that may be included following a tab character.
		// Descriptions are not supported by bash completion.
		value = strings.Split(value, "\t")[0]
		WriteStringAndCheck(buf, fmt.Sprintf("    must_have_one_noun+=(%q)\n", value))
	}
	if cmd.ValidArgsFunction != nil {
		WriteStringAndCheck(buf, "    has_completion_function=1\n")
	}
}

func writeCmdAliases(buf io.StringWriter, cmd *Command) {
	if len(cmd.Aliases) == 0 {
		return
	}

	sort.Strings(cmd.Aliases)

	WriteStringAndCheck(buf, fmt.Sprint(`    if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n"))
	for _, value := range cmd.Aliases {
		WriteStringAndCheck(buf, fmt.Sprintf("        command_aliases+=(%q)\n", value))
		WriteStringAndCheck(buf, fmt.Sprintf("        aliashash[%q]=%q\n", value, cmd.Name()))
	}
	WriteStringAndCheck(buf, `    fi`)
	WriteStringAndCheck(buf, "\n")
}
func writeArgAliases(buf io.StringWriter, cmd *Command) {
	WriteStringAndCheck(buf, "    noun_aliases=()\n")
	sort.Strings(cmd.ArgAliases)
	for _, value := range cmd.ArgAliases {
		WriteStringAndCheck(buf, fmt.Sprintf("    noun_aliases+=(%q)\n", value))
	}
}

func gen(buf io.StringWriter, cmd *Command) {
	for _, c := range cmd.Commands() {
		if !c.IsAvailableCommand() && c != cmd.helpCommand {
			continue
		}
		gen(buf, c)
	}
	commandName := cmd.CommandPath()
	commandName = strings.Replace(commandName, " ", "_", -1)
	commandName = strings.Replace(commandName, ":", "__", -1)

	if cmd.Root() == cmd {
		WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName))
	} else {
		WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName))
	}

	WriteStringAndCheck(buf, fmt.Sprintf("    last_command=%q\n", commandName))
	WriteStringAndCheck(buf, "\n")
	WriteStringAndCheck(buf, "    command_aliases=()\n")
	WriteStringAndCheck(buf, "\n")

	writeCommands(buf, cmd)
	writeFlags(buf, cmd)
	writeRequiredFlag(buf, cmd)
	writeRequiredNouns(buf, cmd)
	writeArgAliases(buf, cmd)
	WriteStringAndCheck(buf, "}\n\n")
}

// GenBashCompletion generates bash completion file and writes to the passed writer.
func (c *Command) GenBashCompletion(w io.Writer) error {
	buf := new(bytes.Buffer)
	writePreamble(buf, c.Name())
	if len(c.BashCompletionFunction) > 0 {
		buf.WriteString(c.BashCompletionFunction + "\n")
	}
	gen(buf, c)
	writePostscript(buf, c.Name())

	_, err := buf.WriteTo(w)
	return err
}

func nonCompletableFlag(flag *pflag.Flag) bool {
	return flag.Hidden || len(flag.Deprecated) > 0
}

// GenBashCompletionFile generates bash completion file.
func (c *Command) GenBashCompletionFile(filename string) error {
	outFile, err := os.Create(filename)
	if err != nil {
		return err
	}
	defer outFile.Close()

	return c.GenBashCompletion(outFile)
}


================================================
FILE: framework/cobra/bash_completions.md
================================================
# Generating Bash Completions For Your cobra.Command

Please refer to [Shell Completions](shell_completions.md) for details.

## Bash legacy dynamic completions

For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below).  Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command.  This provides a path to gradually migrate from the legacy solution to the new solution.

**Note**: Cobra's default `completion` command uses bash completion V2.  If you are currently using Cobra's legacy dynamic completion solution, you should not use the default `completion` command but continue using your own.

The legacy solution allows you to inject bash functions into the bash completion script.  Those bash functions are responsible for providing the completion choices for your own completions.

Some code that works in kubernetes:

```bash
const (
        bash_completion_func = `__kubectl_parse_get()
{
    local kubectl_output out
    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
        out=($(echo "${kubectl_output}" | awk '{print $1}'))
        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
    fi
}

__kubectl_get_resource()
{
    if [[ ${#nouns[@]} -eq 0 ]]; then
        return 1
    fi
    __kubectl_parse_get ${nouns[${#nouns[@]} -1]}
    if [[ $? -eq 0 ]]; then
        return 0
    fi
}

__kubectl_custom_func() {
    case ${last_command} in
        kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)
            __kubectl_get_resource
            return
            ;;
        *)
            ;;
    esac
}
`)
```

And then I set that in my command definition:

```go
cmds := &cobra.Command{
	Use:   "kubectl",
	Short: "kubectl controls the Kubernetes cluster manager",
	Long: `kubectl controls the Kubernetes cluster manager.

Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
	Run: runHelp,
	BashCompletionFunction: bash_completion_func,
}
```

The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`__<command-use>_custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__kubectl_customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__kubectl_custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`.  `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`.  So it will call `__kubectl_parse_get pod`.  `__kubectl_parse_get` will actually call out to kubernetes and get any pods.  It will then set `COMPREPLY` to valid pods!

Similarly, for flags:

```go
	annotation := make(map[string][]string)
	annotation[cobra.BashCompCustom] = []string{"__kubectl_get_namespaces"}

	flag := &pflag.Flag{
		Name:        "namespace",
		Usage:       usage,
		Annotations: annotation,
	}
	cmd.Flags().AddFlag(flag)
```

In addition add the `__kubectl_get_namespaces` implementation in the `BashCompletionFunction`
value, e.g.:

```bash
__kubectl_get_namespaces()
{
    local template
    template="{{ range .items  }}{{ .metadata.name }} {{ end }}"
    local kubectl_out
    if kubectl_out=$(kubectl get -o template --template="${template}" namespace 2>/dev/null); then
        COMPREPLY=( $( compgen -W "${kubectl_out}[*]" -- "$cur" ) )
    fi
}
```


================================================
FILE: framework/cobra/bash_completionsV2.go
================================================
package cobra

import (
	"bytes"
	"fmt"
	"io"
	"os"
)

func (c *Command) genBashCompletion(w io.Writer, includeDesc bool) error {
	buf := new(bytes.Buffer)
	genBashComp(buf, c.Name(), includeDesc)
	_, err := buf.WriteTo(w)
	return err
}

func genBashComp(buf io.StringWriter, name string, includeDesc bool) {
	compCmd := ShellCompRequestCmd
	if !includeDesc {
		compCmd = ShellCompNoDescRequestCmd
	}

	WriteStringAndCheck(buf, fmt.Sprintf(`# bash completion V2 for %-36[1]s -*- shell-script -*-

__%[1]s_debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
}

# Macs have bash3 for which the bash-completion package doesn't include
# _init_completion. This is a minimal version of that function.
__%[1]s_init_completion()
{
    COMPREPLY=()
    _get_comp_words_by_ref "$@" cur prev words cword
}

# This function calls the %[1]s program to obtain the completion
# results and the directive.  It fills the 'out' and 'directive' vars.
__%[1]s_get_completion_results() {
    local requestComp lastParam lastChar args

    # Prepare the command to request completions for the program.
    # Calling ${words[0]} instead of directly %[1]s allows to handle aliases
    args=("${words[@]:1}")
    requestComp="${words[0]} %[2]s ${args[*]}"

    lastParam=${words[$((${#words[@]}-1))]}
    lastChar=${lastParam:$((${#lastParam}-1)):1}
    __%[1]s_debug "lastParam ${lastParam}, lastChar ${lastChar}"

    if [ -z "${cur}" ] && [ "${lastChar}" != "=" ]; then
        # If the last parameter is complete (there is a space following it)
        # We add an extra empty parameter so we can indicate this to the go method.
        __%[1]s_debug "Adding extra empty parameter"
        requestComp="${requestComp} ''"
    fi

    # When completing a flag with an = (e.g., %[1]s -n=<TAB>)
    # bash focuses on the part after the =, so we need to remove
    # the flag part from $cur
    if [[ "${cur}" == -*=* ]]; then
        cur="${cur#*=}"
    fi

    __%[1]s_debug "Calling ${requestComp}"
    # Use eval to handle any environment variables and such
    out=$(eval "${requestComp}" 2>/dev/null)

    # Extract the directive integer at the very end of the output following a colon (:)
    directive=${out##*:}
    # Remove the directive
    out=${out%%:*}
    if [ "${directive}" = "${out}" ]; then
        # There is not directive specified
        directive=0
    fi
    __%[1]s_debug "The completion directive is: ${directive}"
    __%[1]s_debug "The completions are: ${out[*]}"
}

__%[1]s_process_completion_results() {
    local shellCompDirectiveError=%[3]d
    local shellCompDirectiveNoSpace=%[4]d
    local shellCompDirectiveNoFileComp=%[5]d
    local shellCompDirectiveFilterFileExt=%[6]d
    local shellCompDirectiveFilterDirs=%[7]d

    if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
        # Error code.  No completion.
        __%[1]s_debug "Received error from custom completion go code"
        return
    else
        if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
            if [[ $(type -t compopt) = "builtin" ]]; then
                __%[1]s_debug "Activating no space"
                compopt -o nospace
            else
                __%[1]s_debug "No space directive not supported in this version of bash"
            fi
        fi
        if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
            if [[ $(type -t compopt) = "builtin" ]]; then
                __%[1]s_debug "Activating no file completion"
                compopt +o default
            else
                __%[1]s_debug "No file completion directive not supported in this version of bash"
            fi
        fi
    fi

    if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
        # File extension filtering
        local fullFilter filter filteringCmd

        # Do not use quotes around the $out variable or else newline
        # characters will be kept.
        for filter in ${out[*]}; do
            fullFilter+="$filter|"
        done

        filteringCmd="_filedir $fullFilter"
        __%[1]s_debug "File filtering command: $filteringCmd"
        $filteringCmd
    elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
        # File completion for directories only

        # Use printf to strip any trailing newline
        local subdir
        subdir=$(printf "%%s" "${out[0]}")
        if [ -n "$subdir" ]; then
            __%[1]s_debug "Listing directories in $subdir"
            pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
        else
            __%[1]s_debug "Listing directories in ."
            _filedir -d
        fi
    else
        __%[1]s_handle_standard_completion_case
    fi

    __%[1]s_handle_special_char "$cur" :
    __%[1]s_handle_special_char "$cur" =
}

__%[1]s_handle_standard_completion_case() {
    local tab comp
    tab=$(printf '\t')

    local longest=0
    # Look for the longest completion so that we can format things nicely
    while IFS='' read -r comp; do
        # Strip any description before checking the length
        comp=${comp%%%%$tab*}
        # Only consider the completions that match
        comp=$(compgen -W "$comp" -- "$cur")
        if ((${#comp}>longest)); then
            longest=${#comp}
        fi
    done < <(printf "%%s\n" "${out[@]}")

    local completions=()
    while IFS='' read -r comp; do
        if [ -z "$comp" ]; then
            continue
        fi

        __%[1]s_debug "Original comp: $comp"
        comp="$(__%[1]s_format_comp_descriptions "$comp" "$longest")"
        __%[1]s_debug "Final comp: $comp"
        completions+=("$comp")
    done < <(printf "%%s\n" "${out[@]}")

    while IFS='' read -r comp; do
        COMPREPLY+=("$comp")
    done < <(compgen -W "${completions[*]}" -- "$cur")

    # If there is a single completion left, remove the description text
    if [ ${#COMPREPLY[*]} -eq 1 ]; then
        __%[1]s_debug "COMPREPLY[0]: ${COMPREPLY[0]}"
        comp="${COMPREPLY[0]%%%% *}"
        __%[1]s_debug "Removed description from single completion, which is now: ${comp}"
        COMPREPLY=()
        COMPREPLY+=("$comp")
    fi
}

__%[1]s_handle_special_char()
{
    local comp="$1"
    local char=$2
    if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then
        local word=${comp%%"${comp##*${char}}"}
        local idx=${#COMPREPLY[*]}
        while [[ $((--idx)) -ge 0 ]]; do
            COMPREPLY[$idx]=${COMPREPLY[$idx]#"$word"}
        done
    fi
}

__%[1]s_format_comp_descriptions()
{
    local tab
    tab=$(printf '\t')
    local comp="$1"
    local longest=$2

    # Properly format the description string which follows a tab character if there is one
    if [[ "$comp" == *$tab* ]]; then
        desc=${comp#*$tab}
        comp=${comp%%%%$tab*}

        # $COLUMNS stores the current shell width.
        # Remove an extra 4 because we add 2 spaces and 2 parentheses.
        maxdesclength=$(( COLUMNS - longest - 4 ))

        # Make sure we can fit a description of at least 8 characters
        # if we are to align the descriptions.
        if [[ $maxdesclength -gt 8 ]]; then
            # Add the proper number of spaces to align the descriptions
            for ((i = ${#comp} ; i < longest ; i++)); do
                comp+=" "
            done
        else
            # Don't pad the descriptions so we can fit more text after the completion
            maxdesclength=$(( COLUMNS - ${#comp} - 4 ))
        fi

        # If there is enough space for any description text,
        # truncate the descriptions that are too long for the shell width
        if [ $maxdesclength -gt 0 ]; then
            if [ ${#desc} -gt $maxdesclength ]; then
                desc=${desc:0:$(( maxdesclength - 1 ))}
                desc+="…"
            fi
            comp+="  ($desc)"
        fi
    fi

    # Must use printf to escape all special characters
    printf "%%q" "${comp}"
}

__start_%[1]s()
{
    local cur prev words cword split

    COMPREPLY=()

    # Call _init_completion from the bash-completion package
    # to prepare the arguments properly
    if declare -F _init_completion >/dev/null 2>&1; then
        _init_completion -n "=:" || return
    else
        __%[1]s_init_completion -n "=:" || return
    fi

    __%[1]s_debug
    __%[1]s_debug "========= starting completion logic =========="
    __%[1]s_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword"

    # The user could have moved the cursor backwards on the command-line.
    # We need to trigger completion from the $cword location, so we need
    # to truncate the command-line ($words) up to the $cword location.
    words=("${words[@]:0:$cword+1}")
    __%[1]s_debug "Truncated words[*]: ${words[*]},"

    local out directive
    __%[1]s_get_completion_results
    __%[1]s_process_completion_results
}

if [[ $(type -t compopt) = "builtin" ]]; then
    complete -o default -F __start_%[1]s %[1]s
else
    complete -o default -o nospace -F __start_%[1]s %[1]s
fi

# ex: ts=4 sw=4 et filetype=sh
`, name, compCmd,
		ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
		ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs))
}

// GenBashCompletionFileV2 generates Bash completion version 2.
func (c *Command) GenBashCompletionFileV2(filename string, includeDesc bool) error {
	outFile, err := os.Create(filename)
	if err != nil {
		return err
	}
	defer outFile.Close()

	return c.GenBashCompletionV2(outFile, includeDesc)
}

// GenBashCompletionV2 generates Bash completion file version 2
// and writes it to the passed writer.
func (c *Command) GenBashCompletionV2(w io.Writer, includeDesc bool) error {
	return c.genBashCompletion(w, includeDesc)
}


================================================
FILE: framework/cobra/bash_completions_test.go
================================================
package cobra

import (
	"bytes"
	"fmt"
	"os"
	"os/exec"
	"regexp"
	"strings"
	"testing"
)

func checkOmit(t *testing.T, found, unexpected string) {
	if strings.Contains(found, unexpected) {
		t.Errorf("Got: %q\nBut should not have!\n", unexpected)
	}
}

func check(t *testing.T, found, expected string) {
	if !strings.Contains(found, expected) {
		t.Errorf("Expecting to contain: \n %q\nGot:\n %q\n", expected, found)
	}
}

func checkNumOccurrences(t *testing.T, found, expected string, expectedOccurrences int) {
	numOccurrences := strings.Count(found, expected)
	if numOccurrences != expectedOccurrences {
		t.Errorf("Expecting to contain %d occurrences of: \n %q\nGot %d:\n %q\n", expectedOccurrences, expected, numOccurrences, found)
	}
}

func checkRegex(t *testing.T, found, pattern string) {
	matched, err := regexp.MatchString(pattern, found)
	if err != nil {
		t.Errorf("Error thrown performing MatchString: \n %s\n", err)
	}
	if !matched {
		t.Errorf("Expecting to match: \n %q\nGot:\n %q\n", pattern, found)
	}
}

func runShellCheck(s string) error {
	cmd := exec.Command("shellcheck", "-s", "bash", "-", "-e",
		"SC2034", // PREFIX appears unused. Verify it or export it.
	)
	cmd.Stderr = os.Stderr
	cmd.Stdout = os.Stdout

	stdin, err := cmd.StdinPipe()
	if err != nil {
		return err
	}
	go func() {
		_, err := stdin.Write([]byte(s))
		CheckErr(err)

		stdin.Close()
	}()

	return cmd.Run()
}

// World worst custom function, just keep telling you to enter hello!
const bashCompletionFunc = `__root_custom_func() {
	COMPREPLY=( "hello" )
}
`

func TestBashCompletions(t *testing.T) {
	rootCmd := &Command{
		Use:                    "root",
		ArgAliases:             []string{"pods", "nodes", "services", "replicationcontrollers", "po", "no", "svc", "rc"},
		ValidArgs:              []string{"pod", "node", "service", "replicationcontroller"},
		BashCompletionFunction: bashCompletionFunc,
		Run:                    emptyRun,
	}
	rootCmd.Flags().IntP("introot", "i", -1, "help message for flag introot")
	assertNoErr(t, rootCmd.MarkFlagRequired("introot"))

	// Filename.
	rootCmd.Flags().String("filename", "", "Enter a filename")
	assertNoErr(t, rootCmd.MarkFlagFilename("filename", "json", "yaml", "yml"))

	// Persistent filename.
	rootCmd.PersistentFlags().String("persistent-filename", "", "Enter a filename")
	assertNoErr(t, rootCmd.MarkPersistentFlagFilename("persistent-filename"))
	assertNoErr(t, rootCmd.MarkPersistentFlagRequired("persistent-filename"))

	// Filename extensions.
	rootCmd.Flags().String("filename-ext", "", "Enter a filename (extension limited)")
	assertNoErr(t, rootCmd.MarkFlagFilename("filename-ext"))
	rootCmd.Flags().String("custom", "", "Enter a filename (extension limited)")
	assertNoErr(t, rootCmd.MarkFlagCustom("custom", "__complete_custom"))

	// Subdirectories in a given directory.
	rootCmd.Flags().String("theme", "", "theme to use (located in /themes/THEMENAME/)")
	assertNoErr(t, rootCmd.Flags().SetAnnotation("theme", BashCompSubdirsInDir, []string{"themes"}))

	// For two word flags check
	rootCmd.Flags().StringP("two", "t", "", "this is two word flags")
	rootCmd.Flags().BoolP("two-w-default", "T", false, "this is not two word flags")

	echoCmd := &Command{
		Use:     "echo [string to echo]",
		Aliases: []string{"say"},
		Short:   "Echo anything to the screen",
		Long:    "an utterly useless command for testing.",
		Example: "Just run cobra-test echo",
		Run:     emptyRun,
	}

	echoCmd.Flags().String("filename", "", "Enter a filename")
	assertNoErr(t, echoCmd.MarkFlagFilename("filename", "json", "yaml", "yml"))
	echoCmd.Flags().String("config", "", "config to use (located in /config/PROFILE/)")
	assertNoErr(t, echoCmd.Flags().SetAnnotation("config", BashCompSubdirsInDir, []string{"config"}))

	printCmd := &Command{
		Use:   "print [string to print]",
		Args:  MinimumNArgs(1),
		Short: "Print anything to the screen",
		Long:  "an absolutely utterly useless command for testing.",
		Run:   emptyRun,
	}

	deprecatedCmd := &Command{
		Use:        "deprecated [can't do anything here]",
		Args:       NoArgs,
		Short:      "A command which is deprecated",
		Long:       "an absolutely utterly useless command for testing deprecation!.",
		Deprecated: "Please use echo instead",
		Run:        emptyRun,
	}

	colonCmd := &Command{
		Use: "cmd:colon",
		Run: emptyRun,
	}

	timesCmd := &Command{
		Use:        "times [# times] [string to echo]",
		SuggestFor: []string{"counts"},
		Args:       OnlyValidArgs,
		ValidArgs:  []string{"one", "two", "three", "four"},
		Short:      "Echo anything to the screen more times",
		Long:       "a slightly useless command for testing.",
		Run:        emptyRun,
	}

	echoCmd.AddCommand(timesCmd)
	rootCmd.AddCommand(echoCmd, printCmd, deprecatedCmd, colonCmd)

	buf := new(bytes.Buffer)
	assertNoErr(t, rootCmd.GenBashCompletion(buf))
	output := buf.String()

	check(t, output, "_root")
	check(t, output, "_root_echo")
	check(t, output, "_root_echo_times")
	check(t, output, "_root_print")
	check(t, output, "_root_cmd__colon")

	// check for required flags
	check(t, output, `must_have_one_flag+=("--introot=")`)
Download .txt
gitextract_noppvudh/

├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── app/
│   ├── console/
│   │   ├── command/
│   │   │   └── foo/
│   │   │       └── foo.go
│   │   └── kernel.go
│   ├── http/
│   │   ├── kernel.go
│   │   ├── middleware/
│   │   │   ├── .gitkeeper
│   │   │   └── cors/
│   │   │       ├── .github/
│   │   │       │   └── workflows/
│   │   │       │       └── go.yml
│   │   │       ├── .gitignore
│   │   │       ├── LICENSE
│   │   │       ├── README.md
│   │   │       ├── config.go
│   │   │       ├── cors.go
│   │   │       ├── cors_test.go
│   │   │       ├── examples/
│   │   │       │   └── example.go
│   │   │       └── utils.go
│   │   ├── module/
│   │   │   └── demo/
│   │   │       ├── api.go
│   │   │       ├── api_cache.go
│   │   │       ├── api_orm.go
│   │   │       ├── dto.go
│   │   │       ├── mapper.go
│   │   │       ├── model.go
│   │   │       ├── repository.go
│   │   │       └── service.go
│   │   ├── route.go
│   │   ├── swagger/
│   │   │   ├── docs.go
│   │   │   ├── swagger.json
│   │   │   └── swagger.yaml
│   │   └── swagger.go
│   └── provider/
│       ├── demo/
│       │   ├── contract.go
│       │   ├── provider.go
│       │   └── service.go
│       └── user/
│           ├── contract.go
│           ├── provider.go
│           └── service.go
├── build/
│   ├── build.js
│   ├── check-versions.js
│   ├── utils.js
│   ├── vue-loader.conf.js
│   ├── webpack.base.conf.js
│   ├── webpack.dev.conf.js
│   └── webpack.prod.conf.js
├── config/
│   ├── dev.env.js
│   ├── development/
│   │   ├── app.yaml
│   │   ├── database.yaml
│   │   ├── deploy.yaml
│   │   ├── log.yaml
│   │   └── ssh.yaml
│   ├── index.js
│   ├── prod.env.js
│   ├── production/
│   │   ├── .gitkeeper
│   │   ├── app.yaml
│   │   ├── database.yaml
│   │   ├── deploy.yaml
│   │   ├── gift.yaml
│   │   ├── log.yaml
│   │   └── swagger.yaml
│   ├── test.env.js
│   └── testing/
│       ├── app.yaml
│       ├── cache.yaml
│       ├── database.yaml
│       ├── deploy.yaml
│       ├── log.yaml
│       ├── redis.yaml
│       ├── ssh.yaml
│       └── swagger.yaml
├── docs/
│   ├── .vuepress/
│   │   ├── config.js
│   │   └── enhanceApp.js
│   ├── README.md
│   ├── guide/
│   │   ├── README.md
│   │   ├── app.md
│   │   ├── build.md
│   │   ├── command.md
│   │   ├── cron.md
│   │   ├── dev.md
│   │   ├── env.md
│   │   ├── install.md
│   │   ├── introduce.md
│   │   ├── middleware.md
│   │   ├── provider.md
│   │   ├── structure.md
│   │   ├── swagger.md
│   │   └── todo.md
│   └── provider/
│       ├── README.md
│       ├── app.md
│       ├── config.md
│       ├── env.md
│       └── log.md
├── framework/
│   ├── cobra/
│   │   ├── .gitignore
│   │   ├── .golangci.yml
│   │   ├── .mailmap
│   │   ├── CHANGELOG.md
│   │   ├── CONDUCT.md
│   │   ├── CONTRIBUTING.md
│   │   ├── LICENSE.txt
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── args.go
│   │   ├── args_test.go
│   │   ├── bash_completions.go
│   │   ├── bash_completions.md
│   │   ├── bash_completionsV2.go
│   │   ├── bash_completions_test.go
│   │   ├── cobra/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── cmd/
│   │   │   │   ├── add.go
│   │   │   │   ├── add_test.go
│   │   │   │   ├── golden_test.go
│   │   │   │   ├── helpers.go
│   │   │   │   ├── helpers_test.go
│   │   │   │   ├── init.go
│   │   │   │   ├── init_test.go
│   │   │   │   ├── license_agpl.go
│   │   │   │   ├── license_apache_2.go
│   │   │   │   ├── license_bsd_clause_2.go
│   │   │   │   ├── license_bsd_clause_3.go
│   │   │   │   ├── license_gpl_2.go
│   │   │   │   ├── license_gpl_3.go
│   │   │   │   ├── license_lgpl.go
│   │   │   │   ├── license_mit.go
│   │   │   │   ├── licenses.go
│   │   │   │   ├── project.go
│   │   │   │   ├── project_test.go
│   │   │   │   ├── root.go
│   │   │   │   └── testdata/
│   │   │   │       ├── LICENSE.golden
│   │   │   │       ├── main.go.golden
│   │   │   │       ├── root.go.golden
│   │   │   │       └── test.go.golden
│   │   │   ├── main.go
│   │   │   └── tpl/
│   │   │       └── main.go
│   │   ├── cobra.go
│   │   ├── cobra_test.go
│   │   ├── command.go
│   │   ├── command_notwin.go
│   │   ├── command_test.go
│   │   ├── command_win.go
│   │   ├── completions.go
│   │   ├── completions_test.go
│   │   ├── doc/
│   │   │   ├── README.md
│   │   │   ├── cmd_test.go
│   │   │   ├── man_docs.go
│   │   │   ├── man_docs.md
│   │   │   ├── man_docs_test.go
│   │   │   ├── man_examples_test.go
│   │   │   ├── md_docs.go
│   │   │   ├── md_docs.md
│   │   │   ├── md_docs_test.go
│   │   │   ├── rest_docs.go
│   │   │   ├── rest_docs.md
│   │   │   ├── rest_docs_test.go
│   │   │   ├── util.go
│   │   │   ├── yaml_docs.go
│   │   │   ├── yaml_docs.md
│   │   │   └── yaml_docs_test.go
│   │   ├── fish_completions.go
│   │   ├── fish_completions.md
│   │   ├── fish_completions_test.go
│   │   ├── hade_command.go
│   │   ├── hade_command_contract.go
│   │   ├── hade_command_distributed.go
│   │   ├── powershell_completions.go
│   │   ├── powershell_completions.md
│   │   ├── projects_using_cobra.md
│   │   ├── shell_completions.go
│   │   ├── shell_completions.md
│   │   ├── user_guide.md
│   │   ├── zsh_completions.go
│   │   └── zsh_completions.md
│   ├── command/
│   │   ├── app.go
│   │   ├── build.go
│   │   ├── cmd.go
│   │   ├── config.go
│   │   ├── cron.go
│   │   ├── deploy.go
│   │   ├── dev.go
│   │   ├── env.go
│   │   ├── go_cmd.go
│   │   ├── go_cmd_test.go
│   │   ├── help.go
│   │   ├── kernel.go
│   │   ├── middleware.go
│   │   ├── new.go
│   │   ├── npm.go
│   │   ├── provider.go
│   │   └── swagger.go
│   ├── container.go
│   ├── contract/
│   │   ├── app.go
│   │   ├── cache.go
│   │   ├── config.go
│   │   ├── distributed.go
│   │   ├── env.go
│   │   ├── id.go
│   │   ├── kernel.go
│   │   ├── log.go
│   │   ├── orm.go
│   │   ├── redis.go
│   │   ├── ssh.go
│   │   └── trace.go
│   ├── gin/
│   │   ├── .github/
│   │   │   ├── ISSUE_TEMPLATE.md
│   │   │   └── PULL_REQUEST_TEMPLATE.md
│   │   ├── .gitignore
│   │   ├── .travis.yml
│   │   ├── AUTHORS.md
│   │   ├── BENCHMARKS.md
│   │   ├── CHANGELOG.md
│   │   ├── CODE_OF_CONDUCT.md
│   │   ├── CONTRIBUTING.md
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── auth.go
│   │   ├── auth_test.go
│   │   ├── benchmarks_test.go
│   │   ├── binding/
│   │   │   ├── binding.go
│   │   │   ├── binding_msgpack_test.go
│   │   │   ├── binding_nomsgpack.go
│   │   │   ├── binding_test.go
│   │   │   ├── default_validator.go
│   │   │   ├── default_validator_test.go
│   │   │   ├── form.go
│   │   │   ├── form_mapping.go
│   │   │   ├── form_mapping_benchmark_test.go
│   │   │   ├── form_mapping_test.go
│   │   │   ├── header.go
│   │   │   ├── json.go
│   │   │   ├── json_test.go
│   │   │   ├── msgpack.go
│   │   │   ├── msgpack_test.go
│   │   │   ├── multipart_form_mapping.go
│   │   │   ├── multipart_form_mapping_test.go
│   │   │   ├── protobuf.go
│   │   │   ├── query.go
│   │   │   ├── uri.go
│   │   │   ├── validate_test.go
│   │   │   ├── xml.go
│   │   │   ├── xml_test.go
│   │   │   ├── yaml.go
│   │   │   └── yaml_test.go
│   │   ├── codecov.yml
│   │   ├── context.go
│   │   ├── context_appengine.go
│   │   ├── context_test.go
│   │   ├── debug.go
│   │   ├── debug_test.go
│   │   ├── deprecated.go
│   │   ├── deprecated_test.go
│   │   ├── doc.go
│   │   ├── errors.go
│   │   ├── errors_1.13_test.go
│   │   ├── errors_test.go
│   │   ├── examples/
│   │   │   └── README.md
│   │   ├── fs.go
│   │   ├── gin.go
│   │   ├── ginS/
│   │   │   ├── README.md
│   │   │   └── gins.go
│   │   ├── gin_integration_test.go
│   │   ├── gin_test.go
│   │   ├── githubapi_test.go
│   │   ├── hade_context.go
│   │   ├── hade_context_contract.go
│   │   ├── hade_engine.go
│   │   ├── hade_request.go
│   │   ├── hade_response.go
│   │   ├── internal/
│   │   │   ├── bytesconv/
│   │   │   │   ├── bytesconv.go
│   │   │   │   └── bytesconv_test.go
│   │   │   └── json/
│   │   │       ├── json.go
│   │   │       └── jsoniter.go
│   │   ├── logger.go
│   │   ├── logger_test.go
│   │   ├── middleware_test.go
│   │   ├── mode.go
│   │   ├── mode_test.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   ├── recovery.go
│   │   ├── recovery_test.go
│   │   ├── render/
│   │   │   ├── data.go
│   │   │   ├── html.go
│   │   │   ├── json.go
│   │   │   ├── msgpack.go
│   │   │   ├── protobuf.go
│   │   │   ├── reader.go
│   │   │   ├── reader_test.go
│   │   │   ├── redirect.go
│   │   │   ├── render.go
│   │   │   ├── render_msgpack_test.go
│   │   │   ├── render_test.go
│   │   │   ├── text.go
│   │   │   ├── xml.go
│   │   │   └── yaml.go
│   │   ├── response_writer.go
│   │   ├── response_writer_test.go
│   │   ├── routergroup.go
│   │   ├── routergroup_test.go
│   │   ├── routes_test.go
│   │   ├── test_helpers.go
│   │   ├── testdata/
│   │   │   ├── certificate/
│   │   │   │   ├── cert.pem
│   │   │   │   └── key.pem
│   │   │   ├── protoexample/
│   │   │   │   ├── test.pb.go
│   │   │   │   └── test.proto
│   │   │   └── template/
│   │   │       ├── hello.tmpl
│   │   │       └── raw.tmpl
│   │   ├── tree.go
│   │   ├── tree_test.go
│   │   ├── utils.go
│   │   ├── utils_test.go
│   │   └── version.go
│   ├── middleware/
│   │   ├── cost.go
│   │   ├── gin-swagger/
│   │   │   ├── .gitignore
│   │   │   ├── .travis.yml
│   │   │   ├── LICENSE
│   │   │   ├── README.md
│   │   │   ├── b0x.yml
│   │   │   ├── swagger.go
│   │   │   ├── swaggerFiles/
│   │   │   │   ├── ab0x.go
│   │   │   │   ├── b0xfile__favicon-16x16.png.go
│   │   │   │   ├── b0xfile__favicon-32x32.png.go
│   │   │   │   ├── b0xfile__index.html.go
│   │   │   │   ├── b0xfile__oauth2-redirect.html.go
│   │   │   │   ├── b0xfile__swagger-ui-bundle.js.go
│   │   │   │   ├── b0xfile__swagger-ui-bundle.js.map.go
│   │   │   │   ├── b0xfile__swagger-ui-standalone-preset.js.go
│   │   │   │   ├── b0xfile__swagger-ui-standalone-preset.js.map.go
│   │   │   │   ├── b0xfile__swagger-ui.css.go
│   │   │   │   ├── b0xfile__swagger-ui.css.map.go
│   │   │   │   ├── b0xfile__swagger-ui.js.go
│   │   │   │   └── b0xfile__swagger-ui.js.map.go
│   │   │   └── swagger_test.go
│   │   ├── static/
│   │   │   ├── LICENCE.md
│   │   │   └── static.go
│   │   ├── timeout.go
│   │   └── trace.go
│   ├── provider/
│   │   ├── app/
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── cache/
│   │   │   ├── provider.go
│   │   │   └── services/
│   │   │       ├── cache.go
│   │   │       ├── memory.go
│   │   │       ├── memory_test.go
│   │   │       ├── redis.go
│   │   │       └── redis_test.go
│   │   ├── config/
│   │   │   ├── fake_provider.go
│   │   │   ├── fake_service.go
│   │   │   ├── provider.go
│   │   │   ├── provider_test.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   ├── distributed/
│   │   │   ├── provider_local.go
│   │   │   └── service_local.go
│   │   ├── env/
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   ├── testing_provider.go
│   │   │   └── testing_service.go
│   │   ├── id/
│   │   │   ├── provider.go
│   │   │   ├── provier_test.go
│   │   │   └── service.go
│   │   ├── kernel/
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── log/
│   │   │   ├── formatter/
│   │   │   │   ├── json.go
│   │   │   │   ├── prefix.go
│   │   │   │   └── text.go
│   │   │   ├── provider.go
│   │   │   └── services/
│   │   │       ├── console.go
│   │   │       ├── custom.go
│   │   │       ├── log.go
│   │   │       ├── rotate.go
│   │   │       └── single.go
│   │   ├── orm/
│   │   │   ├── config.go
│   │   │   ├── config_test.go
│   │   │   ├── logger.go
│   │   │   ├── provider.go
│   │   │   └── service.go
│   │   ├── redis/
│   │   │   ├── config.go
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   ├── ssh/
│   │   │   ├── config.go
│   │   │   ├── provider.go
│   │   │   ├── service.go
│   │   │   └── service_test.go
│   │   └── trace/
│   │       ├── provider.go
│   │       └── service.go
│   ├── provider.go
│   └── util/
│       ├── console.go
│       ├── console_test.go
│       ├── exec.go
│       ├── file.go
│       ├── http.go
│       └── zip.go
├── go.mod
├── go.sum
├── index.html
├── main.go
├── package.json
├── src/
│   ├── App.vue
│   ├── components/
│   │   └── HelloWorld.vue
│   ├── main.js
│   └── router/
│       └── index.js
├── static/
│   └── .gitkeep
└── test/
    ├── e2e/
    │   ├── custom-assertions/
    │   │   └── elementCount.js
    │   ├── nightwatch.conf.js
    │   ├── runner.js
    │   └── specs/
    │       └── test.js
    ├── env.go
    └── unit/
        ├── .eslintrc
        ├── jest.conf.js
        ├── setup.js
        └── specs/
            └── HelloWorld.spec.js
Download .txt
Showing preview only (203K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2214 symbols across 266 files)

FILE: app/console/kernel.go
  function RunCommand (line 11) | func RunCommand(container framework.Container) error {
  function AddAppCommand (line 41) | func AddAppCommand(rootCmd *cobra.Command) {

FILE: app/http/kernel.go
  function NewHttpEngine (line 9) | func NewHttpEngine(container framework.Container) (*gin.Engine, error) {

FILE: app/http/middleware/cors/config.go
  type cors (line 10) | type cors struct
    method applyCors (line 62) | func (cors *cors) applyCors(c *gin.Context) {
    method validateWildcardOrigin (line 93) | func (cors *cors) validateWildcardOrigin(origin string) bool {
    method validateOrigin (line 109) | func (cors *cors) validateOrigin(origin string) bool {
    method handlePreflight (line 127) | func (cors *cors) handlePreflight(c *gin.Context) {
    method handleNormal (line 134) | func (cors *cors) handleNormal(c *gin.Context) {
  function newCors (line 40) | func newCors(config Config) *cors {

FILE: app/http/middleware/cors/cors.go
  type Config (line 12) | type Config struct
    method AddAllowMethods (line 59) | func (c *Config) AddAllowMethods(methods ...string) {
    method AddAllowHeaders (line 64) | func (c *Config) AddAllowHeaders(headers ...string) {
    method AddExposeHeaders (line 69) | func (c *Config) AddExposeHeaders(headers ...string) {
    method getAllowedSchemas (line 73) | func (c Config) getAllowedSchemas() []string {
    method validateAllowedSchemas (line 87) | func (c Config) validateAllowedSchemas(origin string) bool {
    method Validate (line 98) | func (c Config) Validate() error {
    method parseWildcardRules (line 113) | func (c Config) parseWildcardRules() [][]string {
  function DefaultConfig (line 146) | func DefaultConfig() Config {
  function Default (line 156) | func Default() gin.HandlerFunc {
  function New (line 163) | func New(config Config) gin.HandlerFunc {

FILE: app/http/middleware/cors/cors_test.go
  function init (line 14) | func init() {
  function newTestRouter (line 18) | func newTestRouter(config Config) *gin.Engine {
  function performRequest (line 33) | func performRequest(r http.Handler, method, origin string) *httptest.Res...
  function performRequestWithHeaders (line 37) | func performRequestWithHeaders(r http.Handler, method, origin string, he...
  function TestConfigAddAllow (line 53) | func TestConfigAddAllow(t *testing.T) {
  function TestBadConfig (line 73) | func TestBadConfig(t *testing.T) {
  function TestNormalize (line 94) | func TestNormalize(t *testing.T) {
  function TestConvert (line 108) | func TestConvert(t *testing.T) {
  function TestGenerateNormalHeaders_AllowAllOrigins (line 116) | func TestGenerateNormalHeaders_AllowAllOrigins(t *testing.T) {
  function TestGenerateNormalHeaders_AllowCredentials (line 132) | func TestGenerateNormalHeaders_AllowCredentials(t *testing.T) {
  function TestGenerateNormalHeaders_ExposedHeaders (line 141) | func TestGenerateNormalHeaders_ExposedHeaders(t *testing.T) {
  function TestGeneratePreflightHeaders (line 150) | func TestGeneratePreflightHeaders(t *testing.T) {
  function TestGeneratePreflightHeaders_AllowCredentials (line 166) | func TestGeneratePreflightHeaders_AllowCredentials(t *testing.T) {
  function TestGeneratePreflightHeaders_AllowMethods (line 175) | func TestGeneratePreflightHeaders_AllowMethods(t *testing.T) {
  function TestGeneratePreflightHeaders_AllowHeaders (line 184) | func TestGeneratePreflightHeaders_AllowHeaders(t *testing.T) {
  function TestGeneratePreflightHeaders_MaxAge (line 193) | func TestGeneratePreflightHeaders_MaxAge(t *testing.T) {
  function TestValidateOrigin (line 202) | func TestValidateOrigin(t *testing.T) {
  function TestPassesAllowOrigins (line 265) | func TestPassesAllowOrigins(t *testing.T) {
  function TestPassesAllowAllOrigins (line 333) | func TestPassesAllowAllOrigins(t *testing.T) {
  function TestWildcard (line 370) | func TestWildcard(t *testing.T) {

FILE: app/http/middleware/cors/examples/example.go
  function main (line 10) | func main() {

FILE: app/http/middleware/cors/utils.go
  type converter (line 10) | type converter
  function generateNormalHeaders (line 12) | func generateNormalHeaders(c Config) http.Header {
  function generatePreflightHeaders (line 29) | func generatePreflightHeaders(c Config) http.Header {
  function normalize (line 62) | func normalize(values []string) []string {
  function convert (line 79) | func convert(s []string, c converter) []string {

FILE: app/http/module/demo/api.go
  type DemoApi (line 8) | type DemoApi struct
    method Demo (line 36) | func (api *DemoApi) Demo(c *gin.Context) {
    method Demo2 (line 47) | func (api *DemoApi) Demo2(c *gin.Context) {
    method DemoPost (line 54) | func (api *DemoApi) DemoPost(c *gin.Context) {
  function Register (line 12) | func Register(r *gin.Engine) error {
  function NewDemoApi (line 24) | func NewDemoApi() *DemoApi {

FILE: app/http/module/demo/api_cache.go
  method DemoRedis (line 11) | func (api *DemoApi) DemoRedis(c *gin.Context) {
  method DemoCache (line 43) | func (api *DemoApi) DemoCache(c *gin.Context) {

FILE: app/http/module/demo/api_orm.go
  method DemoOrm (line 12) | func (api *DemoApi) DemoOrm(c *gin.Context) {

FILE: app/http/module/demo/dto.go
  type UserDTO (line 3) | type UserDTO struct

FILE: app/http/module/demo/mapper.go
  function UserModelsToUserDTOs (line 7) | func UserModelsToUserDTOs(models []UserModel) []UserDTO {
  function StudentsToUserDTOs (line 19) | func StudentsToUserDTOs(students []demoService.Student) []UserDTO {

FILE: app/http/module/demo/model.go
  type UserModel (line 8) | type UserModel struct
  type User (line 15) | type User struct

FILE: app/http/module/demo/repository.go
  type Repository (line 3) | type Repository struct
    method GetUserIds (line 10) | func (r *Repository) GetUserIds() []int {
    method GetUserByIds (line 14) | func (r *Repository) GetUserByIds([]int) []UserModel {
  function NewRepository (line 6) | func NewRepository() *Repository {

FILE: app/http/module/demo/service.go
  type Service (line 3) | type Service struct
    method GetUsers (line 14) | func (s *Service) GetUsers() []UserModel {
  function NewService (line 7) | func NewService() *Service {

FILE: app/http/route.go
  function Routes (line 14) | func Routes(r *gin.Engine) {

FILE: app/http/swagger/docs.go
  type swaggerInfo (line 112) | type swaggerInfo struct
  type s (line 131) | type s struct
    method ReadDoc (line 133) | func (s *s) ReadDoc() string {
  function init (line 162) | func init() {

FILE: app/provider/demo/contract.go
  constant DemoKey (line 3) | DemoKey = "demo"
  type IService (line 5) | type IService interface
  type Student (line 9) | type Student struct

FILE: app/provider/demo/provider.go
  type DemoProvider (line 7) | type DemoProvider struct
    method Name (line 13) | func (sp *DemoProvider) Name() string {
    method Register (line 17) | func (sp *DemoProvider) Register(c framework.Container) framework.NewI...
    method IsDefer (line 21) | func (sp *DemoProvider) IsDefer() bool {
    method Params (line 25) | func (sp *DemoProvider) Params(c framework.Container) []interface{} {
    method Boot (line 29) | func (sp *DemoProvider) Boot(c framework.Container) error {

FILE: app/provider/demo/service.go
  type Service (line 5) | type Service struct
    method GetAllStudent (line 14) | func (s *Service) GetAllStudent() []Student {
  function NewService (line 9) | func NewService(params ...interface{}) (interface{}, error) {

FILE: app/provider/user/contract.go
  constant UserKey (line 3) | UserKey = "user"
  type Service (line 5) | type Service interface

FILE: app/provider/user/provider.go
  type UserProvider (line 7) | type UserProvider struct
    method Name (line 13) | func (sp *UserProvider) Name() string {
    method Register (line 17) | func (sp *UserProvider) Register(c framework.Container) framework.NewI...
    method IsDefer (line 21) | func (sp *UserProvider) IsDefer() bool {
    method Params (line 25) | func (sp *UserProvider) Params(c framework.Container) []interface{} {
    method Boot (line 29) | func (sp *UserProvider) Boot(c framework.Container) error {

FILE: app/provider/user/service.go
  type UserService (line 5) | type UserService struct
    method Foo (line 14) | func (s *UserService) Foo() string {
  function NewUserService (line 9) | func NewUserService(params ...interface{}) (interface{}, error) {

FILE: build/check-versions.js
  function exec (line 7) | function exec (cmd) {

FILE: build/utils.js
  function generateLoaders (line 33) | function generateLoaders (loader, loaderOptions) {

FILE: build/webpack.base.conf.js
  function resolve (line 7) | function resolve (dir) {

FILE: build/webpack.dev.conf.js
  constant HOST (line 13) | const HOST = process.env.HOST
  constant PORT (line 14) | const PORT = process.env.PORT && Number(process.env.PORT)

FILE: build/webpack.prod.conf.js
  method minChunks (line 88) | minChunks (module) {

FILE: framework/cobra/args.go
  type PositionalArgs (line 8) | type PositionalArgs
  function legacyArgs (line 14) | func legacyArgs(cmd *Command, args []string) error {
  function NoArgs (line 28) | func NoArgs(cmd *Command, args []string) error {
  function OnlyValidArgs (line 36) | func OnlyValidArgs(cmd *Command, args []string) error {
  function ArbitraryArgs (line 55) | func ArbitraryArgs(cmd *Command, args []string) error {
  function MinimumNArgs (line 60) | func MinimumNArgs(n int) PositionalArgs {
  function MaximumNArgs (line 70) | func MaximumNArgs(n int) PositionalArgs {
  function ExactArgs (line 80) | func ExactArgs(n int) PositionalArgs {
  function ExactValidArgs (line 92) | func ExactValidArgs(n int) PositionalArgs {
  function RangeArgs (line 102) | func RangeArgs(min int, max int) PositionalArgs {

FILE: framework/cobra/args_test.go
  function TestNoArgs (line 8) | func TestNoArgs(t *testing.T) {
  function TestNoArgsWithArgs (line 20) | func TestNoArgsWithArgs(t *testing.T) {
  function TestOnlyValidArgs (line 35) | func TestOnlyValidArgs(t *testing.T) {
  function TestOnlyValidArgsWithInvalidArgs (line 52) | func TestOnlyValidArgsWithInvalidArgs(t *testing.T) {
  function TestArbitraryArgs (line 72) | func TestArbitraryArgs(t *testing.T) {
  function TestMinimumNArgs (line 83) | func TestMinimumNArgs(t *testing.T) {
  function TestMinimumNArgsWithLessArgs (line 94) | func TestMinimumNArgsWithLessArgs(t *testing.T) {
  function TestMaximumNArgs (line 109) | func TestMaximumNArgs(t *testing.T) {
  function TestMaximumNArgsWithMoreArgs (line 120) | func TestMaximumNArgsWithMoreArgs(t *testing.T) {
  function TestExactArgs (line 135) | func TestExactArgs(t *testing.T) {
  function TestExactArgsWithInvalidCount (line 146) | func TestExactArgsWithInvalidCount(t *testing.T) {
  function TestExactValidArgs (line 161) | func TestExactValidArgs(t *testing.T) {
  function TestExactValidArgsWithInvalidCount (line 172) | func TestExactValidArgsWithInvalidCount(t *testing.T) {
  function TestExactValidArgsWithInvalidArgs (line 187) | func TestExactValidArgsWithInvalidArgs(t *testing.T) {
  function TestRangeArgs (line 207) | func TestRangeArgs(t *testing.T) {
  function TestRangeArgsWithInvalidCount (line 218) | func TestRangeArgsWithInvalidCount(t *testing.T) {
  function TestRootTakesNoArgs (line 233) | func TestRootTakesNoArgs(t *testing.T) {
  function TestRootTakesArgs (line 250) | func TestRootTakesArgs(t *testing.T) {
  function TestChildTakesNoArgs (line 261) | func TestChildTakesNoArgs(t *testing.T) {
  function TestChildTakesArgs (line 278) | func TestChildTakesArgs(t *testing.T) {

FILE: framework/cobra/bash_completions.go
  constant BashCompFilenameExt (line 16) | BashCompFilenameExt     = "cobra_annotation_bash_completion_filename_ext...
  constant BashCompCustom (line 17) | BashCompCustom          = "cobra_annotation_bash_completion_custom"
  constant BashCompOneRequiredFlag (line 18) | BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required...
  constant BashCompSubdirsInDir (line 19) | BashCompSubdirsInDir    = "cobra_annotation_bash_completion_subdirs_in_dir"
  function writePreamble (line 22) | func writePreamble(buf io.StringWriter, name string) {
  function writePostscript (line 383) | func writePostscript(buf io.StringWriter, name string) {
  function writeCommands (line 425) | func writeCommands(buf io.StringWriter, cmd *Command) {
  function writeFlagHandler (line 437) | func writeFlagHandler(buf io.StringWriter, name string, annotations map[...
  constant cbn (line 473) | cbn = "\")\n"
  function writeShortFlag (line 475) | func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) {
  function writeFlag (line 486) | func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) {
  function writeLocalNonPersistentFlag (line 501) | func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) {
  function prepareCustomAnnotationsForFlags (line 514) | func prepareCustomAnnotationsForFlags(cmd *Command) {
  function writeFlags (line 529) | func writeFlags(buf io.StringWriter, cmd *Command) {
  function writeRequiredFlag (line 566) | func writeRequiredFlag(buf io.StringWriter, cmd *Command) {
  function writeRequiredNouns (line 591) | func writeRequiredNouns(buf io.StringWriter, cmd *Command) {
  function writeCmdAliases (line 605) | func writeCmdAliases(buf io.StringWriter, cmd *Command) {
  function writeArgAliases (line 620) | func writeArgAliases(buf io.StringWriter, cmd *Command) {
  function gen (line 628) | func gen(buf io.StringWriter, cmd *Command) {
  method GenBashCompletion (line 659) | func (c *Command) GenBashCompletion(w io.Writer) error {
  function nonCompletableFlag (line 672) | func nonCompletableFlag(flag *pflag.Flag) bool {
  method GenBashCompletionFile (line 677) | func (c *Command) GenBashCompletionFile(filename string) error {

FILE: framework/cobra/bash_completionsV2.go
  method genBashCompletion (line 10) | func (c *Command) genBashCompletion(w io.Writer, includeDesc bool) error {
  function genBashComp (line 17) | func genBashComp(buf io.StringWriter, name string, includeDesc bool) {
  method GenBashCompletionFileV2 (line 288) | func (c *Command) GenBashCompletionFileV2(filename string, includeDesc b...
  method GenBashCompletionV2 (line 300) | func (c *Command) GenBashCompletionV2(w io.Writer, includeDesc bool) err...

FILE: framework/cobra/bash_completions_test.go
  function checkOmit (line 13) | func checkOmit(t *testing.T, found, unexpected string) {
  function check (line 19) | func check(t *testing.T, found, expected string) {
  function checkNumOccurrences (line 25) | func checkNumOccurrences(t *testing.T, found, expected string, expectedO...
  function checkRegex (line 32) | func checkRegex(t *testing.T, found, pattern string) {
  function runShellCheck (line 42) | func runShellCheck(s string) error {
  constant bashCompletionFunc (line 64) | bashCompletionFunc = `__root_custom_func() {
  function TestBashCompletions (line 69) | func TestBashCompletions(t *testing.T) {
  function TestBashCompletionHiddenFlag (line 215) | func TestBashCompletionHiddenFlag(t *testing.T) {
  function TestBashCompletionDeprecatedFlag (line 231) | func TestBashCompletionDeprecatedFlag(t *testing.T) {
  function TestBashCompletionTraverseChildren (line 247) | func TestBashCompletionTraverseChildren(t *testing.T) {

FILE: framework/cobra/cobra.go
  function AddTemplateFunc (line 69) | func AddTemplateFunc(name string, tmplFunc interface{}) {
  function AddTemplateFuncs (line 75) | func AddTemplateFuncs(tmplFuncs template.FuncMap) {
  function OnInitialize (line 83) | func OnInitialize(y ...func()) {
  function Gt (line 92) | func Gt(a interface{}, b interface{}) bool {
  function Eq (line 122) | func Eq(a interface{}, b interface{}) bool {
  function trimRightSpace (line 137) | func trimRightSpace(s string) string {
  function appendIfNotPresent (line 144) | func appendIfNotPresent(s, stringToAppend string) string {
  function rpad (line 152) | func rpad(s string, padding int) string {
  function tmpl (line 158) | func tmpl(w io.Writer, text string, data interface{}) error {
  function ld (line 166) | func ld(s, t string, ignoreCase bool) int {
  function stringInSlice (line 201) | func stringInSlice(a string, list []string) bool {
  function CheckErr (line 211) | func CheckErr(msg interface{}) {
  function WriteStringAndCheck (line 219) | func WriteStringAndCheck(b io.StringWriter, s string) {

FILE: framework/cobra/cobra/cmd/add.go
  function init (line 67) | func init() {
  function validateCmdName (line 77) | func validateCmdName(source string) string {

FILE: framework/cobra/cobra/cmd/add_test.go
  function TestGoldenAddCmd (line 9) | func TestGoldenAddCmd(t *testing.T) {
  function TestValidateCmdName (line 28) | func TestValidateCmdName(t *testing.T) {

FILE: framework/cobra/cobra/cmd/golden_test.go
  function init (line 11) | func init() {
  function ensureLF (line 20) | func ensureLF(content []byte) []byte {
  function compareFiles (line 28) | func compareFiles(pathA, pathB string) error {

FILE: framework/cobra/cobra/cmd/helpers.go
  function init (line 27) | func init() {

FILE: framework/cobra/cobra/cmd/helpers_test.go
  function assertNoErr (line 5) | func assertNoErr(t *testing.T, e error) {

FILE: framework/cobra/cobra/cmd/init.go
  function init (line 48) | func init() {
  function initializeProject (line 53) | func initializeProject(args []string) (string, error) {

FILE: framework/cobra/cobra/cmd/init_test.go
  function getProject (line 13) | func getProject() *Project {
  function TestGoldenInitCmd (line 25) | func TestGoldenInitCmd(t *testing.T) {

FILE: framework/cobra/cobra/cmd/license_agpl.go
  function initAgpl (line 3) | func initAgpl() {

FILE: framework/cobra/cobra/cmd/license_apache_2.go
  function initApache2 (line 18) | func initApache2() {

FILE: framework/cobra/cobra/cmd/license_bsd_clause_2.go
  function initBsdClause2 (line 18) | func initBsdClause2() {

FILE: framework/cobra/cobra/cmd/license_bsd_clause_3.go
  function initBsdClause3 (line 18) | func initBsdClause3() {

FILE: framework/cobra/cobra/cmd/license_gpl_2.go
  function initGpl2 (line 18) | func initGpl2() {

FILE: framework/cobra/cobra/cmd/license_gpl_3.go
  function initGpl3 (line 18) | func initGpl3() {

FILE: framework/cobra/cobra/cmd/license_lgpl.go
  function initLgpl (line 3) | func initLgpl() {

FILE: framework/cobra/cobra/cmd/license_mit.go
  function initMit (line 18) | func initMit() {

FILE: framework/cobra/cobra/cmd/licenses.go
  type License (line 34) | type License struct
  function init (line 41) | func init() {
  function getLicense (line 59) | func getLicense() License {
  function copyrightLine (line 80) | func copyrightLine() string {
  function findLicense (line 94) | func findLicense(name string) License {
  function matchLicense (line 106) | func matchLicense(name string) string {

FILE: framework/cobra/cobra/cmd/project.go
  type Project (line 13) | type Project struct
    method Create (line 29) | func (p *Project) Create() error {
    method createLicenseFile (line 71) | func (p *Project) createLicenseFile() error {
  type Command (line 23) | type Command struct
    method Create (line 85) | func (c *Command) Create() error {

FILE: framework/cobra/cobra/cmd/root.go
  function Execute (line 39) | func Execute() error {
  function init (line 43) | func init() {
  function initConfig (line 59) | func initConfig() {

FILE: framework/cobra/cobra/main.go
  function main (line 22) | func main() {

FILE: framework/cobra/cobra/tpl/main.go
  function MainTemplate (line 3) | func MainTemplate() []byte {
  function RootTemplate (line 18) | func RootTemplate() []byte {
  function AddCommandTemplate (line 103) | func AddCommandTemplate() []byte {

FILE: framework/cobra/cobra_test.go
  function assertNoErr (line 8) | func assertNoErr(t *testing.T, e error) {
  function TestAddTemplateFunctions (line 14) | func TestAddTemplateFunctions(t *testing.T) {

FILE: framework/cobra/command.go
  type FParseErrWhitelist (line 34) | type FParseErrWhitelist
  type Command (line 40) | type Command struct
    method Context (line 238) | func (c *Command) Context() context.Context {
    method SetArgs (line 244) | func (c *Command) SetArgs(a []string) {
    method SetOutput (line 251) | func (c *Command) SetOutput(output io.Writer) {
    method SetOut (line 258) | func (c *Command) SetOut(newOut io.Writer) {
    method SetErr (line 264) | func (c *Command) SetErr(newErr io.Writer) {
    method SetIn (line 270) | func (c *Command) SetIn(newIn io.Reader) {
    method SetUsageFunc (line 275) | func (c *Command) SetUsageFunc(f func(*Command) error) {
    method SetUsageTemplate (line 280) | func (c *Command) SetUsageTemplate(s string) {
    method SetFlagErrorFunc (line 286) | func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {
    method SetHelpFunc (line 291) | func (c *Command) SetHelpFunc(f func(*Command, []string)) {
    method SetHelpCommand (line 296) | func (c *Command) SetHelpCommand(cmd *Command) {
    method SetHelpTemplate (line 301) | func (c *Command) SetHelpTemplate(s string) {
    method SetVersionTemplate (line 306) | func (c *Command) SetVersionTemplate(s string) {
    method SetGlobalNormalizationFunc (line 312) | func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, n...
    method OutOrStdout (line 323) | func (c *Command) OutOrStdout() io.Writer {
    method OutOrStderr (line 328) | func (c *Command) OutOrStderr() io.Writer {
    method ErrOrStderr (line 333) | func (c *Command) ErrOrStderr() io.Writer {
    method InOrStdin (line 338) | func (c *Command) InOrStdin() io.Reader {
    method getOut (line 342) | func (c *Command) getOut(def io.Writer) io.Writer {
    method getErr (line 352) | func (c *Command) getErr(def io.Writer) io.Writer {
    method getIn (line 362) | func (c *Command) getIn(def io.Reader) io.Reader {
    method UsageFunc (line 374) | func (c *Command) UsageFunc() (f func(*Command) error) {
    method Usage (line 394) | func (c *Command) Usage() error {
    method HelpFunc (line 400) | func (c *Command) HelpFunc() func(*Command, []string) {
    method Help (line 421) | func (c *Command) Help() error {
    method UsageString (line 427) | func (c *Command) UsageString() string {
    method FlagErrorFunc (line 448) | func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {
    method UsagePadding (line 464) | func (c *Command) UsagePadding() int {
    method CommandPathPadding (line 474) | func (c *Command) CommandPathPadding() int {
    method NamePadding (line 484) | func (c *Command) NamePadding() int {
    method UsageTemplate (line 492) | func (c *Command) UsageTemplate() string {
    method HelpTemplate (line 527) | func (c *Command) HelpTemplate() string {
    method VersionTemplate (line 541) | func (c *Command) VersionTemplate() string {
    method Find (line 632) | func (c *Command) Find(args []string) (*Command, []string, error) {
    method findSuggestions (line 656) | func (c *Command) findSuggestions(arg string) string {
    method findNext (line 673) | func (c *Command) findNext(next string) *Command {
    method Traverse (line 694) | func (c *Command) Traverse(args []string) (*Command, []string, error) {
    method SuggestionsFor (line 736) | func (c *Command) SuggestionsFor(typedName string) []string {
    method VisitParents (line 757) | func (c *Command) VisitParents(fn func(*Command)) {
    method Root (line 765) | func (c *Command) Root() *Command {
    method ArgsLenAtDash (line 774) | func (c *Command) ArgsLenAtDash() int {
    method execute (line 778) | func (c *Command) execute(a []string) (err error) {
    method preRun (line 893) | func (c *Command) preRun() {
    method ExecuteContext (line 902) | func (c *Command) ExecuteContext(ctx context.Context) error {
    method Execute (line 910) | func (c *Command) Execute() error {
    method ExecuteContextC (line 918) | func (c *Command) ExecuteContextC(ctx context.Context) (*Command, erro...
    method ExecuteC (line 924) | func (c *Command) ExecuteC() (cmd *Command, err error) {
    method ValidateArgs (line 1007) | func (c *Command) ValidateArgs(args []string) error {
    method validateRequiredFlags (line 1014) | func (c *Command) validateRequiredFlags() error {
    method InitDefaultHelpFlag (line 1040) | func (c *Command) InitDefaultHelpFlag() {
    method InitDefaultVersionFlag (line 1057) | func (c *Command) InitDefaultVersionFlag() {
    method InitDefaultHelpCmd (line 1081) | func (c *Command) InitDefaultHelpCmd() {
    method ResetCommands (line 1128) | func (c *Command) ResetCommands() {
    method Commands (line 1143) | func (c *Command) Commands() []*Command {
    method AddCommand (line 1153) | func (c *Command) AddCommand(cmds ...*Command) {
    method RemoveCommand (line 1182) | func (c *Command) RemoveCommand(cmds ...*Command) {
    method Print (line 1216) | func (c *Command) Print(i ...interface{}) {
    method Println (line 1221) | func (c *Command) Println(i ...interface{}) {
    method Printf (line 1226) | func (c *Command) Printf(format string, i ...interface{}) {
    method PrintErr (line 1231) | func (c *Command) PrintErr(i ...interface{}) {
    method PrintErrln (line 1236) | func (c *Command) PrintErrln(i ...interface{}) {
    method PrintErrf (line 1241) | func (c *Command) PrintErrf(format string, i ...interface{}) {
    method CommandPath (line 1246) | func (c *Command) CommandPath() string {
    method UseLine (line 1254) | func (c *Command) UseLine() string {
    method DebugFlags (line 1272) | func (c *Command) DebugFlags() {
    method Name (line 1312) | func (c *Command) Name() string {
    method HasAlias (line 1322) | func (c *Command) HasAlias(s string) bool {
    method CalledAs (line 1333) | func (c *Command) CalledAs() string {
    method hasNameOrAliasPrefix (line 1342) | func (c *Command) hasNameOrAliasPrefix(prefix string) bool {
    method NameAndAliases (line 1357) | func (c *Command) NameAndAliases() string {
    method HasExample (line 1362) | func (c *Command) HasExample() bool {
    method Runnable (line 1367) | func (c *Command) Runnable() bool {
    method HasSubCommands (line 1372) | func (c *Command) HasSubCommands() bool {
    method IsAvailableCommand (line 1378) | func (c *Command) IsAvailableCommand() bool {
    method IsAdditionalHelpTopicCommand (line 1399) | func (c *Command) IsAdditionalHelpTopicCommand() bool {
    method HasHelpSubCommands (line 1419) | func (c *Command) HasHelpSubCommands() bool {
    method HasAvailableSubCommands (line 1433) | func (c *Command) HasAvailableSubCommands() bool {
    method HasParent (line 1448) | func (c *Command) HasParent() bool {
    method GlobalNormalizationFunc (line 1453) | func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name...
    method Flags (line 1459) | func (c *Command) Flags() *flag.FlagSet {
    method LocalNonPersistentFlags (line 1472) | func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
    method LocalFlags (line 1485) | func (c *Command) LocalFlags() *flag.FlagSet {
    method InheritedFlags (line 1511) | func (c *Command) InheritedFlags() *flag.FlagSet {
    method NonInheritedFlags (line 1536) | func (c *Command) NonInheritedFlags() *flag.FlagSet {
    method PersistentFlags (line 1541) | func (c *Command) PersistentFlags() *flag.FlagSet {
    method ResetFlags (line 1553) | func (c *Command) ResetFlags() {
    method HasFlags (line 1567) | func (c *Command) HasFlags() bool {
    method HasPersistentFlags (line 1572) | func (c *Command) HasPersistentFlags() bool {
    method HasLocalFlags (line 1577) | func (c *Command) HasLocalFlags() bool {
    method HasInheritedFlags (line 1582) | func (c *Command) HasInheritedFlags() bool {
    method HasAvailableFlags (line 1588) | func (c *Command) HasAvailableFlags() bool {
    method HasAvailablePersistentFlags (line 1593) | func (c *Command) HasAvailablePersistentFlags() bool {
    method HasAvailableLocalFlags (line 1599) | func (c *Command) HasAvailableLocalFlags() bool {
    method HasAvailableInheritedFlags (line 1605) | func (c *Command) HasAvailableInheritedFlags() bool {
    method Flag (line 1610) | func (c *Command) Flag(name string) (flag *flag.Flag) {
    method persistentFlag (line 1621) | func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
    method ParseFlags (line 1634) | func (c *Command) ParseFlags(args []string) error {
    method Parent (line 1658) | func (c *Command) Parent() *Command {
    method mergePersistentFlags (line 1664) | func (c *Command) mergePersistentFlags() {
    method updateParentsPflags (line 1673) | func (c *Command) updateParentsPflags() {
  function hasNoOptDefVal (line 553) | func hasNoOptDefVal(name string, fs *flag.FlagSet) bool {
  function shortHasNoOptDefVal (line 561) | func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool {
  function stripFlags (line 573) | func stripFlags(args []string, c *Command) []string {
  function argsMinusFirstX (line 613) | func argsMinusFirstX(args []string, x string) []string {
  function isFlagArg (line 625) | func isFlagArg(arg string) bool {
  type commandSorterByName (line 1136) | type commandSorterByName
    method Len (line 1138) | func (c commandSorterByName) Len() int           { return len(c) }
    method Swap (line 1139) | func (c commandSorterByName) Swap(i, j int)      { c[i], c[j] = c[j], ...
    method Less (line 1140) | func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() ...

FILE: framework/cobra/command_test.go
  function emptyRun (line 16) | func emptyRun(*Command, []string) {}
  function executeCommand (line 18) | func executeCommand(root *Command, args ...string) (output string, err e...
  function executeCommandWithContext (line 23) | func executeCommandWithContext(ctx context.Context, root *Command, args ...
  function executeCommandC (line 34) | func executeCommandC(root *Command, args ...string) (c *Command, output ...
  function executeCommandWithContextC (line 45) | func executeCommandWithContextC(ctx context.Context, root *Command, args...
  function resetCommandLineFlagSet (line 56) | func resetCommandLineFlagSet() {
  function checkStringContains (line 60) | func checkStringContains(t *testing.T, got, expected string) {
  function checkStringOmits (line 66) | func checkStringOmits(t *testing.T, got, expected string) {
  constant onetwo (line 72) | onetwo = "one two"
  function TestSingleCommand (line 74) | func TestSingleCommand(t *testing.T) {
  function TestChildCommand (line 99) | func TestChildCommand(t *testing.T) {
  function TestCallCommandWithoutSubcommands (line 124) | func TestCallCommandWithoutSubcommands(t *testing.T) {
  function TestRootExecuteUnknownCommand (line 132) | func TestRootExecuteUnknownCommand(t *testing.T) {
  function TestSubcommandExecuteC (line 145) | func TestSubcommandExecuteC(t *testing.T) {
  function TestExecuteContext (line 163) | func TestExecuteContext(t *testing.T) {
  function TestExecuteContextC (line 192) | func TestExecuteContextC(t *testing.T) {
  function TestExecute_NoContext (line 221) | func TestExecute_NoContext(t *testing.T) {
  function TestRootUnknownCommandSilenced (line 248) | func TestRootUnknownCommandSilenced(t *testing.T) {
  function TestCommandAlias (line 260) | func TestCommandAlias(t *testing.T) {
  function TestEnablePrefixMatching (line 291) | func TestEnablePrefixMatching(t *testing.T) {
  function TestAliasPrefixMatching (line 320) | func TestAliasPrefixMatching(t *testing.T) {
  function TestChildSameName (line 358) | func TestChildSameName(t *testing.T) {
  function TestGrandChildSameName (line 386) | func TestGrandChildSameName(t *testing.T) {
  function TestFlagLong (line 412) | func TestFlagLong(t *testing.T) {
  function TestFlagShort (line 449) | func TestFlagShort(t *testing.T) {
  function TestChildFlag (line 483) | func TestChildFlag(t *testing.T) {
  function TestChildFlagWithParentLocalFlag (line 504) | func TestChildFlagWithParentLocalFlag(t *testing.T) {
  function TestFlagInvalidInput (line 525) | func TestFlagInvalidInput(t *testing.T) {
  function TestFlagBeforeCommand (line 537) | func TestFlagBeforeCommand(t *testing.T) {
  function TestStripFlags (line 564) | func TestStripFlags(t *testing.T) {
  function TestDisableFlagParsing (line 637) | func TestDisableFlagParsing(t *testing.T) {
  function TestPersistentFlagsOnSameCommand (line 661) | func TestPersistentFlagsOnSameCommand(t *testing.T) {
  function TestEmptyInputs (line 691) | func TestEmptyInputs(t *testing.T) {
  function TestOverwrittenFlag (line 710) | func TestOverwrittenFlag(t *testing.T) {
  function TestPersistentFlagsOnChild (line 742) | func TestPersistentFlagsOnChild(t *testing.T) {
  function TestRequiredFlags (line 777) | func TestRequiredFlags(t *testing.T) {
  function TestPersistentRequiredFlags (line 795) | func TestPersistentRequiredFlags(t *testing.T) {
  function TestPersistentRequiredFlagsWithDisableFlagParsing (line 820) | func TestPersistentRequiredFlagsWithDisableFlagParsing(t *testing.T) {
  function TestInitHelpFlagMergesFlags (line 851) | func TestInitHelpFlagMergesFlags(t *testing.T) {
  function TestHelpCommandExecuted (line 865) | func TestHelpCommandExecuted(t *testing.T) {
  function TestHelpCommandExecutedOnChild (line 877) | func TestHelpCommandExecutedOnChild(t *testing.T) {
  function TestSetHelpCommand (line 890) | func TestSetHelpCommand(t *testing.T) {
  function TestHelpFlagExecuted (line 913) | func TestHelpFlagExecuted(t *testing.T) {
  function TestHelpFlagExecutedOnChild (line 924) | func TestHelpFlagExecutedOnChild(t *testing.T) {
  function TestHelpFlagInHelp (line 941) | func TestHelpFlagInHelp(t *testing.T) {
  function TestFlagsInUsage (line 955) | func TestFlagsInUsage(t *testing.T) {
  function TestHelpExecutedOnNonRunnableChild (line 965) | func TestHelpExecutedOnNonRunnableChild(t *testing.T) {
  function TestVersionFlagExecuted (line 978) | func TestVersionFlagExecuted(t *testing.T) {
  function TestVersionFlagExecutedWithNoName (line 989) | func TestVersionFlagExecutedWithNoName(t *testing.T) {
  function TestShortAndLongVersionFlagInHelp (line 1000) | func TestShortAndLongVersionFlagInHelp(t *testing.T) {
  function TestLongVersionFlagOnlyInHelpWhenShortPredefined (line 1011) | func TestLongVersionFlagOnlyInHelpWhenShortPredefined(t *testing.T) {
  function TestShorthandVersionFlagExecuted (line 1024) | func TestShorthandVersionFlagExecuted(t *testing.T) {
  function TestVersionTemplate (line 1035) | func TestVersionTemplate(t *testing.T) {
  function TestShorthandVersionTemplate (line 1047) | func TestShorthandVersionTemplate(t *testing.T) {
  function TestVersionFlagExecutedOnSubcommand (line 1059) | func TestVersionFlagExecutedOnSubcommand(t *testing.T) {
  function TestShorthandVersionFlagExecutedOnSubcommand (line 1071) | func TestShorthandVersionFlagExecutedOnSubcommand(t *testing.T) {
  function TestVersionFlagOnlyAddedToRoot (line 1083) | func TestVersionFlagOnlyAddedToRoot(t *testing.T) {
  function TestShortVersionFlagOnlyAddedToRoot (line 1095) | func TestShortVersionFlagOnlyAddedToRoot(t *testing.T) {
  function TestVersionFlagOnlyExistsIfVersionNonEmpty (line 1107) | func TestVersionFlagOnlyExistsIfVersionNonEmpty(t *testing.T) {
  function TestShorthandVersionFlagOnlyExistsIfVersionNonEmpty (line 1117) | func TestShorthandVersionFlagOnlyExistsIfVersionNonEmpty(t *testing.T) {
  function TestShorthandVersionFlagOnlyAddedIfShorthandNotDefined (line 1127) | func TestShorthandVersionFlagOnlyAddedIfShorthandNotDefined(t *testing.T) {
  function TestShorthandVersionFlagOnlyAddedIfVersionNotDefined (line 1139) | func TestShorthandVersionFlagOnlyAddedIfVersionNotDefined(t *testing.T) {
  function TestUsageIsNotPrintedTwice (line 1150) | func TestUsageIsNotPrintedTwice(t *testing.T) {
  function TestVisitParents (line 1161) | func TestVisitParents(t *testing.T) {
  function TestSuggestions (line 1190) | func TestSuggestions(t *testing.T) {
  function TestRemoveCommand (line 1237) | func TestRemoveCommand(t *testing.T) {
  function TestReplaceCommandWithRemove (line 1249) | func TestReplaceCommandWithRemove(t *testing.T) {
  function TestDeprecatedCommand (line 1280) | func TestDeprecatedCommand(t *testing.T) {
  function TestHooks (line 1297) | func TestHooks(t *testing.T) {
  function TestPersistentHooks (line 1349) | func TestPersistentHooks(t *testing.T) {
  function TestGlobalNormFuncPropagation (line 1453) | func TestGlobalNormFuncPropagation(t *testing.T) {
  function TestNormPassedOnLocal (line 1473) | func TestNormPassedOnLocal(t *testing.T) {
  function TestNormPassedOnInherited (line 1487) | func TestNormPassedOnInherited(t *testing.T) {
  function TestConsistentNormalizedName (line 1515) | func TestConsistentNormalizedName(t *testing.T) {
  function TestFlagOnPflagCommandLine (line 1533) | func TestFlagOnPflagCommandLine(t *testing.T) {
  function TestHiddenCommandExecutes (line 1548) | func TestHiddenCommandExecutes(t *testing.T) {
  function TestHiddenCommandIsHidden (line 1570) | func TestHiddenCommandIsHidden(t *testing.T) {
  function TestCommandsAreSorted (line 1577) | func TestCommandsAreSorted(t *testing.T) {
  function TestEnableCommandSortingIsDisabled (line 1599) | func TestEnableCommandSortingIsDisabled(t *testing.T) {
  function TestSetOutput (line 1620) | func TestSetOutput(t *testing.T) {
  function TestSetOut (line 1628) | func TestSetOut(t *testing.T) {
  function TestSetErr (line 1636) | func TestSetErr(t *testing.T) {
  function TestSetIn (line 1644) | func TestSetIn(t *testing.T) {
  function TestUsageStringRedirected (line 1652) | func TestUsageStringRedirected(t *testing.T) {
  function TestCommandPrintRedirection (line 1668) | func TestCommandPrintRedirection(t *testing.T) {
  function TestFlagErrorFunc (line 1709) | func TestFlagErrorFunc(t *testing.T) {
  function TestSortedFlags (line 1729) | func TestSortedFlags(t *testing.T) {
  function TestMergeCommandLineToFlags (line 1755) | func TestMergeCommandLineToFlags(t *testing.T) {
  function TestUseDeprecatedFlags (line 1769) | func TestUseDeprecatedFlags(t *testing.T) {
  function TestTraverseWithParentFlags (line 1781) | func TestTraverseWithParentFlags(t *testing.T) {
  function TestTraverseNoParentFlags (line 1803) | func TestTraverseNoParentFlags(t *testing.T) {
  function TestTraverseWithBadParentFlags (line 1823) | func TestTraverseWithBadParentFlags(t *testing.T) {
  function TestTraverseWithBadChildFlag (line 1841) | func TestTraverseWithBadChildFlag(t *testing.T) {
  function TestTraverseWithTwoSubcommands (line 1862) | func TestTraverseWithTwoSubcommands(t *testing.T) {
  function TestUpdateName (line 1884) | func TestUpdateName(t *testing.T) {
  type calledAsTestcase (line 1894) | type calledAsTestcase struct
    method test (line 1901) | func (tc *calledAsTestcase) test(t *testing.T) {
  function TestCalledAs (line 1936) | func TestCalledAs(t *testing.T) {
  function TestFParseErrWhitelistBackwardCompatibility (line 1957) | func TestFParseErrWhitelistBackwardCompatibility(t *testing.T) {
  function TestFParseErrWhitelistSameCommand (line 1968) | func TestFParseErrWhitelistSameCommand(t *testing.T) {
  function TestFParseErrWhitelistParentCommand (line 1984) | func TestFParseErrWhitelistParentCommand(t *testing.T) {
  function TestFParseErrWhitelistChildCommand (line 2008) | func TestFParseErrWhitelistChildCommand(t *testing.T) {
  function TestFParseErrWhitelistSiblingCommand (line 2031) | func TestFParseErrWhitelistSiblingCommand(t *testing.T) {

FILE: framework/cobra/command_win.go
  function preExecHook (line 16) | func preExecHook(c *Command) {

FILE: framework/cobra/completions.go
  constant ShellCompRequestCmd (line 15) | ShellCompRequestCmd = "__complete"
  constant ShellCompNoDescRequestCmd (line 18) | ShellCompNoDescRequestCmd = "__completeNoDesc"
  type ShellCompDirective (line 29) | type ShellCompDirective
    method string (line 121) | func (d ShellCompDirective) string() string {
  type flagCompError (line 31) | type flagCompError struct
    method Error (line 36) | func (e *flagCompError) Error() string {
  constant ShellCompDirectiveError (line 42) | ShellCompDirectiveError ShellCompDirective = 1 << iota
  constant ShellCompDirectiveNoSpace (line 46) | ShellCompDirectiveNoSpace
  constant ShellCompDirectiveNoFileComp (line 50) | ShellCompDirectiveNoFileComp
  constant ShellCompDirectiveFilterFileExt (line 57) | ShellCompDirectiveFilterFileExt
  constant ShellCompDirectiveFilterDirs (line 64) | ShellCompDirectiveFilterDirs
  constant shellCompDirectiveMaxValue (line 70) | shellCompDirectiveMaxValue
  constant ShellCompDirectiveDefault (line 75) | ShellCompDirectiveDefault ShellCompDirective = 0
  constant compCmdName (line 80) | compCmdName              = "completion"
  constant compCmdNoDescFlagName (line 81) | compCmdNoDescFlagName    = "no-descriptions"
  constant compCmdNoDescFlagDesc (line 82) | compCmdNoDescFlagDesc    = "disable completion descriptions"
  constant compCmdNoDescFlagDefault (line 83) | compCmdNoDescFlagDefault = false
  type CompletionOptions (line 87) | type CompletionOptions struct
  function NoFileCompletions (line 100) | func NoFileCompletions(cmd *Command, args []string, toComplete string) (...
  method RegisterFlagCompletionFunc (line 105) | func (c *Command) RegisterFlagCompletionFunc(flagName string, f func(cmd...
  method initCompleteCmd (line 149) | func (c *Command) initCompleteCmd(args []string) {
  method getCompletions (line 215) | func (c *Command) getCompletions(args []string) (*Command, []string, She...
  function getFlagNameCompletions (line 427) | func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string {
  function completeRequireFlags (line 460) | func completeRequireFlags(finalCmd *Command, toComplete string) []string {
  function checkIfFlagCompletion (line 485) | func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg str...
  method initDefaultCompletionCmd (line 576) | func (c *Command) initDefaultCompletionCmd() {
  function findFlag (line 721) | func findFlag(cmd *Command, name string) *pflag.Flag {
  function CompDebug (line 744) | func CompDebug(msg string, printToStdErr bool) {
  function CompDebugln (line 768) | func CompDebugln(msg string, printToStdErr bool) {
  function CompError (line 773) | func CompError(msg string) {
  function CompErrorln (line 779) | func CompErrorln(msg string) {

FILE: framework/cobra/completions_test.go
  function validArgsFunc (line 10) | func validArgsFunc(cmd *Command, args []string, toComplete string) ([]st...
  function validArgsFunc2 (line 24) | func validArgsFunc2(cmd *Command, args []string, toComplete string) ([]s...
  function TestCmdNameCompletionInGo (line 38) | func TestCmdNameCompletionInGo(t *testing.T) {
  function TestNoCmdNameCompletionInGo (line 140) | func TestNoCmdNameCompletionInGo(t *testing.T) {
  function TestValidArgsCompletionInGo (line 305) | func TestValidArgsCompletionInGo(t *testing.T) {
  function TestValidArgsAndCmdCompletionInGo (line 359) | func TestValidArgsAndCmdCompletionInGo(t *testing.T) {
  function TestValidArgsFuncAndCmdCompletionInGo (line 409) | func TestValidArgsFuncAndCmdCompletionInGo(t *testing.T) {
  function TestFlagNameCompletionInGo (line 476) | func TestFlagNameCompletionInGo(t *testing.T) {
  function TestFlagNameCompletionInGoWithDesc (line 559) | func TestFlagNameCompletionInGoWithDesc(t *testing.T) {
  function TestFlagNameCompletionRepeat (line 643) | func TestFlagNameCompletionRepeat(t *testing.T) {
  function TestRequiredFlagNameCompletionInGo (line 775) | func TestRequiredFlagNameCompletionInGo(t *testing.T) {
  function TestFlagFileExtFilterCompletionInGo (line 969) | func TestFlagFileExtFilterCompletionInGo(t *testing.T) {
  function TestFlagDirFilterCompletionInGo (line 1091) | func TestFlagDirFilterCompletionInGo(t *testing.T) {
  function TestValidArgsFuncCmdContext (line 1207) | func TestValidArgsFuncCmdContext(t *testing.T) {
  function TestValidArgsFuncSingleCmd (line 1249) | func TestValidArgsFuncSingleCmd(t *testing.T) {
  function TestValidArgsFuncSingleCmdInvalidArg (line 1288) | func TestValidArgsFuncSingleCmdInvalidArg(t *testing.T) {
  function TestValidArgsFuncChildCmds (line 1315) | func TestValidArgsFuncChildCmds(t *testing.T) {
  function TestValidArgsFuncAliases (line 1419) | func TestValidArgsFuncAliases(t *testing.T) {
  function TestValidArgsFuncInBashScript (line 1475) | func TestValidArgsFuncInBashScript(t *testing.T) {
  function TestNoValidArgsFuncInBashScript (line 1491) | func TestNoValidArgsFuncInBashScript(t *testing.T) {
  function TestCompleteCmdInBashScript (line 1506) | func TestCompleteCmdInBashScript(t *testing.T) {
  function TestCompleteNoDesCmdInZshScript (line 1522) | func TestCompleteNoDesCmdInZshScript(t *testing.T) {
  function TestCompleteCmdInZshScript (line 1538) | func TestCompleteCmdInZshScript(t *testing.T) {
  function TestFlagCompletionInGo (line 1555) | func TestFlagCompletionInGo(t *testing.T) {
  function TestValidArgsFuncChildCmdsWithDesc (line 1648) | func TestValidArgsFuncChildCmdsWithDesc(t *testing.T) {
  function TestFlagCompletionWithNotInterspersedArgs (line 1752) | func TestFlagCompletionWithNotInterspersedArgs(t *testing.T) {
  function TestFlagCompletionWorksRootCommandAddedAfterFlags (line 1974) | func TestFlagCompletionWorksRootCommandAddedAfterFlags(t *testing.T) {
  function TestFlagCompletionInGoWithDesc (line 2009) | func TestFlagCompletionInGoWithDesc(t *testing.T) {
  function TestValidArgsNotValidArgsFunc (line 2102) | func TestValidArgsNotValidArgsFunc(t *testing.T) {
  function TestArgAliasesCompletionInGo (line 2145) | func TestArgAliasesCompletionInGo(t *testing.T) {
  function TestCompleteHelp (line 2203) | func TestCompleteHelp(t *testing.T) {
  function removeCompCmd (line 2273) | func removeCompCmd(rootCmd *Command) {
  function TestDefaultCompletionCmd (line 2283) | func TestDefaultCompletionCmd(t *testing.T) {
  function TestCompleteCompletion (line 2403) | func TestCompleteCompletion(t *testing.T) {
  function TestMultipleShorthandFlagCompletion (line 2454) | func TestMultipleShorthandFlagCompletion(t *testing.T) {

FILE: framework/cobra/doc/cmd_test.go
  function emptyRun (line 10) | func emptyRun(*cobra.Command, []string) {}
  function init (line 12) | func init() {
  function checkStringContains (line 81) | func checkStringContains(t *testing.T, got, expected string) {
  function checkStringOmits (line 87) | func checkStringOmits(t *testing.T, got, expected string) {

FILE: framework/cobra/doc/man_docs.go
  function GenManTree (line 37) | func GenManTree(cmd *cobra.Command, header *GenManHeader, dir string) er...
  function GenManTreeFromOpts (line 47) | func GenManTreeFromOpts(cmd *cobra.Command, opts GenManTreeOptions) error {
  type GenManTreeOptions (line 83) | type GenManTreeOptions struct
  type GenManHeader (line 93) | type GenManHeader struct
  function GenMan (line 104) | func GenMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error {
  function fillHeader (line 117) | func fillHeader(header *GenManHeader, name string, disableAutoGen bool) ...
  function manPreamble (line 142) | func manPreamble(buf io.StringWriter, header *GenManHeader, cmd *cobra.C...
  function manPrintFlags (line 158) | func manPrintFlags(buf io.StringWriter, flags *pflag.FlagSet) {
  function manPrintOptions (line 186) | func manPrintOptions(buf io.StringWriter, command *cobra.Command) {
  function genMan (line 201) | func genMan(cmd *cobra.Command, header *GenManHeader) []byte {

FILE: framework/cobra/doc/man_docs_test.go
  function assertNoErr (line 16) | func assertNoErr(t *testing.T, e error) {
  function translate (line 22) | func translate(in string) string {
  function TestGenManDoc (line 26) | func TestGenManDoc(t *testing.T) {
  function TestGenManNoHiddenParents (line 56) | func TestGenManNoHiddenParents(t *testing.T) {
  function TestGenManNoGenTag (line 92) | func TestGenManNoGenTag(t *testing.T) {
  function TestGenManSeeAlso (line 114) | func TestGenManSeeAlso(t *testing.T) {
  function TestManPrintFlagsHidesShortDeperecated (line 139) | func TestManPrintFlagsHidesShortDeperecated(t *testing.T) {
  function TestGenManTree (line 154) | func TestGenManTree(t *testing.T) {
  function assertLineFound (line 176) | func assertLineFound(scanner *bufio.Scanner, expectedLine string) error {
  function assertNextLineEquals (line 191) | func assertNextLineEquals(scanner *bufio.Scanner, expectedLine string) e...
  function BenchmarkGenManToFile (line 207) | func BenchmarkGenManToFile(b *testing.B) {

FILE: framework/cobra/doc/man_examples_test.go
  function ExampleGenManTree (line 11) | func ExampleGenManTree() {
  function ExampleGenMan (line 23) | func ExampleGenMan() {

FILE: framework/cobra/doc/md_docs.go
  function printOptions (line 29) | func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) er...
  function GenMarkdown (line 49) | func GenMarkdown(cmd *cobra.Command, w io.Writer) error {
  function GenMarkdownCustom (line 54) | func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func...
  function GenMarkdownTree (line 122) | func GenMarkdownTree(cmd *cobra.Command, dir string) error {
  function GenMarkdownTreeCustom (line 130) | func GenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender...

FILE: framework/cobra/doc/md_docs_test.go
  function TestGenMdDoc (line 13) | func TestGenMdDoc(t *testing.T) {
  function TestGenMdDocWithNoLongOrSynopsis (line 31) | func TestGenMdDocWithNoLongOrSynopsis(t *testing.T) {
  function TestGenMdNoHiddenParents (line 45) | func TestGenMdNoHiddenParents(t *testing.T) {
  function TestGenMdNoTag (line 68) | func TestGenMdNoTag(t *testing.T) {
  function TestGenMdTree (line 81) | func TestGenMdTree(t *testing.T) {
  function BenchmarkGenMarkdownToFile (line 98) | func BenchmarkGenMarkdownToFile(b *testing.B) {

FILE: framework/cobra/doc/rest_docs.go
  function printOptionsReST (line 29) | func printOptionsReST(buf *bytes.Buffer, cmd *cobra.Command, name string...
  function defaultLinkHandler (line 51) | func defaultLinkHandler(name, ref string) string {
  function GenReST (line 56) | func GenReST(cmd *cobra.Command, w io.Writer) error {
  function GenReSTCustom (line 61) | func GenReSTCustom(cmd *cobra.Command, w io.Writer, linkHandler func(str...
  function GenReSTTree (line 137) | func GenReSTTree(cmd *cobra.Command, dir string) error {
  function GenReSTTreeCustom (line 144) | func GenReSTTreeCustom(cmd *cobra.Command, dir string, filePrepender fun...
  function indentString (line 172) | func indentString(s, p string) string {

FILE: framework/cobra/doc/rest_docs_test.go
  function TestGenRSTDoc (line 13) | func TestGenRSTDoc(t *testing.T) {
  function TestGenRSTNoHiddenParents (line 30) | func TestGenRSTNoHiddenParents(t *testing.T) {
  function TestGenRSTNoTag (line 53) | func TestGenRSTNoTag(t *testing.T) {
  function TestGenRSTTree (line 67) | func TestGenRSTTree(t *testing.T) {
  function BenchmarkGenReSTToFile (line 85) | func BenchmarkGenReSTToFile(b *testing.B) {

FILE: framework/cobra/doc/util.go
  function hasSeeAlso (line 25) | func hasSeeAlso(cmd *cobra.Command) bool {
  function forceMultiLine (line 40) | func forceMultiLine(s string) string {
  type byName (line 47) | type byName
    method Len (line 49) | func (s byName) Len() int           { return len(s) }
    method Swap (line 50) | func (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
    method Less (line 51) | func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }

FILE: framework/cobra/doc/yaml_docs.go
  type cmdOption (line 29) | type cmdOption struct
  type cmdDoc (line 36) | type cmdDoc struct
  function GenYamlTree (line 52) | func GenYamlTree(cmd *cobra.Command, dir string) error {
  function GenYamlTreeCustom (line 59) | func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender, li...
  function GenYaml (line 87) | func GenYaml(cmd *cobra.Command, w io.Writer) error {
  function GenYamlCustom (line 92) | func GenYamlCustom(cmd *cobra.Command, w io.Writer, linkHandler func(str...
  function genFlagResult (line 148) | func genFlagResult(flags *pflag.FlagSet) []cmdOption {

FILE: framework/cobra/doc/yaml_docs_test.go
  function TestGenYamlDoc (line 13) | func TestGenYamlDoc(t *testing.T) {
  function TestGenYamlNoTag (line 29) | func TestGenYamlNoTag(t *testing.T) {
  function TestGenYamlTree (line 42) | func TestGenYamlTree(t *testing.T) {
  function TestGenYamlDocRunnable (line 60) | func TestGenYamlDocRunnable(t *testing.T) {
  function BenchmarkGenYamlToFile (line 71) | func BenchmarkGenYamlToFile(b *testing.B) {

FILE: framework/cobra/fish_completions.go
  function genFishComp (line 11) | func genFishComp(buf io.StringWriter, name string, includeDesc bool) {
  method GenFishCompletion (line 203) | func (c *Command) GenFishCompletion(w io.Writer, includeDesc bool) error {
  method GenFishCompletionFile (line 211) | func (c *Command) GenFishCompletionFile(filename string, includeDesc boo...

FILE: framework/cobra/fish_completions_test.go
  function TestCompleteNoDesCmdInFishScript (line 8) | func TestCompleteNoDesCmdInFishScript(t *testing.T) {
  function TestCompleteCmdInFishScript (line 24) | func TestCompleteCmdInFishScript(t *testing.T) {
  function TestProgWithDash (line 41) | func TestProgWithDash(t *testing.T) {
  function TestProgWithColon (line 56) | func TestProgWithColon(t *testing.T) {

FILE: framework/cobra/hade_command.go
  method SetContainer (line 10) | func (c *Command) SetContainer(container framework.Container) {
  method GetContainer (line 15) | func (c *Command) GetContainer() framework.Container {
  type CronSpec (line 20) | type CronSpec struct
  method SetParantNull (line 27) | func (c *Command) SetParantNull() {
  method AddCronCommand (line 32) | func (c *Command) AddCronCommand(spec string, cmd *Command) {

FILE: framework/cobra/hade_command_contract.go
  method MustMakeApp (line 6) | func (c *Command) MustMakeApp() contract.App {
  method MustMakeKernel (line 11) | func (c *Command) MustMakeKernel() contract.Kernel {

FILE: framework/cobra/hade_command_distributed.go
  method AddDistributedCronCommand (line 15) | func (c *Command) AddDistributedCronCommand(serviceName string, spec str...

FILE: framework/cobra/powershell_completions.go
  function genPowerShellComp (line 13) | func genPowerShellComp(buf io.StringWriter, name string, includeDesc boo...
  method genPowerShellCompletion (line 248) | func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool)...
  method genPowerShellCompletionFile (line 255) | func (c *Command) genPowerShellCompletionFile(filename string, includeDe...
  method GenPowerShellCompletionFile (line 266) | func (c *Command) GenPowerShellCompletionFile(filename string) error {
  method GenPowerShellCompletion (line 272) | func (c *Command) GenPowerShellCompletion(w io.Writer) error {
  method GenPowerShellCompletionFileWithDesc (line 277) | func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) e...
  method GenPowerShellCompletionWithDesc (line 283) | func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error {

FILE: framework/cobra/shell_completions.go
  method MarkFlagRequired (line 10) | func (c *Command) MarkFlagRequired(name string) error {
  method MarkPersistentFlagRequired (line 17) | func (c *Command) MarkPersistentFlagRequired(name string) error {
  function MarkFlagRequired (line 24) | func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
  method MarkFlagFilename (line 30) | func (c *Command) MarkFlagFilename(name string, extensions ...string) er...
  method MarkFlagCustom (line 40) | func (c *Command) MarkFlagCustom(name string, f string) error {
  method MarkPersistentFlagFilename (line 47) | func (c *Command) MarkPersistentFlagFilename(name string, extensions ......
  function MarkFlagFilename (line 53) | func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...s...
  function MarkFlagCustom (line 63) | func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error {
  method MarkFlagDirname (line 69) | func (c *Command) MarkFlagDirname(name string) error {
  method MarkPersistentFlagDirname (line 76) | func (c *Command) MarkPersistentFlagDirname(name string) error {
  function MarkFlagDirname (line 82) | func MarkFlagDirname(flags *pflag.FlagSet, name string) error {

FILE: framework/cobra/zsh_completions.go
  method GenZshCompletionFile (line 11) | func (c *Command) GenZshCompletionFile(filename string) error {
  method GenZshCompletion (line 17) | func (c *Command) GenZshCompletion(w io.Writer) error {
  method GenZshCompletionFileNoDesc (line 22) | func (c *Command) GenZshCompletionFileNoDesc(filename string) error {
  method GenZshCompletionNoDesc (line 28) | func (c *Command) GenZshCompletionNoDesc(w io.Writer) error {
  method MarkZshCompPositionalArgumentFile (line 41) | func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, pat...
  method MarkZshCompPositionalArgumentWords (line 52) | func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, wo...
  method genZshCompletionFile (line 56) | func (c *Command) genZshCompletionFile(filename string, includeDesc bool...
  method genZshCompletion (line 66) | func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error {
  function genZshComp (line 73) | func genZshComp(buf io.StringWriter, name string, includeDesc bool) {

FILE: framework/command/app.go
  function initAppCommand (line 28) | func initAppCommand() *cobra.Command {
  function startAppServe (line 52) | func startAppServe(server *http.Server, c framework.Container) error {

FILE: framework/command/build.go
  function initBuildCommand (line 12) | func initBuildCommand() *cobra.Command {

FILE: framework/command/cmd.go
  function initCmdCommand (line 20) | func initCmdCommand() *cobra.Command {

FILE: framework/command/config.go
  function initConfigCommand (line 11) | func initConfigCommand() *cobra.Command {

FILE: framework/command/cron.go
  function initCronCommand (line 21) | func initCronCommand() *cobra.Command {

FILE: framework/command/deploy.go
  function initDeployCommand (line 22) | func initDeployCommand() *cobra.Command {
  function deployBuildBackend (line 137) | func deployBuildBackend(c *cobra.Command, deployFolder string) error {
  function deployUploadAction (line 201) | func deployUploadAction(deployFolder string, container framework.Contain...
  function uploadFolderToSFTP (line 299) | func uploadFolderToSFTP(container framework.Container, localFolder, remo...
  function deployBuildFrontend (line 375) | func deployBuildFrontend(c *cobra.Command, deployFolder string) error {
  function createDeployFolder (line 398) | func createDeployFolder(c framework.Container) (string, error) {

FILE: framework/command/dev.go
  type devConfig (line 24) | type devConfig struct
  function initDevConfig (line 37) | func initDevConfig(c framework.Container) *devConfig {
  type Proxy (line 84) | type Proxy struct
    method newProxyReverseProxy (line 99) | func (p *Proxy) newProxyReverseProxy(frontend, backend *url.URL) *http...
    method rebuildBackend (line 147) | func (p *Proxy) rebuildBackend() error {
    method restartBackend (line 162) | func (p *Proxy) restartBackend() error {
    method restartFrontend (line 188) | func (p *Proxy) restartFrontend() error {
    method startProxy (line 221) | func (p *Proxy) startProxy(startFrontend, startBackend bool) error {
    method monitorBackend (line 263) | func (p *Proxy) monitorBackend() error {
  function NewProxy (line 91) | func NewProxy(c framework.Container) *Proxy {
  function initDevCommand (line 325) | func initDevCommand() *cobra.Command {

FILE: framework/command/env.go
  function initEnvCommand (line 12) | func initEnvCommand() *cobra.Command {

FILE: framework/command/kernel.go
  function AddKernelCommands (line 8) | func AddKernelCommands(root *cobra.Command) {

FILE: framework/command/middleware.go
  function initMiddlewareCommand (line 23) | func initMiddlewareCommand() *cobra.Command {

FILE: framework/command/new.go
  function initNewCommand (line 22) | func initNewCommand() *cobra.Command {

FILE: framework/command/provider.go
  function initProviderCommand (line 21) | func initProviderCommand() *cobra.Command {

FILE: framework/command/swagger.go
  function initSwaggerCommand (line 11) | func initSwaggerCommand() *cobra.Command {

FILE: framework/container.go
  type Container (line 11) | type Container interface
  type HadeContainer (line 29) | type HadeContainer struct
    method PrintProviders (line 49) | func (hade *HadeContainer) PrintProviders() []string {
    method Bind (line 61) | func (hade *HadeContainer) Bind(provider ServiceProvider) error {
    method IsBind (line 86) | func (hade *HadeContainer) IsBind(key string) bool {
    method findServiceProvider (line 90) | func (hade *HadeContainer) findServiceProvider(key string) ServiceProv...
    method Make (line 99) | func (hade *HadeContainer) Make(key string) (interface{}, error) {
    method MustMake (line 103) | func (hade *HadeContainer) MustMake(key string) interface{} {
    method MakeNew (line 111) | func (hade *HadeContainer) MakeNew(key string, params []interface{}) (...
    method newInstance (line 115) | func (hade *HadeContainer) newInstance(sp ServiceProvider, params []in...
    method make (line 132) | func (hade *HadeContainer) make(key string, params []interface{}, forc...
    method NameList (line 161) | func (hade *HadeContainer) NameList() []string {
  function NewHadeContainer (line 40) | func NewHadeContainer() *HadeContainer {

FILE: framework/contract/app.go
  constant AppKey (line 4) | AppKey = "hade:app"
  type App (line 7) | type App interface

FILE: framework/contract/cache.go
  constant CacheKey (line 9) | CacheKey = "hade:cache"
  type RememberFunc (line 12) | type RememberFunc
  type CacheService (line 15) | type CacheService interface

FILE: framework/contract/config.go
  constant ConfigKey (line 7) | ConfigKey = "hade:config"
  type Config (line 13) | type Config interface

FILE: framework/contract/distributed.go
  constant DistributedKey (line 6) | DistributedKey = "hade:distributed"
  type Distributed (line 9) | type Distributed interface

FILE: framework/contract/env.go
  constant EnvProduction (line 5) | EnvProduction = "production"
  constant EnvTesting (line 7) | EnvTesting = "testing"
  constant EnvDevelopment (line 9) | EnvDevelopment = "development"
  constant EnvKey (line 12) | EnvKey = "hade:env"
  type Env (line 16) | type Env interface

FILE: framework/contract/id.go
  constant IDKey (line 3) | IDKey = "hade:id"
  type IDService (line 5) | type IDService interface

FILE: framework/contract/kernel.go
  constant KernelKey (line 7) | KernelKey = "hade:kernel"
  type Kernel (line 10) | type Kernel interface

FILE: framework/contract/log.go
  constant LogKey (line 9) | LogKey = "hade:log"
  type LogLevel (line 11) | type LogLevel
  constant UnknownLevel (line 15) | UnknownLevel LogLevel = iota
  constant PanicLevel (line 17) | PanicLevel
  constant FatalLevel (line 19) | FatalLevel
  constant ErrorLevel (line 21) | ErrorLevel
  constant WarnLevel (line 23) | WarnLevel
  constant InfoLevel (line 25) | InfoLevel
  constant DebugLevel (line 27) | DebugLevel
  constant TraceLevel (line 29) | TraceLevel
  type CtxFielder (line 33) | type CtxFielder
  type Formatter (line 36) | type Formatter
  type Log (line 39) | type Log interface

FILE: framework/contract/orm.go
  constant ORMKey (line 13) | ORMKey = "hade:orm"
  type ORMService (line 16) | type ORMService interface
  type DBOption (line 21) | type DBOption
  type DBConfig (line 24) | type DBConfig struct
    method FormatDsn (line 53) | func (conf *DBConfig) FormatDsn() (string, error) {

FILE: framework/contract/redis.go
  constant RedisKey (line 9) | RedisKey = "hade:redis"
  type RedisOption (line 12) | type RedisOption
  type RedisService (line 15) | type RedisService interface
  type RedisConfig (line 21) | type RedisConfig struct
    method UniqKey (line 26) | func (config *RedisConfig) UniqKey() string {

FILE: framework/contract/ssh.go
  constant SSHKey (line 9) | SSHKey = "hade:ssh"
  type SSHOption (line 12) | type SSHOption
  type SSHService (line 15) | type SSHService interface
  type SSHConfig (line 21) | type SSHConfig struct
    method UniqKey (line 29) | func (config *SSHConfig) UniqKey() string {

FILE: framework/contract/trace.go
  constant TraceKey (line 8) | TraceKey = "hade:trace"
  constant TraceKeyTraceID (line 11) | TraceKeyTraceID  = "trace_id"
  constant TraceKeySpanID (line 12) | TraceKeySpanID   = "span_id"
  constant TraceKeyCspanID (line 13) | TraceKeyCspanID  = "cspan_id"
  constant TraceKeyParentID (line 14) | TraceKeyParentID = "parent_id"
  constant TraceKeyMethod (line 15) | TraceKeyMethod   = "method"
  constant TraceKeyCaller (line 16) | TraceKeyCaller   = "caller"
  constant TraceKeyTime (line 17) | TraceKeyTime     = "time"
  type TraceContext (line 21) | type TraceContext struct
  type Trace (line 30) | type Trace interface

FILE: framework/gin/auth.go
  constant AuthUserKey (line 17) | AuthUserKey = "user"
  type Accounts (line 20) | type Accounts
  type authPair (line 22) | type authPair struct
  type authPairs (line 27) | type authPairs
    method searchCredential (line 29) | func (a authPairs) searchCredential(authValue string) (string, bool) {
  function BasicAuthForRealm (line 45) | func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc {
  function BasicAuth (line 69) | func BasicAuth(accounts Accounts) HandlerFunc {
  function processAccounts (line 73) | func processAccounts(accounts Accounts) authPairs {
  function authorizationHeader (line 88) | func authorizationHeader(user, password string) string {

FILE: framework/gin/auth_test.go
  function TestBasicAuth (line 16) | func TestBasicAuth(t *testing.T) {
  function TestBasicAuthFails (line 38) | func TestBasicAuthFails(t *testing.T) {
  function TestBasicAuthSearchCredential (line 48) | func TestBasicAuthSearchCredential(t *testing.T) {
  function TestBasicAuthAuthorizationHeader (line 80) | func TestBasicAuthAuthorizationHeader(t *testing.T) {
  function TestBasicAuthSucceed (line 84) | func TestBasicAuthSucceed(t *testing.T) {
  function TestBasicAuth401 (line 101) | func TestBasicAuth401(t *testing.T) {
  function TestBasicAuth401WithCustomRealm (line 121) | func TestBasicAuth401WithCustomRealm(t *testing.T) {

FILE: framework/gin/benchmarks_test.go
  function BenchmarkOneRoute (line 14) | func BenchmarkOneRoute(B *testing.B) {
  function BenchmarkRecoveryMiddleware (line 20) | func BenchmarkRecoveryMiddleware(B *testing.B) {
  function BenchmarkLoggerMiddleware (line 27) | func BenchmarkLoggerMiddleware(B *testing.B) {
  function BenchmarkManyHandlers (line 34) | func BenchmarkManyHandlers(B *testing.B) {
  function Benchmark5Params (line 43) | func Benchmark5Params(B *testing.B) {
  function BenchmarkOneRouteJSON (line 51) | func BenchmarkOneRouteJSON(B *testing.B) {
  function BenchmarkOneRouteHTML (line 62) | func BenchmarkOneRouteHTML(B *testing.B) {
  function BenchmarkOneRouteSet (line 74) | func BenchmarkOneRouteSet(B *testing.B) {
  function BenchmarkOneRouteString (line 82) | func BenchmarkOneRouteString(B *testing.B) {
  function BenchmarkManyRoutesFist (line 90) | func BenchmarkManyRoutesFist(B *testing.B) {
  function BenchmarkManyRoutesLast (line 96) | func BenchmarkManyRoutesLast(B *testing.B) {
  function Benchmark404 (line 102) | func Benchmark404(B *testing.B) {
  function Benchmark404Many (line 109) | func Benchmark404Many(B *testing.B) {
  type mockWriter (line 124) | type mockWriter struct
    method Header (line 134) | func (m *mockWriter) Header() (h http.Header) {
    method Write (line 138) | func (m *mockWriter) Write(p []byte) (n int, err error) {
    method WriteString (line 142) | func (m *mockWriter) WriteString(s string) (n int, err error) {
    method WriteHeader (line 146) | func (m *mockWriter) WriteHeader(int) {}
  function newMockWriter (line 128) | func newMockWriter() *mockWriter {
  function runRequest (line 148) | func runRequest(B *testing.B, r *Engine, method, path string) {

FILE: framework/gin/binding/binding.go
  constant MIMEJSON (line 14) | MIMEJSON              = "application/json"
  constant MIMEHTML (line 15) | MIMEHTML              = "text/html"
  constant MIMEXML (line 16) | MIMEXML               = "application/xml"
  constant MIMEXML2 (line 17) | MIMEXML2              = "text/xml"
  constant MIMEPlain (line 18) | MIMEPlain             = "text/plain"
  constant MIMEPOSTForm (line 19) | MIMEPOSTForm          = "application/x-www-form-urlencoded"
  constant MIMEMultipartPOSTForm (line 20) | MIMEMultipartPOSTForm = "multipart/form-data"
  constant MIMEPROTOBUF (line 21) | MIMEPROTOBUF          = "application/x-protobuf"
  constant MIMEMSGPACK (line 22) | MIMEMSGPACK           = "application/x-msgpack"
  constant MIMEMSGPACK2 (line 23) | MIMEMSGPACK2          = "application/msgpack"
  constant MIMEYAML (line 24) | MIMEYAML              = "application/x-yaml"
  type Binding (line 30) | type Binding interface
  type BindingBody (line 37) | type BindingBody interface
  type BindingUri (line 44) | type BindingUri interface
  type StructValidator (line 53) | type StructValidator interface
  function Default (line 90) | func Default(method, contentType string) Binding {
  function validate (line 113) | func validate(obj interface{}) error {

FILE: framework/gin/binding/binding_msgpack_test.go
  function TestBindingMsgPack (line 18) | func TestBindingMsgPack(t *testing.T) {
  function testMsgPackBodyBinding (line 38) | func testMsgPackBodyBinding(t *testing.T, b Binding, name, path, badPath...
  function TestBindingDefaultMsgPack (line 55) | func TestBindingDefaultMsgPack(t *testing.T) {

FILE: framework/gin/binding/binding_nomsgpack.go
  constant MIMEJSON (line 14) | MIMEJSON              = "application/json"
  constant MIMEHTML (line 15) | MIMEHTML              = "text/html"
  constant MIMEXML (line 16) | MIMEXML               = "application/xml"
  constant MIMEXML2 (line 17) | MIMEXML2              = "text/xml"
  constant MIMEPlain (line 18) | MIMEPlain             = "text/plain"
  constant MIMEPOSTForm (line 19) | MIMEPOSTForm          = "application/x-www-form-urlencoded"
  constant MIMEMultipartPOSTForm (line 20) | MIMEMultipartPOSTForm = "multipart/form-data"
  constant MIMEPROTOBUF (line 21) | MIMEPROTOBUF          = "application/x-protobuf"
  constant MIMEYAML (line 22) | MIMEYAML              = "application/x-yaml"
  type Binding (line 28) | type Binding interface
  type BindingBody (line 35) | type BindingBody interface
  type BindingUri (line 42) | type BindingUri interface
  type StructValidator (line 51) | type StructValidator interface
  function Default (line 86) | func Default(method, contentType string) Binding {
  function validate (line 107) | func validate(obj interface{}) error {

FILE: framework/gin/binding/binding_test.go
  type appkey (line 27) | type appkey struct
  type QueryTest (line 31) | type QueryTest struct
  type FooStruct (line 37) | type FooStruct struct
  type FooBarStruct (line 41) | type FooBarStruct struct
  type FooBarFileStruct (line 46) | type FooBarFileStruct struct
  type FooBarFileFailStruct (line 51) | type FooBarFileFailStruct struct
  type FooDefaultBarStruct (line 58) | type FooDefaultBarStruct struct
  type FooStructUseNumber (line 63) | type FooStructUseNumber struct
  type FooStructDisallowUnknownFields (line 67) | type FooStructDisallowUnknownFields struct
  type FooBarStructForTimeType (line 71) | type FooBarStructForTimeType struct
  type FooStructForTimeTypeNotUnixFormat (line 78) | type FooStructForTimeTypeNotUnixFormat struct
  type FooStructForTimeTypeNotFormat (line 83) | type FooStructForTimeTypeNotFormat struct
  type FooStructForTimeTypeFailFormat (line 87) | type FooStructForTimeTypeFailFormat struct
  type FooStructForTimeTypeFailLocation (line 91) | type FooStructForTimeTypeFailLocation struct
  type FooStructForMapType (line 95) | type FooStructForMapType struct
  type FooStructForIgnoreFormTag (line 99) | type FooStructForIgnoreFormTag struct
  type InvalidNameType (line 103) | type InvalidNameType struct
  type InvalidNameMapType (line 107) | type InvalidNameMapType struct
  type FooStructForSliceType (line 113) | type FooStructForSliceType struct
  type FooStructForStructType (line 117) | type FooStructForStructType struct
  type FooStructForStructPointerType (line 123) | type FooStructForStructPointerType struct
  type FooStructForSliceMapType (line 129) | type FooStructForSliceMapType struct
  type FooStructForBoolType (line 134) | type FooStructForBoolType struct
  type FooStructForStringPtrType (line 138) | type FooStructForStringPtrType struct
  type FooStructForMapPtrType (line 143) | type FooStructForMapPtrType struct
  function TestBindingDefault (line 147) | func TestBindingDefault(t *testing.T) {
  function TestBindingJSONNilBody (line 170) | func TestBindingJSONNilBody(t *testing.T) {
  function TestBindingJSON (line 177) | func TestBindingJSON(t *testing.T) {
  function TestBindingJSONSlice (line 184) | func TestBindingJSONSlice(t *testing.T) {
  function TestBindingJSONUseNumber (line 198) | func TestBindingJSONUseNumber(t *testing.T) {
  function TestBindingJSONUseNumber2 (line 205) | func TestBindingJSONUseNumber2(t *testing.T) {
  function TestBindingJSONDisallowUnknownFields (line 212) | func TestBindingJSONDisallowUnknownFields(t *testing.T) {
  function TestBindingJSONStringMap (line 218) | func TestBindingJSONStringMap(t *testing.T) {
  function TestBindingForm (line 224) | func TestBindingForm(t *testing.T) {
  function TestBindingForm2 (line 230) | func TestBindingForm2(t *testing.T) {
  function TestBindingFormEmbeddedStruct (line 236) | func TestBindingFormEmbeddedStruct(t *testing.T) {
  function TestBindingFormEmbeddedStruct2 (line 242) | func TestBindingFormEmbeddedStruct2(t *testing.T) {
  function TestBindingFormDefaultValue (line 248) | func TestBindingFormDefaultValue(t *testing.T) {
  function TestBindingFormDefaultValue2 (line 254) | func TestBindingFormDefaultValue2(t *testing.T) {
  function TestBindingFormForTime (line 260) | func TestBindingFormForTime(t *testing.T) {
  function TestBindingFormForTime2 (line 278) | func TestBindingFormForTime2(t *testing.T) {
  function TestFormBindingIgnoreField (line 296) | func TestFormBindingIgnoreField(t *testing.T) {
  function TestBindingFormInvalidName (line 302) | func TestBindingFormInvalidName(t *testing.T) {
  function TestBindingFormInvalidName2 (line 308) | func TestBindingFormInvalidName2(t *testing.T) {
  function TestBindingFormForType (line 314) | func TestBindingFormForType(t *testing.T) {
  function TestBindingFormStringMap (line 360) | func TestBindingFormStringMap(t *testing.T) {
  function TestBindingFormStringSliceMap (line 370) | func TestBindingFormStringSliceMap(t *testing.T) {
  function TestBindingQuery (line 391) | func TestBindingQuery(t *testing.T) {
  function TestBindingQuery2 (line 397) | func TestBindingQuery2(t *testing.T) {
  function TestBindingQueryFail (line 403) | func TestBindingQueryFail(t *testing.T) {
  function TestBindingQueryFail2 (line 409) | func TestBindingQueryFail2(t *testing.T) {
  function TestBindingQueryBoolFail (line 415) | func TestBindingQueryBoolFail(t *testing.T) {
  function TestBindingQueryStringMap (line 421) | func TestBindingQueryStringMap(t *testing.T) {
  function TestBindingXML (line 443) | func TestBindingXML(t *testing.T) {
  function TestBindingXMLFail (line 450) | func TestBindingXMLFail(t *testing.T) {
  function TestBindingYAML (line 457) | func TestBindingYAML(t *testing.T) {
  function TestBindingYAMLStringMap (line 464) | func TestBindingYAMLStringMap(t *testing.T) {
  function TestBindingYAMLFail (line 471) | func TestBindingYAMLFail(t *testing.T) {
  function createFormPostRequest (line 478) | func createFormPostRequest(t *testing.T) *http.Request {
  function createDefaultFormPostRequest (line 485) | func createDefaultFormPostRequest(t *testing.T) *http.Request {
  function createFormPostRequestForMap (line 492) | func createFormPostRequestForMap(t *testing.T) *http.Request {
  function createFormPostRequestForMapFail (line 499) | func createFormPostRequestForMapFail(t *testing.T) *http.Request {
  function createFormFilesMultipartRequest (line 506) | func createFormFilesMultipartRequest(t *testing.T) *http.Request {
  function createFormFilesMultipartRequestFail (line 531) | func createFormFilesMultipartRequestFail(t *testing.T) *http.Request {
  function createFormMultipartRequest (line 556) | func createFormMultipartRequest(t *testing.T) *http.Request {
  function createFormMultipartRequestForMap (line 571) | func createFormMultipartRequestForMap(t *testing.T) *http.Request {
  function createFormMultipartRequestForMapFail (line 585) | func createFormMultipartRequestForMapFail(t *testing.T) *http.Request {
  function TestBindingFormPost (line 599) | func TestBindingFormPost(t *testing.T) {
  function TestBindingDefaultValueFormPost (line 609) | func TestBindingDefaultValueFormPost(t *testing.T) {
  function TestBindingFormPostForMap (line 618) | func TestBindingFormPostForMap(t *testing.T) {
  function TestBindingFormPostForMapFail (line 626) | func TestBindingFormPostForMapFail(t *testing.T) {
  function TestBindingFormFilesMultipart (line 633) | func TestBindingFormFilesMultipart(t *testing.T) {
  function TestBindingFormFilesMultipartFail (line 655) | func TestBindingFormFilesMultipartFail(t *testing.T) {
  function TestBindingFormMultipart (line 662) | func TestBindingFormMultipart(t *testing.T) {
  function TestBindingFormMultipartForMap (line 672) | func TestBindingFormMultipartForMap(t *testing.T) {
  function TestBindingFormMultipartForMapFail (line 682) | func TestBindingFormMultipartForMapFail(t *testing.T) {
  function TestBindingProtoBuf (line 689) | func TestBindingProtoBuf(t *testing.T) {
  function TestBindingProtoBufFail (line 701) | func TestBindingProtoBufFail(t *testing.T) {
  function TestValidationFails (line 713) | func TestValidationFails(t *testing.T) {
  function TestValidationDisabled (line 720) | func TestValidationDisabled(t *testing.T) {
  function TestRequiredSucceeds (line 731) | func TestRequiredSucceeds(t *testing.T) {
  function TestRequiredFails (line 742) | func TestRequiredFails(t *testing.T) {
  function TestHeaderBinding (line 753) | func TestHeaderBinding(t *testing.T) {
  function TestUriBinding (line 778) | func TestUriBinding(t *testing.T) {
  function TestUriInnerBinding (line 799) | func TestUriInnerBinding(t *testing.T) {
  function testFormBindingEmbeddedStruct (line 821) | func testFormBindingEmbeddedStruct(t *testing.T, method, path, badPath, ...
  function testFormBinding (line 838) | func testFormBinding(t *testing.T, method, path, badPath, body, badBody ...
  function testFormBindingDefaultValue (line 858) | func testFormBindingDefaultValue(t *testing.T, method, path, badPath, bo...
  function TestFormBindingFail (line 878) | func TestFormBindingFail(t *testing.T) {
  function TestFormBindingMultipartFail (line 888) | func TestFormBindingMultipartFail(t *testing.T) {
  function TestFormPostBindingFail (line 899) | func TestFormPostBindingFail(t *testing.T) {
  function TestFormMultipartBindingFail (line 909) | func TestFormMultipartBindingFail(t *testing.T) {
  function testFormBindingForTime (line 919) | func testFormBindingForTime(t *testing.T, method, path, badPath, body, b...
  function testFormBindingForTimeNotUnixFormat (line 944) | func testFormBindingForTimeNotUnixFormat(t *testing.T, method, path, bad...
  function testFormBindingForTimeNotFormat (line 962) | func testFormBindingForTimeNotFormat(t *testing.T, method, path, badPath...
  function testFormBindingForTimeFailFormat (line 980) | func testFormBindingForTimeFailFormat(t *testing.T, method, path, badPat...
  function testFormBindingForTimeFailLocation (line 998) | func testFormBindingForTimeFailLocation(t *testing.T, method, path, badP...
  function testFormBindingIgnoreField (line 1016) | func testFormBindingIgnoreField(t *testing.T, method, path, badPath, bod...
  function testFormBindingInvalidName (line 1031) | func testFormBindingInvalidName(t *testing.T, method, path, badPath, bod...
  function testFormBindingInvalidName2 (line 1050) | func testFormBindingInvalidName2(t *testing.T, method, path, badPath, bo...
  function testFormBindingForType (line 1068) | func testFormBindingForType(t *testing.T, method, path, badPath, body, b...
  function testQueryBinding (line 1142) | func testQueryBinding(t *testing.T, method, path, badPath, body, badBody...
  function testQueryBindingFail (line 1157) | func testQueryBindingFail(t *testing.T, method, path, badPath, body, bad...
  function testQueryBindingBoolFail (line 1170) | func testQueryBindingBoolFail(t *testing.T, method, path, badPath, body,...
  function testBodyBinding (line 1183) | func testBodyBinding(t *testing.T, b Binding, name, path, badPath, body,...
  function testBodyBindingSlice (line 1198) | func testBodyBindingSlice(t *testing.T, b Binding, name, path, badPath, ...
  function testBodyBindingStringMap (line 1212) | func testBodyBindingStringMap(t *testing.T, b Binding, path, badPath, bo...
  function testBodyBindingUseNumber (line 1238) | func testBodyBindingUseNumber(t *testing.T, b Binding, name, path, badPa...
  function testBodyBindingUseNumber2 (line 1257) | func testBodyBindingUseNumber2(t *testing.T, b Binding, name, path, badP...
  function testBodyBindingDisallowUnknownFields (line 1275) | func testBodyBindingDisallowUnknownFields(t *testing.T, b Binding, path,...
  function testBodyBindingFail (line 1294) | func testBodyBindingFail(t *testing.T, b Binding, name, path, badPath, b...
  function testProtoBodyBinding (line 1309) | func testProtoBodyBinding(t *testing.T, b Binding, name, path, badPath, ...
  type hook (line 1326) | type hook struct
    method Read (line 1328) | func (h hook) Read([]byte) (int, error) {
  function testProtoBodyBindingFail (line 1332) | func testProtoBodyBindingFail(t *testing.T, b Binding, name, path, badPa...
  function requestWithBody (line 1350) | func requestWithBody(method, path, body string) (req *http.Request) {

FILE: framework/gin/binding/default_validator.go
  type defaultValidator (line 16) | type defaultValidator struct
    method ValidateStruct (line 37) | func (v *defaultValidator) ValidateStruct(obj interface{}) error {
    method validateStruct (line 66) | func (v *defaultValidator) validateStruct(obj interface{}) error {
    method Engine (line 75) | func (v *defaultValidator) Engine() interface{} {
    method lazyinit (line 80) | func (v *defaultValidator) lazyinit() {
  type sliceValidateError (line 21) | type sliceValidateError
    method Error (line 23) | func (err sliceValidateError) Error() string {

FILE: framework/gin/binding/default_validator_test.go
  function TestSliceValidateError (line 12) | func TestSliceValidateError(t *testing.T) {
  function TestDefaultValidator (line 29) | func TestDefaultValidator(t *testing.T) {

FILE: framework/gin/binding/form.go
  constant defaultMemory (line 11) | defaultMemory = 32 << 20
  type formBinding (line 13) | type formBinding struct
    method Name (line 17) | func (formBinding) Name() string {
    method Bind (line 21) | func (formBinding) Bind(req *http.Request, obj interface{}) error {
  type formPostBinding (line 14) | type formPostBinding struct
    method Name (line 36) | func (formPostBinding) Name() string {
    method Bind (line 40) | func (formPostBinding) Bind(req *http.Request, obj interface{}) error {
  type formMultipartBinding (line 15) | type formMultipartBinding struct
    method Name (line 50) | func (formMultipartBinding) Name() string {
    method Bind (line 54) | func (formMultipartBinding) Bind(req *http.Request, obj interface{}) e...

FILE: framework/gin/binding/form_mapping.go
  function mapUri (line 21) | func mapUri(ptr interface{}, m map[string][]string) error {
  function mapForm (line 25) | func mapForm(ptr interface{}, form map[string][]string) error {
  function mapFormByTag (line 31) | func mapFormByTag(ptr interface{}, form map[string][]string, tag string)...
  type setter (line 51) | type setter interface
  type formSource (line 55) | type formSource
    method TrySet (line 60) | func (form formSource) TrySet(value reflect.Value, field reflect.Struc...
  function mappingByPtr (line 64) | func mappingByPtr(ptr interface{}, setter setter, tag string) error {
  function mapping (line 69) | func mapping(value reflect.Value, field reflect.StructField, setter sett...
  type setOptions (line 123) | type setOptions struct
  function tryToSetValue (line 128) | func tryToSetValue(value reflect.Value, field reflect.StructField, sette...
  function setByForm (line 155) | func setByForm(value reflect.Value, field reflect.StructField, form map[...
  function setWithProperType (line 188) | func setWithProperType(val string, value reflect.Value, field reflect.St...
  function setIntField (line 236) | func setIntField(val string, bitSize int, field reflect.Value) error {
  function setUintField (line 247) | func setUintField(val string, bitSize int, field reflect.Value) error {
  function setBoolField (line 258) | func setBoolField(val string, field reflect.Value) error {
  function setFloatField (line 269) | func setFloatField(val string, bitSize int, field reflect.Value) error {
  function setTimeField (line 280) | func setTimeField(val string, structField reflect.StructField, value ref...
  function setArray (line 331) | func setArray(vals []string, value reflect.Value, field reflect.StructFi...
  function setSlice (line 341) | func setSlice(vals []string, value reflect.Value, field reflect.StructFi...
  function setTimeDuration (line 351) | func setTimeDuration(val string, value reflect.Value, field reflect.Stru...
  function head (line 360) | func head(str, sep string) (head string, tail string) {
  function setFormMap (line 368) | func setFormMap(ptr interface{}, form map[string][]string) error {

FILE: framework/gin/binding/form_mapping_benchmark_test.go
  type structFull (line 21) | type structFull struct
  function BenchmarkMapFormFull (line 32) | func BenchmarkMapFormFull(b *testing.B) {
  type structName (line 51) | type structName struct
  function BenchmarkMapFormName (line 55) | func BenchmarkMapFormName(b *testing.B) {

FILE: framework/gin/binding/form_mapping_test.go
  function TestMappingBaseTypes (line 15) | func TestMappingBaseTypes(t *testing.T) {
  function TestMappingDefault (line 63) | func TestMappingDefault(t *testing.T) {
  function TestMappingSkipField (line 77) | func TestMappingSkipField(t *testing.T) {
  function TestMappingIgnoreField (line 87) | func TestMappingIgnoreField(t *testing.T) {
  function TestMappingUnexportedField (line 99) | func TestMappingUnexportedField(t *testing.T) {
  function TestMappingPrivateField (line 111) | func TestMappingPrivateField(t *testing.T) {
  function TestMappingUnknownFieldType (line 120) | func TestMappingUnknownFieldType(t *testing.T) {
  function TestMappingURI (line 130) | func TestMappingURI(t *testing.T) {
  function TestMappingForm (line 139) | func TestMappingForm(t *testing.T) {
  function TestMappingTime (line 148) | func TestMappingTime(t *testing.T) {
  function TestMappingTimeDuration (line 193) | func TestMappingTimeDuration(t *testing.T) {
  function TestMappingSlice (line 208) | func TestMappingSlice(t *testing.T) {
  function TestMappingArray (line 228) | func TestMappingArray(t *testing.T) {
  function TestMappingStructField (line 251) | func TestMappingStructField(t *testing.T) {
  function TestMappingMapField (line 263) | func TestMappingMapField(t *testing.T) {
  function TestMappingIgnoredCircularRef (line 273) | func TestMappingIgnoredCircularRef(t *testing.T) {

FILE: framework/gin/binding/header.go
  type headerBinding (line 9) | type headerBinding struct
    method Name (line 11) | func (headerBinding) Name() string {
    method Bind (line 15) | func (headerBinding) Bind(req *http.Request, obj interface{}) error {
  function mapHeader (line 24) | func mapHeader(ptr interface{}, h map[string][]string) error {
  type headerSource (line 28) | type headerSource
    method TrySet (line 32) | func (hs headerSource) TrySet(value reflect.Value, field reflect.Struc...

FILE: framework/gin/binding/json.go
  type jsonBinding (line 27) | type jsonBinding struct
    method Name (line 29) | func (jsonBinding) Name() string {
    method Bind (line 33) | func (jsonBinding) Bind(req *http.Request, obj interface{}) error {
    method BindBody (line 40) | func (jsonBinding) BindBody(body []byte, obj interface{}) error {
  function decodeJSON (line 44) | func decodeJSON(r io.Reader, obj interface{}) error {

FILE: framework/gin/binding/json_test.go
  function TestJSONBindingBindBody (line 14) | func TestJSONBindingBindBody(t *testing.T) {
  function TestJSONBindingBindBodyMap (line 23) | func TestJSONBindingBindBodyMap(t *testing.T) {

FILE: framework/gin/binding/msgpack.go
  type msgpackBinding (line 18) | type msgpackBinding struct
    method Name (line 20) | func (msgpackBinding) Name() string {
    method Bind (line 24) | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error {
    method BindBody (line 28) | func (msgpackBinding) BindBody(body []byte, obj interface{}) error {
  function decodeMsgPack (line 32) | func decodeMsgPack(r io.Reader, obj interface{}) error {

FILE: framework/gin/binding/msgpack_test.go
  function TestMsgpackBindingBindBody (line 19) | func TestMsgpackBindingBindBody(t *testing.T) {
  function msgpackBody (line 29) | func msgpackBody(t *testing.T, obj interface{}) []byte {

FILE: framework/gin/binding/multipart_form_mapping.go
  type multipartRequest (line 14) | type multipartRequest
    method TrySet (line 19) | func (r *multipartRequest) TrySet(value reflect.Value, field reflect.S...
  function setByMultipartFormFile (line 27) | func setByMultipartFormFile(value reflect.Value, field reflect.StructFie...
  function setArrayOfMultipartFormFiles (line 55) | func setArrayOfMultipartFormFiles(value reflect.Value, field reflect.Str...

FILE: framework/gin/binding/multipart_form_mapping_test.go
  function TestFormMultipartBindingBindOneFile (line 17) | func TestFormMultipartBindingBindOneFile(t *testing.T) {
  function TestFormMultipartBindingBindTwoFiles (line 42) | func TestFormMultipartBindingBindTwoFiles(t *testing.T) {
  function TestFormMultipartBindingBindError (line 71) | func TestFormMultipartBindingBindError(t *testing.T) {
  type testFile (line 97) | type testFile struct
  function createRequestMultipartFiles (line 103) | func createRequestMultipartFiles(t *testing.T, files ...testFile) *http....
  function assertMultipartFileHeader (line 125) | func assertMultipartFileHeader(t *testing.T, fh *multipart.FileHeader, f...

FILE: framework/gin/binding/protobuf.go
  type protobufBinding (line 14) | type protobufBinding struct
    method Name (line 16) | func (protobufBinding) Name() string {
    method Bind (line 20) | func (b protobufBinding) Bind(req *http.Request, obj interface{}) error {
    method BindBody (line 28) | func (protobufBinding) BindBody(body []byte, obj interface{}) error {

FILE: framework/gin/binding/query.go
  type queryBinding (line 9) | type queryBinding struct
    method Name (line 11) | func (queryBinding) Name() string {
    method Bind (line 15) | func (queryBinding) Bind(req *http.Request, obj interface{}) error {

FILE: framework/gin/binding/uri.go
  type uriBinding (line 7) | type uriBinding struct
    method Name (line 9) | func (uriBinding) Name() string {
    method BindUri (line 13) | func (uriBinding) BindUri(m map[string][]string, obj interface{}) error {

FILE: framework/gin/binding/validate_test.go
  type testInterface (line 16) | type testInterface interface
  type substructNoValidation (line 20) | type substructNoValidation struct
  type mapNoValidationSub (line 25) | type mapNoValidationSub
  type structNoValidationValues (line 27) | type structNoValidationValues struct
  function createNoValidationValues (line 69) | func createNoValidationValues() structNoValidationValues {
  function TestValidateNoValidationValues (line 111) | func TestValidateNoValidationValues(t *testing.T) {
  type structNoValidationPointer (line 124) | type structNoValidationPointer struct
  function TestValidateNoValidationPointers (line 159) | func TestValidateNoValidationPointers(t *testing.T) {
  type Object (line 172) | type Object
  function TestValidatePrimitives (line 174) | func TestValidatePrimitives(t *testing.T) {
  type structCustomValidation (line 198) | type structCustomValidation struct
  function notOne (line 202) | func notOne(f1 validator.FieldLevel) bool {
  function TestValidatorEngine (line 209) | func TestValidatorEngine(t *testing.T) {

FILE: framework/gin/binding/xml.go
  type xmlBinding (line 14) | type xmlBinding struct
    method Name (line 16) | func (xmlBinding) Name() string {
    method Bind (line 20) | func (xmlBinding) Bind(req *http.Request, obj interface{}) error {
    method BindBody (line 24) | func (xmlBinding) BindBody(body []byte, obj interface{}) error {
  function decodeXML (line 27) | func decodeXML(r io.Reader, obj interface{}) error {

FILE: framework/gin/binding/xml_test.go
  function TestXMLBindingBindBody (line 14) | func TestXMLBindingBindBody(t *testing.T) {

FILE: framework/gin/binding/yaml.go
  type yamlBinding (line 15) | type yamlBinding struct
    method Name (line 17) | func (yamlBinding) Name() string {
    method Bind (line 21) | func (yamlBinding) Bind(req *http.Request, obj interface{}) error {
    method BindBody (line 25) | func (yamlBinding) BindBody(body []byte, obj interface{}) error {
  function decodeYAML (line 29) | func decodeYAML(r io.Reader, obj interface{}) error {

FILE: framework/gin/binding/yaml_test.go
  function TestYAMLBindingBindBody (line 14) | func TestYAMLBindingBindBody(t *testing.T) {

FILE: framework/gin/context.go
  constant MIMEJSON (line 31) | MIMEJSON              = binding.MIMEJSON
  constant MIMEHTML (line 32) | MIMEHTML              = binding.MIMEHTML
  constant MIMEXML (line 33) | MIMEXML               = binding.MIMEXML
  constant MIMEXML2 (line 34) | MIMEXML2              = binding.MIMEXML2
  constant MIMEPlain (line 35) | MIMEPlain             = binding.MIMEPlain
  constant MIMEPOSTForm (line 36) | MIMEPOSTForm          = binding.MIMEPOSTForm
  constant MIMEMultipartPOSTForm (line 37) | MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm
  constant MIMEYAML (line 38) | MIMEYAML              = binding.MIMEYAML
  constant BodyBytesKey (line 42) | BodyBytesKey = "_gin-gonic/gin/bodybyteskey"
  constant abortIndex (line 44) | abortIndex int8 = math.MaxInt8 / 2
  type Context (line 48) | type Context struct
    method reset (line 92) | func (c *Context) reset() {
    method Copy (line 109) | func (c *Context) Copy() *Context {
    method HandlerName (line 132) | func (c *Context) HandlerName() string {
    method HandlerNames (line 138) | func (c *Context) HandlerNames() []string {
    method Handler (line 147) | func (c *Context) Handler() HandlerFunc {
    method FullPath (line 156) | func (c *Context) FullPath() string {
    method Next (line 167) | func (c *Context) Next() {
    method IsAborted (line 176) | func (c *Context) IsAborted() bool {
    method Abort (line 184) | func (c *Context) Abort() {
    method AbortWithStatus (line 190) | func (c *Context) AbortWithStatus(code int) {
    method AbortWithStatusJSON (line 199) | func (c *Context) AbortWithStatusJSON(code int, jsonObj interface{}) {
    method AbortWithError (line 207) | func (c *Context) AbortWithError(code int, err error) *Error {
    method Error (line 221) | func (c *Context) Error(err error) *Error {
    method Set (line 244) | func (c *Context) Set(key string, value interface{}) {
    method Get (line 256) | func (c *Context) Get(key string) (value interface{}, exists bool) {
    method MustGet (line 264) | func (c *Context) MustGet(key string) interface{} {
    method GetString (line 272) | func (c *Context) GetString(key string) (s string) {
    method GetBool (line 280) | func (c *Context) GetBool(key string) (b bool) {
    method GetInt (line 288) | func (c *Context) GetInt(key string) (i int) {
    method GetInt64 (line 296) | func (c *Context) GetInt64(key string) (i64 int64) {
    method GetUint (line 304) | func (c *Context) GetUint(key string) (ui uint) {
    method GetUint64 (line 312) | func (c *Context) GetUint64(key string) (ui64 uint64) {
    method GetFloat64 (line 320) | func (c *Context) GetFloat64(key string) (f64 float64) {
    method GetTime (line 328) | func (c *Context) GetTime(key string) (t time.Time) {
    method GetDuration (line 336) | func (c *Context) GetDuration(key string) (d time.Duration) {
    method GetStringSlice (line 344) | func (c *Context) GetStringSlice(key string) (ss []string) {
    method GetStringMap (line 352) | func (c *Context) GetStringMap(key string) (sm map[string]interface{}) {
    method GetStringMapString (line 360) | func (c *Context) GetStringMapString(key string) (sms map[string]strin...
    method GetStringMapStringSlice (line 368) | func (c *Context) GetStringMapStringSlice(key string) (smss map[string...
    method Param (line 385) | func (c *Context) Param(key string) string {
    method Query (line 397) | func (c *Context) Query(key string) string {
    method DefaultQuery (line 409) | func (c *Context) DefaultQuery(key, defaultValue string) string {
    method GetQuery (line 424) | func (c *Context) GetQuery(key string) (string, bool) {
    method QueryArray (line 433) | func (c *Context) QueryArray(key string) []string {
    method initQueryCache (line 438) | func (c *Context) initQueryCache() {
    method GetQueryArray (line 450) | func (c *Context) GetQueryArray(key string) ([]string, bool) {
    method QueryMap (line 459) | func (c *Context) QueryMap(key string) map[string]string {
    method GetQueryMap (line 466) | func (c *Context) GetQueryMap(key string) (map[string]string, bool) {
    method PostForm (line 473) | func (c *Context) PostForm(key string) string {
    method DefaultPostForm (line 481) | func (c *Context) DefaultPostForm(key, defaultValue string) string {
    method GetPostForm (line 495) | func (c *Context) GetPostForm(key string) (string, bool) {
    method PostFormArray (line 504) | func (c *Context) PostFormArray(key string) []string {
    method initFormCache (line 509) | func (c *Context) initFormCache() {
    method GetPostFormArray (line 524) | func (c *Context) GetPostFormArray(key string) ([]string, bool) {
    method PostFormMap (line 533) | func (c *Context) PostFormMap(key string) map[string]string {
    method GetPostFormMap (line 540) | func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
    method get (line 546) | func (c *Context) get(m map[string][]string, key string) (map[string]s...
    method FormFile (line 561) | func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
    method MultipartForm (line 576) | func (c *Context) MultipartForm() (*multipart.Form, error) {
    method SaveUploadedFile (line 582) | func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst str...
    method Bind (line 607) | func (c *Context) Bind(obj interface{}) error {
    method BindJSON (line 613) | func (c *Context) BindJSON(obj interface{}) error {
    method BindXML (line 618) | func (c *Context) BindXML(obj interface{}) error {
    method BindQuery (line 623) | func (c *Context) BindQuery(obj interface{}) error {
    method BindYAML (line 628) | func (c *Context) BindYAML(obj interface{}) error {
    method BindHeader (line 633) | func (c *Context) BindHeader(obj interface{}) error {
    method BindUri (line 639) | func (c *Context) BindUri(obj interface{}) error {
    method MustBindWith (line 650) | func (c *Context) MustBindWith(obj interface{}, b binding.Binding) err...
    method ShouldBind (line 666) | func (c *Context) ShouldBind(obj interface{}) error {
    method ShouldBindJSON (line 672) | func (c *Context) ShouldBindJSON(obj interface{}) error {
    method ShouldBindXML (line 677) | func (c *Context) ShouldBindXML(obj interface{}) error {
    method ShouldBindQuery (line 682) | func (c *Context) ShouldBindQuery(obj interface{}) error {
    method ShouldBindYAML (line 687) | func (c *Context) ShouldBindYAML(obj interface{}) error {
    method ShouldBindHeader (line 692) | func (c *Context) ShouldBindHeader(obj interface{}) error {
    method ShouldBindUri (line 697) | func (c *Context) ShouldBindUri(obj interface{}) error {
    method ShouldBindWith (line 707) | func (c *Context) ShouldBindWith(obj interface{}, b binding.Binding) e...
    method ShouldBindBodyWith (line 716) | func (c *Context) ShouldBindBodyWith(obj interface{}, bb binding.Bindi...
    method ClientIP (line 738) | func (c *Context) ClientIP() string {
    method RemoteIP (line 765) | func (c *Context) RemoteIP() (net.IP, bool) {
    method ContentType (line 810) | func (c *Context) ContentType() string {
    method IsWebsocket (line 816) | func (c *Context) IsWebsocket() bool {
    method requestHeader (line 824) | func (c *Context) requestHeader(key string) string {
    method Status (line 846) | func (c *Context) Status(code int) {
    method Header (line 853) | func (c *Context) Header(key, value string) {
    method GetHeader (line 862) | func (c *Context) GetHeader(key string) string {
    method GetRawData (line 867) | func (c *Context) GetRawData() ([]byte, error) {
    method SetSameSite (line 872) | func (c *Context) SetSameSite(samesite http.SameSite) {
    method SetCookie (line 879) | func (c *Context) SetCookie(name, value string, maxAge int, path, doma...
    method Cookie (line 899) | func (c *Context) Cookie(name string) (string, error) {
    method Render (line 909) | func (c *Context) Render(code int, r render.Render) {
    method HTML (line 926) | func (c *Context) HTML(code int, name string, obj interface{}) {
    method IndentedJSON (line 935) | func (c *Context) IndentedJSON(code int, obj interface{}) {
    method SecureJSON (line 942) | func (c *Context) SecureJSON(code int, obj interface{}) {
    method JSONP (line 949) | func (c *Context) JSONP(code int, obj interface{}) {
    method JSON (line 960) | func (c *Context) JSON(code int, obj interface{}) {
    method AsciiJSON (line 966) | func (c *Context) AsciiJSON(code int, obj interface{}) {
    method PureJSON (line 972) | func (c *Context) PureJSON(code int, obj interface{}) {
    method XML (line 978) | func (c *Context) XML(code int, obj interface{}) {
    method YAML (line 983) | func (c *Context) YAML(code int, obj interface{}) {
    method ProtoBuf (line 988) | func (c *Context) ProtoBuf(code int, obj interface{}) {
    method String (line 993) | func (c *Context) String(code int, format string, values ...interface{...
    method Redirect (line 998) | func (c *Context) Redirect(code int, location string) {
    method Data (line 1007) | func (c *Context) Data(code int, contentType string, data []byte) {
    method DataFromReader (line 1015) | func (c *Context) DataFromReader(code int, contentLength int64, conten...
    method File (line 1025) | func (c *Context) File(filepath string) {
    method FileFromFS (line 1030) | func (c *Context) FileFromFS(filepath string, fs http.FileSystem) {
    method FileAttachment (line 1042) | func (c *Context) FileAttachment(filepath, filename string) {
    method SSEvent (line 1048) | func (c *Context) SSEvent(name string, message interface{}) {
    method Stream (line 1057) | func (c *Context) Stream(step func(w io.Writer) bool) bool {
    method Negotiate (line 1090) | func (c *Context) Negotiate(code int, config Negotiate) {
    method NegotiateFormat (line 1114) | func (c *Context) NegotiateFormat(offered ...string) string {
    method SetAccepted (line 1145) | func (c *Context) SetAccepted(formats ...string) {
    method Deadline (line 1155) | func (c *Context) Deadline() (deadline time.Time, ok bool) {
    method Done (line 1162) | func (c *Context) Done() <-chan struct{} {
    method Err (line 1167) | func (c *Context) Err() error {
    method Value (line 1174) | func (c *Context) Value(key interface{}) interface{} {
  function validateHeader (line 786) | func validateHeader(header string) (clientIP string, valid bool) {
  function bodyAllowedForStatus (line 833) | func bodyAllowedForStatus(status int) bool {
  type Negotiate (line 1079) | type Negotiate struct

FILE: framework/gin/context_appengine.go
  function init (line 10) | func init() {

FILE: framework/gin/context_test.go
  function createMultipartRequest (line 41) | func createMultipartRequest() *http.Request {
  function must (line 65) | func must(err error) {
  function TestContextFormFile (line 71) | func TestContextFormFile(t *testing.T) {
  function TestContextFormFileFailed (line 91) | func TestContextFormFileFailed(t *testing.T) {
  function TestContextMultipartForm (line 104) | func TestContextMultipartForm(t *testing.T) {
  function TestSaveUploadedOpenFailed (line 125) | func TestSaveUploadedOpenFailed(t *testing.T) {
  function TestSaveUploadedCreateFailed (line 140) | func TestSaveUploadedCreateFailed(t *testing.T) {
  function TestContextReset (line 160) | func TestContextReset(t *testing.T) {
  function TestContextHandlers (line 183) | func TestContextHandlers(t *testing.T) {
  function TestContextSetGet (line 204) | func TestContextSetGet(t *testing.T) {
  function TestContextSetGetValues (line 220) | func TestContextSetGetValues(t *testing.T) {
  function TestContextGetString (line 241) | func TestContextGetString(t *testing.T) {
  function TestContextSetGetBool (line 247) | func TestContextSetGetBool(t *testing.T) {
  function TestContextGetInt (line 253) | func TestContextGetInt(t *testing.T) {
  function TestContextGetInt64 (line 259) | func TestContextGetInt64(t *testing.T) {
  function TestContextGetUint (line 265) | func TestContextGetUint(t *testing.T) {
  function TestContextGetUint64 (line 271) | func TestContextGetUint64(t *testing.T) {
  function TestContextGetFloat64 (line 277) | func TestContextGetFloat64(t *testing.T) {
  function TestContextGetTime (line 283) | func TestContextGetTime(t *testing.T) {
  function TestContextGetDuration (line 290) | func TestContextGetDuration(t *testing.T) {
  function TestContextGetStringSlice (line 296) | func TestContextGetStringSlice(t *testing.T) {
  function TestContextGetStringMap (line 302) | func TestContextGetStringMap(t *testing.T) {
  function TestContextGetStringMapString (line 312) | func TestContextGetStringMapString(t *testing.T) {
  function TestContextGetStringMapStringSlice (line 322) | func TestContextGetStringMapStringSlice(t *testing.T) {
  function TestContextCopy (line 332) | func TestContextCopy(t *testing.T) {
  function TestContextHandlerName (line 353) | func TestContextHandlerName(t *testing.T) {
  function TestContextHandlerNames (line 360) | func TestContextHandlerNames(t *testing.T) {
  function handlerNameTest (line 372) | func handlerNameTest(c *Context) {
  function handlerNameTest2 (line 376) | func handlerNameTest2(c *Context) {
  function TestContextHandler (line 384) | func TestContextHandler(t *testing.T) {
  function TestContextQuery (line 391) | func TestContextQuery(t *testing.T) {
  function TestContextDefaultQueryOnEmptyRequest (line 426) | func TestContextDefaultQueryOnEmptyRequest(t *testing.T) {
  function TestContextQueryAndPostForm (line 441) | func TestContextQueryAndPostForm(t *testing.T) {
  function TestContextPostFormMultipart (line 539) | func TestContextPostFormMultipart(t *testing.T) {
  function TestContextSetCookie (line 631) | func TestContextSetCookie(t *testing.T) {
  function TestContextSetCookiePathEmpty (line 638) | func TestContextSetCookiePathEmpty(t *testing.T) {
  function TestContextGetCookie (line 645) | func TestContextGetCookie(t *testing.T) {
  function TestContextBodyAllowedForStatus (line 656) | func TestContextBodyAllowedForStatus(t *testing.T) {
  type TestPanicRender (line 663) | type TestPanicRender struct
    method Render (line 666) | func (*TestPanicRender) Render(http.ResponseWriter) error {
    method WriteContentType (line 670) | func (*TestPanicRender) WriteContentType(http.ResponseWriter) {}
  function TestContextRenderPanicIfErr (line 672) | func TestContextRenderPanicIfErr(t *testing.T) {
  function TestContextRenderJSON (line 688) | func TestContextRenderJSON(t *testing.T) {
  function TestContextRenderJSONP (line 701) | func TestContextRenderJSONP(t *testing.T) {
  function TestContextRenderJSONPWithoutCallback (line 715) | func TestContextRenderJSONPWithoutCallback(t *testing.T) {
  function TestContextRenderNoContentJSON (line 728) | func TestContextRenderNoContentJSON(t *testing.T) {
  function TestContextRenderAPIJSON (line 741) | func TestContextRenderAPIJSON(t *testing.T) {
  function TestContextRenderNoContentAPIJSON (line 754) | func TestContextRenderNoContentAPIJSON(t *testing.T) {
  function TestContextRenderIndentedJSON (line 768) | func TestContextRenderIndentedJSON(t *testing.T) {
  function TestContextRenderNoContentIndentedJSON (line 780) | func TestContextRenderNoContentIndentedJSON(t *testing.T) {
  function TestContextRenderSecureJSON (line 793) | func TestContextRenderSecureJSON(t *testing.T) {
  function TestContextRenderNoContentSecureJSON (line 806) | func TestContextRenderNoContentSecureJSON(t *testing.T) {
  function TestContextRenderNoContentAsciiJSON (line 817) | func TestContextRenderNoContentAsciiJSON(t *testing.T) {
  function TestContextRenderPureJSON (line 831) | func TestContextRenderPureJSON(t *testing.T) {
  function TestContextRenderHTML (line 842) | func TestContextRenderHTML(t *testing.T) {
  function TestContextRenderHTML2 (line 856) | func TestContextRenderHTML2(t *testing.T) {
  function TestContextRenderNoContentHTML (line 881) | func TestContextRenderNoContentHTML(t *testing.T) {
  function TestContextRenderXML (line 896) | func TestContextRenderXML(t *testing.T) {
  function TestContextRenderNoContentXML (line 908) | func TestContextRenderNoContentXML(t *testing.T) {
  function TestContextRenderString (line 921) | func TestContextRenderString(t *testing.T) {
  function TestContextRenderNoContentString (line 933) | func TestContextRenderNoContentString(t *testing.T) {
  function TestContextRenderHTMLString (line 946) | func TestContextRenderHTMLString(t *testing.T) {
  function TestContextRenderNoContentHTMLString (line 959) | func TestContextRenderNoContentHTMLString(t *testing.T) {
  function TestContextRenderData (line 973) | func TestContextRenderData(t *testing.T) {
  function TestContextRenderNoContentData (line 985) | func TestContextRenderNoContentData(t *testing.T) {
  function TestContextRenderSSE (line 996) | func TestContextRenderSSE(t *testing.T) {
  function TestContextRenderFile (line 1013) | func TestContextRenderFile(t *testing.T) {
  function TestContextRenderFileFromFS (line 1025) | func TestContextRenderFileFromFS(t *testing.T) {
  function TestContextRenderAttachment (line 1038) | func TestContextRenderAttachment(t *testing.T) {
  function TestContextRenderYAML (line 1053) | func TestContextRenderYAML(t *testing.T) {
  function TestContextRenderProtoBuf (line 1067) | func TestContextRenderProtoBuf(t *testing.T) {
  function TestContextHeaders (line 1088) | func TestContextHeaders(t *testing.T) {
  function TestContextRenderRedirectWithRelativePath (line 1105) | func TestContextRenderRedirectWithRelativePath(t *testing.T) {
  function TestContextRenderRedirectWithAbsolutePath (line 1119) | func TestContextRenderRedirectWithAbsolutePath(t *testing.T) {
  function TestContextRenderRedirectWith201 (line 1131) | func TestContextRenderRedirectWith201(t *testing.T) {
  function TestContextRenderRedirectAll (line 1143) | func TestContextRenderRedirectAll(t *testing.T) {
  function TestContextNegotiationWithJSON (line 1154) | func TestContextNegotiationWithJSON(t *testing.T) {
  function TestContextNegotiationWithXML (line 1169) | func TestContextNegotiationWithXML(t *testing.T) {
  function TestContextNegotiationWithHTML (line 1184) | func TestContextNegotiationWithHTML(t *testing.T) {
  function TestContextNegotiationNotSupport (line 1202) | func TestContextNegotiationNotSupport(t *testing.T) {
  function TestContextNegotiationFormat (line 1216) | func TestContextNegotiationFormat(t *testing.T) {
  function TestContextNegotiationFormatWithAccept (line 1225) | func TestContextNegotiationFormatWithAccept(t *testing.T) {
  function TestContextNegotiationFormatWithWildcardAccept (line 1235) | func TestContextNegotiationFormatWithWildcardAccept(t *testing.T) {
  function TestContextNegotiationFormatCustom (line 1259) | func TestContextNegotiationFormatCustom(t *testing.T) {
  function TestContextIsAborted (line 1272) | func TestContextIsAborted(t *testing.T) {
  function TestContextAbortWithStatus (line 1288) | func TestContextAbortWithStatus(t *testing.T) {
  type testJSONAbortMsg (line 1301) | type testJSONAbortMsg struct
  function TestContextAbortWithStatusJSON (line 1306) | func TestContextAbortWithStatusJSON(t *testing.T) {
  function TestContextError (line 1332) | func TestContextError(t *testing.T) {
  function TestContextTypedError (line 1367) | func TestContextTypedError(t *testing.T) {
  function TestContextAbortWithError (line 1381) | func TestContextAbortWithError(t *testing.T) {
  function resetTrustedCIDRs (line 1392) | func resetTrustedCIDRs(c *Context) {
  function TestContextClientIP (line 1396) | func TestContextClientIP(t *testing.T) {
  function resetContextForClientIPTests (line 1495) | func resetContextForClientIPTests(c *Context) {
  function TestContextContentType (line 1503) | func TestContextContentType(t *testing.T) {
  function TestContextAutoBindJSON (line 1511) | func TestContextAutoBindJSON(t *testing.T) {
  function TestContextBindWithJSON (line 1526) | func TestContextBindWithJSON(t *testing.T) {
  function TestContextBindWithXML (line 1542) | func TestContextBindWithXML(t *testing.T) {
  function TestContextBindHeader (line 1563) | func TestContextBindHeader(t *testing.T) {
  function TestContextBindWithQuery (line 1585) | func TestContextBindWithQuery(t *testing.T) {
  function TestContextBindWithYAML (line 1601) | func TestContextBindWithYAML(t *testing.T) {
  function TestContextBadAutoBind (line 1618) | func TestContextBadAutoBind(t *testing.T) {
  function TestContextAutoShouldBindJSON (line 1639) | func TestContextAutoShouldBindJSON(t *testing.T) {
  function TestContextShouldBindWithJSON (line 1654) | func TestContextShouldBindWithJSON(t *testing.T) {
  function TestContextShouldBindWithXML (line 1671) | func TestContextShouldBindWithXML(t *testing.T) {
  function TestContextShouldBindHeader (line 1692) | func TestContextShouldBindHeader(t *testing.T) {
  function TestContextShouldBindWithQuery (line 1714) | func TestContextShouldBindWithQuery(t *testing.T) {
  function TestContextShouldBindWithYAML (line 1734) | func TestContextShouldBindWithYAML(t *testing.T) {
  function TestContextBadAutoShouldBind (line 1751) | func TestContextBadAutoShouldBind(t *testing.T) {
  function TestContextShouldBindBodyWith (line 1770) | func TestContextShouldBindBodyWith(t *testing.T) {
  function TestContextGolangContext (line 1849) | func TestContextGolangContext(t *testing.T) {
  function TestWebsocketsRequired (line 1865) | func TestWebsocketsRequired(t *testing.T) {
  function TestGetRequestHeaderValue (line 1887) | func TestGetRequestHeaderValue(t *testing.T) {
  function TestContextGetRawData (line 1896) | func TestContextGetRawData(t *testing.T) {
  function TestContextRenderDataFromReader (line 1907) | func TestContextRenderDataFromReader(t *testing.T) {
  function TestContextRenderDataFromReaderNoHeaders (line 1926) | func TestContextRenderDataFromReaderNoHeaders(t *testing.T) {
  type TestResponseRecorder (line 1943) | type TestResponseRecorder struct
    method CloseNotify (line 1948) | func (r *TestResponseRecorder) CloseNotify() <-chan bool {
    method closeClient (line 1952) | func (r *TestResponseRecorder) closeClient() {
  function CreateTestResponseRecorder (line 1956) | func CreateTestResponseRecorder() *TestResponseRecorder {
  function TestContextStream (line 1963) | func TestContextStream(t *testing.T) {
  function TestContextStreamWithClientGone (line 1982) | func TestContextStreamWithClientGone(t *testing.T) {
  function TestContextResetInHandler (line 2000) | func TestContextResetInHandler(t *testing.T) {
  function TestRaceParamsContextCopy (line 2012) | func TestRaceParamsContextCopy(t *testing.T) {
  function TestContextWithKeysMutex (line 2033) | func TestContextWithKeysMutex(t *testing.T) {
  function TestRemoteIPFail (line 2046) | func TestRemoteIPFail(t *testing.T) {

FILE: framework/gin/debug.go
  constant ginSupportMinGoVer (line 15) | ginSupportMinGoVer = 12
  function IsDebugging (line 19) | func IsDebugging() bool {
  function debugPrintRoute (line 26) | func debugPrintRoute(httpMethod, absolutePath string, handlers HandlersC...
  function debugPrintLoadTemplate (line 38) | func debugPrintLoadTemplate(tmpl *template.Template) {
  function debugPrint (line 50) | func debugPrint(format string, values ...interface{}) {
  function getMinVer (line 59) | func getMinVer(v string) (uint64, error) {
  function debugPrintWARNINGDefault (line 68) | func debugPrintWARNINGDefault() {
  function debugPrintWARNINGNew (line 79) | func debugPrintWARNINGNew() {
  function debugPrintWARNINGSetHTMLTemplate (line 87) | func debugPrintWARNINGSetHTMLTemplate() {
  function debugPrintError (line 97) | func debugPrintError(err error) {

FILE: framework/gin/debug_test.go
  function TestIsDebugging (line 26) | func TestIsDebugging(t *testing.T) {
  function TestDebugPrint (line 35) | func TestDebugPrint(t *testing.T) {
  function TestDebugPrintError (line 49) | func TestDebugPrintError(t *testing.T) {
  function TestDebugPrintRoutes (line 59) | func TestDebugPrintRoutes(t *testing.T) {
  function TestDebugPrintRouteFunc (line 68) | func TestDebugPrintRouteFunc(t *testing.T) {
  function TestDebugPrintLoadTemplate (line 80) | func TestDebugPrintLoadTemplate(t *testing.T) {
  function TestDebugPrintWARNINGSetHTMLTemplate (line 90) | func TestDebugPrintWARNINGSetHTMLTemplate(t *testing.T) {
  function TestDebugPrintWARNINGDefault (line 99) | func TestDebugPrintWARNINGDefault(t *testing.T) {
  function TestDebugPrintWARNINGNew (line 113) | func TestDebugPrintWARNINGNew(t *testing.T) {
  function captureOutput (line 122) | func captureOutput(t *testing.T, f func()) string {
  function TestGetMinVer (line 153) | func TestGetMinVer(t *testing.T) {

FILE: framework/gin/deprecated.go
  method BindWith (line 15) | func (c *Context) BindWith(obj interface{}, b binding.Binding) error {

FILE: framework/gin/deprecated_test.go
  function TestBindWith (line 17) | func TestBindWith(t *testing.T) {

FILE: framework/gin/errors.go
  type ErrorType (line 16) | type ErrorType
  constant ErrorTypeBind (line 20) | ErrorTypeBind ErrorType = 1 << 63
  constant ErrorTypeRender (line 22) | ErrorTypeRender ErrorType = 1 << 62
  constant ErrorTypePrivate (line 24) | ErrorTypePrivate ErrorType = 1 << 0
  constant ErrorTypePublic (line 26) | ErrorTypePublic ErrorType = 1 << 1
  constant ErrorTypeAny (line 28) | ErrorTypeAny ErrorType = 1<<64 - 1
  constant ErrorTypeNu (line 30) | ErrorTypeNu = 2
  type Error (line 34) | type Error struct
    method SetType (line 45) | func (msg *Error) SetType(flags ErrorType) *Error {
    method SetMeta (line 51) | func (msg *Error) SetMeta(data interface{}) *Error {
    method JSON (line 57) | func (msg *Error) JSON() interface{} {
    method MarshalJSON (line 79) | func (msg *Error) MarshalJSON() ([]byte, error) {
    method Error (line 84) | func (msg Error) Error() string {
    method IsType (line 89) | func (msg *Error) IsType(flags ErrorType) bool {
    method Unwrap (line 94) | func (msg *Error) Unwrap() error {
  type errorMsgs (line 40) | type errorMsgs
    method ByType (line 100) | func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
    method Last (line 118) | func (a errorMsgs) Last() *Error {
    method Errors (line 131) | func (a errorMsgs) Errors() []string {
    method JSON (line 142) | func (a errorMsgs) JSON() interface{} {
    method MarshalJSON (line 158) | func (a errorMsgs) MarshalJSON() ([]byte, error) {
    method String (line 162) | func (a errorMsgs) String() string {

FILE: framework/gin/errors_1.13_test.go
  type TestErr (line 14) | type TestErr
    method Error (line 16) | func (e TestErr) Error() string { return string(e) }
  function TestErrorUnwrap (line 21) | func TestErrorUnwrap(t *testing.T) {

FILE: framework/gin/errors_test.go
  function TestError (line 15) | func TestError(t *testing.T) {
  function TestErrorSlice (line 66) | func TestErrorSlice(t *testing.T) {

FILE: framework/gin/fs.go
  type onlyFilesFS (line 12) | type onlyFilesFS struct
    method Open (line 33) | func (fs onlyFilesFS) Open(name string) (http.File, error) {
  type neuteredReaddirFile (line 16) | type neuteredReaddirFile struct
    method Readdir (line 42) | func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) {
  function Dir (line 24) | func Dir(root string, listDirectory bool) http.FileSystem {

FILE: framework/gin/gin.go
  constant defaultMultipartMemory (line 22) | defaultMultipartMemory = 32 << 20
  type HandlerFunc (line 32) | type HandlerFunc
  type HandlersChain (line 35) | type HandlersChain
    method Last (line 38) | func (c HandlersChain) Last() HandlerFunc {
  type RouteInfo (line 46) | type RouteInfo struct
  type RoutesInfo (line 54) | type RoutesInfo
  type Engine (line 58) | type Engine struct
    method allocateContext (line 194) | func (engine *Engine) allocateContext() *Context {
    method Delims (line 201) | func (engine *Engine) Delims(left, right string) *Engine {
    method SecureJsonPrefix (line 207) | func (engine *Engine) SecureJsonPrefix(prefix string) *Engine {
    method LoadHTMLGlob (line 214) | func (engine *Engine) LoadHTMLGlob(pattern string) {
    method LoadHTMLFiles (line 230) | func (engine *Engine) LoadHTMLFiles(files ...string) {
    method SetHTMLTemplate (line 241) | func (engine *Engine) SetHTMLTemplate(templ *template.Template) {
    method SetFuncMap (line 250) | func (engine *Engine) SetFuncMap(funcMap template.FuncMap) {
    method NoRoute (line 255) | func (engine *Engine) NoRoute(handlers ...HandlerFunc) {
    method NoMethod (line 261) | func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
    method Use (line 269) | func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes {
    method rebuild404Handlers (line 276) | func (engine *Engine) rebuild404Handlers() {
    method rebuild405Handlers (line 280) | func (engine *Engine) rebuild405Handlers() {
    method addRoute (line 284) | func (engine *Engine) addRoute(method, path string, handlers HandlersC...
    method Routes (line 307) | func (engine *Engine) Routes() (routes RoutesInfo) {
    method Run (line 334) | func (engine *Engine) Run(addr ...string) (err error) {
    method prepareTrustedCIDRs (line 348) | func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) {
    method RunTLS (line 394) | func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err erro...
    method RunUnix (line 405) | func (engine *Engine) RunUnix(file string) (err error) {
    method RunFd (line 423) | func (engine *Engine) RunFd(fd int) (err error) {
    method RunListener (line 439) | func (engine *Engine) RunListener(listener net.Listener) (err error) {
    method ServeHTTP (line 447) | func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Reque...
    method HandleContext (line 461) | func (engine *Engine) HandleContext(c *Context) {
    method handleHTTPRequest (line 469) | func (engine *Engine) handleHTTPRequest(c *Context) {
  function New (line 152) | func New() *Engine {
  function Default (line 186) | func Default() *Engine {
  function iterate (line 314) | func iterate(path, method string, routes RoutesInfo, root *node) RoutesI...
  function parseIP (line 379) | func parseIP(ip string) net.IP {
  function serveError (line 531) | func serveError(c *Context, code int, defaultMessage []byte) {
  function redirectTrailingSlash (line 548) | func redirectTrailingSlash(c *Context) {
  function redirectFixedPath (line 561) | func redirectFixedPath(c *Context, root *node, trailingSlash bool) bool {
  function redirectRequest (line 573) | func redirectRequest(c *Context) {

FILE: framework/gin/ginS/gins.go
  function engine (line 18) | func engine() *gin.Engine {
  function LoadHTMLGlob (line 26) | func LoadHTMLGlob(pattern string) {
  function LoadHTMLFiles (line 31) | func LoadHTMLFiles(files ...string) {
  function SetHTMLTemplate (line 36) | func SetHTMLTemplate(templ *template.Template) {
  function NoRoute (line 41) | func NoRoute(handlers ...gin.HandlerFunc) {
  function NoMethod (line 46) | func NoMethod(handlers ...gin.HandlerFunc) {
  function Group (line 52) | func Group(relativePath string, handlers ...gin.HandlerFunc) *gin.Router...
  function Handle (line 57) | func Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc...
  function POST (line 62) | func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function GET (line 67) | func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function DELETE (line 72) | func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function PATCH (line 77) | func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function PUT (line 82) | func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function OPTIONS (line 87) | func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRout...
  function HEAD (line 92) | func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function Any (line 97) | func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
  function StaticFile (line 102) | func StaticFile(relativePath, filepath string) gin.IRoutes {
  function Static (line 112) | func Static(relativePath, root string) gin.IRoutes {
  function StaticFS (line 117) | func StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes {
  function Use (line 124) | func Use(middlewares ...gin.HandlerFunc) gin.IRoutes {
  function Routes (line 129) | func Routes() gin.RoutesInfo {
  function Run (line 136) | func Run(addr ...string) (err error) {
  function RunTLS (line 143) | func RunTLS(addr, certFile, keyFile string) (err error) {
  function RunUnix (line 150) | func RunUnix(file string) (err error) {
  function RunFd (line 157) | func RunFd(fd int) (err error) {

FILE: framework/gin/gin_integration_test.go
  function testRequest (line 28) | func testRequest(t *testing.T, params ...string) {
  function TestRunEmpty (line 64) | func TestRunEmpty(t *testing.T) {
  function TestTrustedCIDRsForRun (line 79) | func TestTrustedCIDRsForRun(t *testing.T) {
  function TestRunTLS (line 86) | func TestRunTLS(t *testing.T) {
  function TestPusher (line 102) | func TestPusher(t *testing.T) {
  function TestRunEmptyWithEnv (line 139) | func TestRunEmptyWithEnv(t *testing.T) {
  function TestRunTooMuchParams (line 154) | func TestRunTooMuchParams(t *testing.T) {
  function TestRunWithPort (line 161) | func TestRunWithPort(t *testing.T) {
  function TestUnixSocket (line 175) | func TestUnixSocket(t *testing.T) {
  function TestBadUnixSocket (line 203) | func TestBadUnixSocket(t *testing.T) {
  function TestFileDescriptor (line 208) | func TestFileDescriptor(t *testing.T) {
  function TestBadFileDescriptor (line 239) | func TestBadFileDescriptor(t *testing.T) {
  function TestListener (line 244) | func TestListener(t *testing.T) {
  function TestBadListener (line 271) | func TestBadListener(t *testing.T) {
  function TestWithHttptestWithAutoSelectedPort (line 281) | func TestWithHttptestWithAutoSelectedPort(t *testing.T) {
  function TestConcurrentHandleContext (line 291) | func TestConcurrentHandleContext(t *testing.T) {
  function testGetRequestHandler (line 326) | func testGetRequestHandler(t *testing.T, h http.Handler, url string) {
  function TestTreeRunDynamicRouting (line 337) | func TestTreeRunDynamicRouting(t *testing.T) {

FILE: framework/gin/gin_test.go
  function formatAsDate (line 24) | func formatAsDate(t time.Time) string {
  function setupHTMLFiles (line 29) | func setupHTMLFiles(t *testing.T, mode string, tls bool, loadMethod func...
  function TestLoadHTMLGlobDebugMode (line 62) | func TestLoadHTMLGlobDebugMode(t *testing.T) {
  function TestLoadHTMLGlobTestMode (line 82) | func TestLoadHTMLGlobTestMode(t *testing.T) {
  function TestLoadHTMLGlobReleaseMode (line 102) | func TestLoadHTMLGlobReleaseMode(t *testing.T) {
  function TestLoadHTMLGlobUsingTLS (line 122) | func TestLoadHTMLGlobUsingTLS(t *testing.T) {
  function TestLoadHTMLGlobFromFuncMap (line 149) | func TestLoadHTMLGlobFromFuncMap(t *testing.T) {
  function init (line 169) | func init() {
  function TestCreateEngine (line 173) | func TestCreateEngine(t *testing.T) {
  function TestLoadHTMLFilesTestMode (line 180) | func TestLoadHTMLFilesTestMode(t *testing.T) {
  function TestLoadHTMLFilesDebugMode (line 200) | func TestLoadHTMLFilesDebugMode(t *testing.T) {
  function TestLoadHTMLFilesReleaseMode (line 220) | func TestLoadHTMLFilesReleaseMode(t *testing.T) {
  function TestLoadHTMLFilesUsingTLS (line 240) | func TestLoadHTMLFilesUsingTLS(t *testing.T) {
  function TestLoadHTMLFilesFuncMap (line 267) | func TestLoadHTMLFilesFuncMap(t *testing.T) {
  function TestAddRoute (line 287) | func TestAddRoute(t *testing.T) {
  function TestAddRouteFails (line 305) | func TestAddRouteFails(t *testing.T) {
  function TestCreateDefaultRouter (line 317) | func TestCreateDefaultRouter(t *testing.T) {
  function TestNoRouteWithoutGlobalHandlers (line 322) | func TestNoRouteWithoutGlobalHandlers(t *testing.T) {
  function TestNoRouteWithGlobalHandlers (line 344) | func TestNoRouteWithGlobalHandlers(t *testing.T) {
  function TestNoMethodWithoutGlobalHandlers (line 375) | func TestNoMethodWithoutGlobalHandlers(t *testing.T) {
  function TestRebuild404Handlers (line 397) | func TestRebuild404Handlers(t *testing.T) {
  function TestNoMethodWithGlobalHandlers (line 401) | func TestNoMethodWithGlobalHandlers(t *testing.T) {
  function compareFunc (line 432) | func compareFunc(t *testing.T, a, b interface{}) {
  function TestListOfRoutes (line 440) | func TestListOfRoutes(t *testing.T) {
  function TestEngineHandleContext (line 482) | func TestEngineHandleContext(t *testing.T) {
  function TestEngineHandleContextManyReEntries (line 499) | func TestEngineHandleContextManyReEntries(t *testing.T) {
  function TestPrepareTrustedCIRDsWith (line 536) | func TestPrepareTrustedCIRDsWith(t *testing.T) {
  function parseCIDR (line 661) | func parseCIDR(cidr string) *net.IPNet {
  function assertRoutePresent (line 669) | func assertRoutePresent(t *testing.T, gotRoutes RoutesInfo, wantRoute Ro...
  function handlerTest1 (line 679) | func handlerTest1(c *Context) {}
  function handlerTest2 (line 680) | func handlerTest2(c *Context) {}

FILE: framework/gin/githubapi_test.go
  type route (line 19) | type route struct
  function TestShouldBindUri (line 288) | func TestShouldBindUri(t *testing.T) {
  function TestBindUri (line 310) | func TestBindUri(t *testing.T) {
  function TestBindUriError (line 332) | func TestBindUriError(t *testing.T) {
  function TestRaceContextCopy (line 349) | func TestRaceContextCopy(t *testing.T) {
  function readWriteKeys (line 365) | func readWriteKeys(c *Context) {
  function githubConfigRouter (line 372) | func githubConfigRouter(router *Engine) {
  function TestGithubAPI (line 385) | func TestGithubAPI(t *testing.T) {
  function exampleFromPath (line 403) | func exampleFromPath(path string) (string, Params) {
  function BenchmarkGithub (line 438) | func BenchmarkGithub(b *testing.B) {
  function BenchmarkParallelGithub (line 444) | func BenchmarkParallelGithub(b *testing.B) {
  function BenchmarkParallelGithubDefault (line 460) | func BenchmarkParallelGithubDefault(b *testing.B) {

FILE: framework/gin/hade_context.go
  method BaseContext (line 10) | func (ctx *Context) BaseContext() context.Context {
  method Make (line 17) | func (ctx *Context) Make(key string) (interface{}, error) {
  method MustMake (line 22) | func (ctx *Context) MustMake(key string) interface{} {
  method MakeNew (line 27) | func (ctx *Context) MakeNew(key string, params []interface{}) (interface...

FILE: framework/gin/hade_context_contract.go
  method MustMakeApp (line 6) | func (c *Context) MustMakeApp() contract.App {
  method MustMakeKernel (line 11) | func (c *Context) MustMakeKernel() contract.Kernel {
  method MustMakeConfig (line 16) | func (c *Context) MustMakeConfig() contract.Config {
  method MustMakeLog (line 21) | func (c *Context) MustMakeLog() contract.Log {

FILE: framework/gin/hade_engine.go
  method SetContainer (line 6) | func (engine *Engine) SetContainer(container framework.Container) {
  method GetContainer (line 11) | func (engine *Engine) GetContainer() framework.Container {
  method Bind (line 16) | func (engine *Engine) Bind(provider framework.ServiceProvider) error {
  method IsBind (line 21) | func (engine *Engine) IsBind(key string) bool {

FILE: framework/gin/hade_request.go
  type IRequest (line 15) | type IRequest interface
  method QueryAll (line 72) | func (ctx *Context) QueryAll() map[string][]string {
  method DefaultQueryInt (line 81) | func (ctx *Context) DefaultQueryInt(key string, def int) (int, bool) {
  method DefaultQueryInt64 (line 92) | func (ctx *Context) DefaultQueryInt64(key string, def int64) (int64, boo...
  method DefaultQueryFloat64 (line 102) | func (ctx *Context) DefaultQueryFloat64(key string, def float64) (float6...
  method DefaultQueryFloat32 (line 112) | func (ctx *Context) DefaultQueryFloat32(key string, def float32) (float3...
  method DefaultQueryBool (line 122) | func (ctx *Context) DefaultQueryBool(key string, def bool) (bool, bool) {
  method DefaultQueryString (line 132) | func (ctx *Context) DefaultQueryString(key string, def string) (string, ...
  method DefaultQueryStringSlice (line 142) | func (ctx *Context) DefaultQueryStringSlice(key string, def []string) ([...
  method DefaultParamInt (line 152) | func (ctx *Context) DefaultParamInt(key string, def int) (int, bool) {
  method DefaultParamInt64 (line 160) | func (ctx *Context) DefaultParamInt64(key string, def int64) (int64, boo...
  method DefaultParamFloat64 (line 167) | func (ctx *Context) DefaultParamFloat64(key string, def float64) (float6...
  method DefaultParamFloat32 (line 174) | func (ctx *Context) DefaultParamFloat32(key string, def float32) (float3...
  method DefaultParamBool (line 181) | func (ctx *Context) DefaultParamBool(key string, def bool) (bool, bool) {
  method DefaultParamString (line 188) | func (ctx *Context) DefaultParamString(key string, def string) (string, ...
  method HadeParam (line 196) | func (ctx *Context) HadeParam(key string) interface{} {
  method FormAll (line 203) | func (ctx *Context) FormAll() map[string][]string {
  method DefaultFormInt64 (line 208) | func (ctx *Context) DefaultFormInt64(key string, def int64) (int64, bool) {
  method DefaultFormFloat64 (line 218) | func (ctx *Context) DefaultFormFloat64(key string, def float64) (float64...
  method DefaultFormFloat32 (line 228) | func (ctx *Context) DefaultFormFloat32(key string, def float32) (float32...
  method DefaultFormBool (line 238) | func (ctx *Context) DefaultFormBool(key string, def bool) (bool, bool) {
  method DefaultFormStringSlice (line 248) | func (ctx *Context) DefaultFormStringSlice(key string, def []string) ([]...
  method DefaultForm (line 256) | func (ctx *Context) DefaultForm(key string) interface{} {

FILE: framework/gin/hade_response.go
  type IResponse (line 16) | type IResponse interface
  method IJsonp (line 49) | func (ctx *Context) IJsonp(obj interface{}) IResponse {
  method IXml (line 84) | func (ctx *Context) IXml(obj interface{}) IResponse {
  method IHtml (line 95) | func (ctx *Context) IHtml(file string, obj interface{}) IResponse {
  method IText (line 111) | func (ctx *Context) IText(format string, values ...interface{}) IResponse {
  method IRedirect (line 119) | func (ctx *Context) IRedirect(path string) IResponse {
  method ISetHeader (line 125) | func (ctx *Context) ISetHeader(key string, val string) IResponse {
  method ISetCookie (line 131) | func (ctx *Context) ISetCookie(key string, val string, maxAge int, path ...
  method ISetStatus (line 149) | func (ctx *Context) ISetStatus(code int) IResponse {
  method ISetOkStatus (line 155) | func (ctx *Context) ISetOkStatus() IResponse {
  method IJson (line 160) | func (ctx *Context) IJson(obj interface{}) IResponse {

FILE: framework/gin/internal/bytesconv/bytesconv.go
  function StringToBytes (line 12) | func StringToBytes(s string) []byte {
  function BytesToString (line 22) | func BytesToString(b []byte) string {

FILE: framework/gin/internal/bytesconv/bytesconv_test.go
  function rawBytesToStr (line 18) | func rawBytesToStr(b []byte) string {
  function rawStrToBytes (line 22) | func rawStrToBytes(s string) []byte {
  function TestBytesToString (line 28) | func TestBytesToString(t *testing.T) {
  constant letterBytes (line 38) | letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  constant letterIdxBits (line 40) | letterIdxBits = 6
  constant letterIdxMask (line 41) | letterIdxMask = 1<<letterIdxBits - 1
  constant letterIdxMax (line 42) | letterIdxMax  = 63 / letterIdxBits
  function RandStringBytesMaskImprSrcSB (line 47) | func RandStringBytesMaskImprSrcSB(n int) string {
  function TestStringToBytes (line 66) | func TestStringToBytes(t *testing.T) {
  function BenchmarkBytesConvBytesToStrRaw (line 77) | func BenchmarkBytesConvBytesToStrRaw(b *testing.B) {
  function BenchmarkBytesConvBytesToStr (line 83) | func BenchmarkBytesConvBytesToStr(b *testing.B) {
  function BenchmarkBytesConvStrToBytesRaw (line 89) | func BenchmarkBytesConvStrToBytesRaw(b *testing.B) {
  function BenchmarkBytesConvStrToBytes (line 95) | func BenchmarkBytesConvStrToBytes(b *testing.B) {

FILE: framework/gin/logger.go
  type consoleColorModeValue (line 17) | type consoleColorModeValue
  constant autoColor (line 20) | autoColor consoleColorModeValue = iota
  constant disableColor (line 21) | disableColor
  constant forceColor (line 22) | forceColor
  constant green (line 26) | green   = "\033[97;42m"
  constant white (line 27) | white   = "\033[90;47m"
  constant yellow (line 28) | yellow  = "\033[90;43m"
  constant red (line 29) | red     = "\033[97;41m"
  constant blue (line 30) | blue    = "\033[97;44m"
  constant magenta (line 31) | magenta = "\033[97;45m"
  constant cyan (line 32) | cyan    = "\033[97;46m"
  constant reset (line 33) | reset   = "\033[0m"
  type LoggerConfig (line 39) | type LoggerConfig struct
  type LogFormatter (line 53) | type LogFormatter
  type LogFormatterParams (line 56) | type LogFormatterParams struct
    method StatusCodeColor (line 82) | func (p *LogFormatterParams) StatusCodeColor() string {
    method MethodColor (line 98) | func (p *LogFormatterParams) MethodColor() string {
    method ResetColor (line 122) | func (p *LogFormatterParams) ResetColor() string {
    method IsOutputColor (line 127) | func (p *LogFormatterParams) IsOutputColor() bool {
  function DisableConsoleColor (line 156) | func DisableConsoleColor() {
  function ForceConsoleColor (line 161) | func ForceConsoleColor() {
  function ErrorLogger (line 166) | func ErrorLogger() HandlerFunc {
  function ErrorLoggerT (line 171) | func ErrorLoggerT(typ ErrorType) HandlerFunc {
  function Logger (line 183) | func Logger() HandlerFunc {
  function LoggerWithFormatter (line 188) | func LoggerWithFormatter(f LogFormatter) HandlerFunc {
  function LoggerWithWriter (line 196) | func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
  function LoggerWithConfig (line 204) | func LoggerWithConfig(conf LoggerConfig) HandlerFunc {

FILE: framework/gin/logger_test.go
  function init (line 18) | func init() {
  function TestLogger (line 22) | func TestLogger(t *testing.T) {
  function TestLoggerWithConfig (line 86) | func TestLoggerWithConfig(t *testing.T) {
  function TestLoggerWithFormatter (line 150) | func TestLoggerWithFormatter(t *testing.T) {
  function TestLoggerWithConfigFormatting (line 182) | func TestLoggerWithConfigFormatting(t *testing.T) {
  function TestDefaultLogFormatter (line 234) | func TestDefaultLogFormatter(t *testing.T) {
  function TestColorForMethod (line 288) | func TestColorForMethod(t *testing.T) {
  function TestColorForStatus (line 306) | func TestColorForStatus(t *testing.T) {
  function TestResetColor (line 320) | func TestResetColor(t *testing.T) {
  function TestIsOutputColor (line 325) | func TestIsOutputColor(t *testing.T) {
  function TestErrorLogger (line 358) | func TestErrorLogger(t *testing.T) {
  function TestLoggerWithWriterSkippingPaths (line 385) | func TestLoggerWithWriterSkippingPaths(t *testing.T) {
  function TestLoggerWithConfigSkippingPaths (line 400) | func TestLoggerWithConfigSkippingPaths(t *testing.T) {
  function TestDisableConsoleColor (line 418) | func TestDisableConsoleColor(t *testing.T) {
  function TestForceConsoleColor (line 428) | func TestForceConsoleColor(t *testing.T) {

FILE: framework/gin/middleware_test.go
  function TestMiddlewareGeneralCase (line 17) | func TestMiddlewareGeneralCase(t *testing.T) {
  function TestMiddlewareNoRoute (line 45) | func TestMiddlewareNoRoute(t *testing.T) {
  function TestMiddlewareNoMethodEnabled (line 81) | func TestMiddlewareNoMethodEnabled(t *testing.T) {
  function TestMiddlewareNoMethodDisabled (line 118) | func TestMiddlewareNoMethodDisabled(t *testing.T) {
  function TestMiddlewareAbort (line 155) | func TestMiddlewareAbort(t *testing.T) {
  function TestMiddlewareAbortHandlersChainAndNext (line 181) | func TestMiddlewareAbortHandlersChainAndNext(t *testing.T) {
  function TestMiddlewareFailHandlersChain (line 205) | func TestMiddlewareFailHandlersChain(t *testing.T) {
  function TestMiddlewareWrite (line 226) | func TestMiddlewareWrite(t *testing.T) {

FILE: framework/gin/mode.go
  constant EnvGinMode (line 15) | EnvGinMode = "GIN_MODE"
  constant DebugMode (line 19) | DebugMode = "debug"
  constant ReleaseMode (line 21) | ReleaseMode = "release"
  constant TestMode (line 23) | TestMode = "test"
  constant debugCode (line 27) | debugCode = iota
  constant releaseCode (line 28) | releaseCode
  constant testCode (line 29) | testCode
  function init (line 47) | func init() {
  function SetMode (line 53) | func SetMode(value string) {
  function DisableBindValidation (line 73) | func DisableBindValidation() {
  function EnableJsonDecoderUseNumber (line 79) | func EnableJsonDecoderUseNumber() {
  function EnableJsonDecoderDisallowUnknownFields (line 85) | func EnableJsonDecoderDisallowUnknownFields() {
  function Mode (line 90) | func Mode() string {

FILE: framework/gin/mode_test.go
  function init (line 15) | func init() {
  function TestSetMode (line 19) | func TestSetMode(t *testing.T) {
  function TestDisableBindValidation (line 43) | func TestDisableBindValidation(t *testing.T) {
  function TestEnableJsonDecoderUseNumber (line 51) | func TestEnableJsonDecoderUseNumber(t *testing.T) {
  function TestEnableJsonDecoderDisallowUnknownFields (line 57) | func TestEnableJsonDecoderDisallowUnknownFields(t *testing.T) {

FILE: framework/gin/path.go
  function cleanPath (line 21) | func cleanPath(p string) string {
  function bufApp (line 127) | func bufApp(buf *[]byte, s string, w int, c byte) {

FILE: framework/gin/path_test.go
  type cleanPathTest (line 15) | type cleanPathTest struct
  function TestPathClean (line 71) | func TestPathClean(t *testing.T) {
  function TestPathCleanMallocs (line 78) | func TestPathCleanMallocs(t *testing.T) {
  function BenchmarkPathClean (line 89) | func BenchmarkPathClean(b *testing.B) {
  function genLongPaths (line 99) | func genLongPaths() (testPaths []cleanPathTest) {
  function TestPathCleanLong (line 121) | func TestPathCleanLong(t *testing.T) {
  function BenchmarkPathCleanLong (line 130) | func BenchmarkPathCleanLong(b *testing.B) {

FILE: framework/gin/recovery.go
  type RecoveryFunc (line 30) | type RecoveryFunc
  function Recovery (line 33) | func Recovery() HandlerFunc {
  function CustomRecovery (line 38) | func CustomRecovery(handle RecoveryFunc) HandlerFunc {
  function RecoveryWithWriter (line 43) | func RecoveryWithWriter(out io.Writer, recovery ...RecoveryFunc) Handler...
  function CustomRecoveryWithWriter (line 51) | func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) Handle...
  function defaultHandleRecovery (line 103) | func defaultHandleRecovery(c *Context, err interface{}) {
  function stack (line 108) | func stack(skip int) []byte {
  function source (line 135) | func source(lines [][]byte, n int) []byte {
  function function (line 144) | func function(pc uintptr) []byte {
  function timeFormat (line 168) | func timeFormat(t time.Time) string {

FILE: framework/gin/recovery_test.go
  function TestPanicClean (line 20) | func TestPanicClean(t *testing.T) {
  function TestPanicInHandler (line 52) | func TestPanicInHandler(t *testing.T) {
  function TestPanicWithAbort (line 80) | func TestPanicWithAbort(t *testing.T) {
  function TestSource (line 93) | func TestSource(t *testing.T) {
  function TestFunction (line 108) | func TestFunction(t *testing.T) {
  function TestPanicWithBrokenPipe (line 115) | func TestPanicWithBrokenPipe(t *testing.T) {
  function TestCustomRecoveryWithWriter (line 148) | func TestCustomRecoveryWithWriter(t *testing.T) {
  function TestCustomRecovery (line 182) | func TestCustomRecovery(t *testing.T) {
  function TestRecoveryWithWriterWithCustomRecovery (line 217) | func TestRecoveryWithWriterWithCustomRecovery(t *testing.T) {

FILE: framework/gin/render/data.go
  type Data (line 10) | type Data struct
    method Render (line 16) | func (r Data) Render(w http.ResponseWriter) (err error) {
    method WriteContentType (line 23) | func (r Data) WriteContentType(w http.ResponseWriter) {

FILE: framework/gin/render/html.go
  type Delims (line 13) | type Delims struct
  type HTMLRender (line 21) | type HTMLRender interface
  type HTMLProduction (line 27) | type HTMLProduction struct
    method Instance (line 50) | func (r HTMLProduction) Instance(name string, data interface{}) Render {
  type HTMLDebug (line 33) | type HTMLDebug struct
    method Instance (line 59) | func (r HTMLDebug) Instance(name string, data interface{}) Render {
    method loadTemplate (line 66) | func (r HTMLDebug) loadTemplate() *template.Template {
  type HTML (line 41) | type HTML struct
    method Render (line 80) | func (r HTML) Render(w http.ResponseWriter) error {
    method WriteContentType (line 90) | func (r HTML) WriteContentType(w http.ResponseWriter) {

FILE: framework/gin/render/json.go
  type JSON (line 18) | type JSON struct
    method Render (line 54) | func (r JSON) Render(w http.ResponseWriter) (err error) {
    method WriteContentType (line 62) | func (r JSON) WriteContentType(w http.ResponseWriter) {
  type IndentedJSON (line 23) | type IndentedJSON struct
    method Render (line 78) | func (r IndentedJSON) Render(w http.ResponseWriter) error {
    method WriteContentType (line 89) | func (r IndentedJSON) WriteContentType(w http.ResponseWriter) {
  type SecureJSON (line 28) | type SecureJSON struct
    method Render (line 94) | func (r SecureJSON) Render(w http.ResponseWriter) error {
    method WriteContentType (line 113) | func (r SecureJSON) WriteContentType(w http.ResponseWriter) {
  type JsonpJSON (line 34) | type JsonpJSON struct
    method Render (line 118) | func (r JsonpJSON) Render(w http.ResponseWriter) (err error) {
    method WriteContentType (line 152) | func (r JsonpJSON) WriteContentType(w http.ResponseWriter) {
  type AsciiJSON (line 40) | type AsciiJSON struct
    method Render (line 157) | func (r AsciiJSON) Render(w http.ResponseWriter) (err error) {
    method WriteContentType (line 178) | func (r AsciiJSON) WriteContentType(w http.ResponseWriter) {
  type PureJSON (line 45) | type PureJSON struct
    method Render (line 183) | func (r PureJSON) Render(w http.ResponseWriter) error {
    method WriteContentType (line 191) | func (r PureJSON) WriteContentType(w http.ResponseWriter) {
  function WriteJSON (line 67) | func WriteJSON(w http.ResponseWriter, obj interface{}) error {

FILE: framework/gin/render/msgpack.go
  type MsgPack (line 21) | type MsgPack struct
    method WriteContentType (line 28) | func (r MsgPack) WriteContentType(w http.ResponseWriter) {
    method Render (line 33) | func (r MsgPack) Render(w http.ResponseWriter) error {
  function WriteMsgPack (line 38) | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error {

FILE: framework/gin/render/protobuf.go
  type ProtoBuf (line 14) | type ProtoBuf struct
    method Render (line 21) | func (r ProtoBuf) Render(w http.ResponseWriter) error {
    method WriteContentType (line 34) | func (r ProtoBuf) WriteContentType(w http.ResponseWriter) {

FILE: framework/gin/render/reader.go
  type Reader (line 14) | type Reader struct
    method Render (line 22) | func (r Reader) Render(w http.ResponseWriter) (err error) {
    method WriteContentType (line 36) | func (r Reader) WriteContentType(w http.ResponseWriter) {
    method writeHeaders (line 41) | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string...

FILE: framework/gin/render/reader_test.go
  function TestReaderRenderNoHeaders (line 15) | func TestReaderRenderNoHeaders(t *testing.T) {

FILE: framework/gin/render/redirect.go
  type Redirect (line 13) | type Redirect struct
    method Render (line 20) | func (r Redirect) Render(w http.ResponseWriter) error {
    method WriteContentType (line 29) | func (r Redirect) WriteContentType(http.ResponseWriter) {}

FILE: framework/gin/render/render.go
  type Render (line 10) | type Render interface
  function writeContentType (line 35) | func writeContentType(w http.ResponseWriter, value []string) {

FILE: framework/gin/render/render_msgpack_test.go
  function TestRenderMsgPack (line 22) | func TestRenderMsgPack(t *testing.T) {

FILE: framework/gin/render/render_test.go
  function TestRenderJSON (line 26) | func TestRenderJSON(t *testing.T) {
  function TestRenderJSONPanics (line 43) | func TestRenderJSONPanics(t *testing.T) {
  function TestRenderIndentedJSON (line 51) | func TestRenderIndentedJSON(t *testing.T) {
  function TestRenderIndentedJSONPanics (line 65) | func TestRenderIndentedJSONPanics(t *testing.T) {
  function TestRenderSecureJSON (line 74) | func TestRenderSecureJSON(t *testing.T) {
  function TestRenderSecureJSONFail (line 102) | func TestRenderSecureJSONFail(t *testing.T) {
  function TestRenderJsonpJSON (line 111) | func TestRenderJsonpJSON(t *testing.T) {
  function TestRenderJsonpJSONError2 (line 139) | func TestRenderJsonpJSONError2(t *testing.T) {
  function TestRenderJsonpJSONFail (line 154) | func TestRenderJsonpJSONFail(t *testing.T) {
  function TestRenderAsciiJSON (line 163) | func TestRenderAsciiJSON(t *testing.T) {
  function TestRenderAsciiJSONFail (line 184) | func TestRenderAsciiJSONFail(t *testing.T) {
  function TestRenderPureJSON (line 192) | func TestRenderPureJSON(t *testing.T) {
  type xmlmap (line 204) | type xmlmap
    method MarshalXML (line 207) | func (h xmlmap) MarshalXML(e *xml.Encoder, start xml.StartElement) err...
  function TestRenderYAML (line 228) | func TestRenderYAML(t *testing.T) {
  type fail (line 245) | type fail struct
    method MarshalYAML (line 248) | func (ft *fail) MarshalYAML() (interface{}, error) {
  function TestRenderYAMLFail (line 252) | func TestRenderYAMLFail(t *testing.T) {
  function TestRenderProtoBuf (line 259) | func TestRenderProtoBuf(t *testing.T) {
  function TestRenderProtoBufFail (line 280) | func TestRenderProtoBufFail(t *testing.T) {
  function TestRenderXML (line 287) | func TestRenderXML(t *testing.T) {
  function TestRenderRedirect (line 303) | func TestRenderRedirect(t *testing.T) {
  function TestRenderData (line 343) | func TestRenderData(t *testing.T) {
  function TestRenderString (line 357) | func TestRenderString(t *testing.T) {
  function TestRenderStringLenZero (line 376) | func TestRenderStringLenZero(t *testing.T) {
  function TestRenderHTMLTemplate (line 389) | func TestRenderHTMLTemplate(t *testing.T) {
  function TestRenderHTMLTemplateEmptyName (line 405) | func TestRenderHTMLTemplateEmptyName(t *testing.T) {
  function TestRenderHTMLDebugFiles (line 421) | func TestRenderHTMLDebugFiles(t *testing.T) {
  function TestRenderHTMLDebugGlob (line 439) | func TestRenderHTMLDebugGlob(t *testing.T) {
  function TestRenderHTMLDebugPanics (line 457) | func TestRenderHTMLDebugPanics(t *testing.T) {
  function TestRenderReader (line 466) | func TestRenderReader(t *testing.T) {
  function TestRenderReaderNoContentLength (line 489) | func TestRenderReaderNoContentLength(t *testing.T) {

FILE: framework/gin/render/text.go
  type String (line 15) | type String struct
    method Render (line 23) | func (r String) Render(w http.ResponseWriter) error {
    method WriteContentType (line 28) | func (r String) WriteContentType(w http.ResponseWriter) {
  function WriteString (line 33) | func WriteString(w http.ResponseWriter, format string, data []interface{...

FILE: framework/gin/render/xml.go
  type XML (line 13) | type XML struct
    method Render (line 20) | func (r XML) Render(w http.ResponseWriter) error {
    method WriteContentType (line 26) | func (r XML) WriteContentType(w http.ResponseWriter) {

FILE: framework/gin/render/yaml.go
  type YAML (line 14) | type YAML struct
    method Render (line 21) | func (r YAML) Render(w http.ResponseWriter) error {
    method WriteContentType (line 34) | func (r YAML) WriteContentType(w http.ResponseWriter) {

FILE: framework/gin/response_writer.go
  constant noWritten (line 15) | noWritten     = -1
  constant defaultStatus (line 16) | defaultStatus = http.StatusOK
  type ResponseWriter (line 20) | type ResponseWriter interface
  type responseWriter (line 46) | type responseWriter struct
    method reset (line 54) | func (w *responseWriter) reset(writer http.ResponseWriter) {
    method WriteHeader (line 60) | func (w *responseWriter) WriteHeader(code int) {
    method WriteHeaderNow (line 69) | func (w *responseWriter) WriteHeaderNow() {
    method Write (line 76) | func (w *responseWriter) Write(data []byte) (n int, err error) {
    method WriteString (line 83) | func (w *responseWriter) WriteString(s string) (n int, err error) {
    method Status (line 90) | func (w *responseWriter) Status() int {
    method Size (line 94) | func (w *responseWriter) Size() int {
    method Written (line 98) | func (w *responseWriter) Written() bool {
    method Hijack (line 103) | func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
    method CloseNotify (line 111) | func (w *responseWriter) CloseNotify() <-chan bool {
    method Flush (line 116) | func (w *responseWriter) Flush() {
    method Pusher (line 121) | func (w *responseWriter) Pusher() (pusher http.Pusher) {

FILE: framework/gin/response_writer_test.go
  function init (line 27) | func init() {
  function TestResponseWriterReset (line 31) | func TestResponseWriterReset(t *testing.T) {
  function TestResponseWriterWriteHeader (line 45) | func TestResponseWriterWriteHeader(t *testing.T) {
  function TestResponseWriterWriteHeadersNow (line 60) | func TestResponseWriterWriteHeadersNow(t *testing.T) {
  function TestResponseWriterWrite (line 78) | func TestResponseWriterWrite(t *testing.T) {
  function TestResponseWriterHijack (line 99) | func TestResponseWriterHijack(t *testing.T) {
  function TestResponseWriterFlush (line 118) | func TestResponseWriterFlush(t *testing.T) {

FILE: framework/gin/routergroup.go
  type IRouter (line 15) | type IRouter interface
  type IRoutes (line 21) | type IRoutes interface
  type RouterGroup (line 41) | type RouterGroup struct
    method Use (line 51) | func (group *RouterGroup) Use(middleware ...HandlerFunc) IRoutes {
    method Group (line 58) | func (group *RouterGroup) Group(relativePath string, handlers ...Handl...
    method BasePath (line 68) | func (group *RouterGroup) BasePath() string {
    method handle (line 72) | func (group *RouterGroup) handle(httpMethod, relativePath string, hand...
    method Handle (line 89) | func (group *RouterGroup) Handle(httpMethod, relativePath string, hand...
    method POST (line 97) | func (group *RouterGroup) POST(relativePath string, handlers ...Handle...
    method GET (line 102) | func (group *RouterGroup) GET(relativePath string, handlers ...Handler...
    method DELETE (line 107) | func (group *RouterGroup) DELETE(relativePath string, handlers ...Hand...
    method PATCH (line 112) | func (group *RouterGroup) PATCH(relativePath string, handlers ...Handl...
    method PUT (line 117) | func (group *RouterGroup) PUT(relativePath string, handlers ...Handler...
    method OPTIONS (line 122) | func (group *RouterGroup) OPTIONS(relativePath string, handlers ...Han...
    method HEAD (line 127) | func (group *RouterGroup) HEAD(relativePath string, handlers ...Handle...
    method Any (line 133) | func (group *RouterGroup) Any(relativePath string, handlers ...Handler...
    method StaticFile (line 148) | func (group *RouterGroup) StaticFile(relativePath, filepath string) IR...
    method Static (line 166) | func (group *RouterGroup) Static(relativePath, root string) IRoutes {
    method StaticFS (line 172) | func (group *RouterGroup) StaticFS(relativePath string, fs http.FileSy...
    method createStaticHandler (line 185) | func (group *RouterGroup) createStaticHandler(relativePath string, fs ...
    method combineHandlers (line 210) | func (group *RouterGroup) combineHandlers(handlers HandlersChain) Hand...
    method calculateAbsolutePath (line 221) | func (group *RouterGroup) calculateAbsolutePath(relativePath string) s...
    method returnObj (line 225) | func (group *RouterGroup) returnObj() IRoutes {

FILE: framework/gin/routergroup_test.go
  function init (line 14) | func init() {
  function TestRouterGroupBasic (line 18) | func TestRouterGroupBasic(t *testing.T) {
  function TestRouterGroupBasicHandle (line 35) | func TestRouterGroupBasicHandle(t *testing.T) {
  function performRequestInGroup (line 45) | func performRequestInGroup(t *testing.T, method string) {
  function TestRouterGroupInvalidStatic (line 92) | func TestRouterGroupInvalidStatic(t *testing.T) {
  function TestRouterGroupInvalidStaticFile (line 103) | func TestRouterGroupInvalidStaticFile(t *testing.T) {
  function TestRouterGroupTooManyHandlers (line 114) | func TestRouterGroupTooManyHandlers(t *testing.T) {
  function TestRouterGroupBadMethod (line 128) | func TestRouterGroupBadMethod(t *testing.T) {
  function TestRouterGroupPipeline (line 153) | func TestRouterGroupPipeline(t *testing.T) {
  function testRoutesInterface (line 161) | func testRoutesInterface(t *testing.T, r IRoutes) {

FILE: framework/gin/routes_test.go
  type header (line 19) | type header struct
  function performRequest (line 24) | func performRequest(r http.Handler, method, path string, headers ...head...
  function testRouteOK (line 34) | func testRouteOK(method string, t *testing.T) {
  function testRouteNotOK (line 54) | func testRouteNotOK(method string, t *testing.T) {
  function testRouteNotOK2 (line 68) | func testRouteNotOK2(method string, t *testing.T) {
  function TestRouterMethod (line 88) | func TestRouterMethod(t *testing.T) {
  function TestRouterGroupRouteOK (line 108) | func TestRouterGroupRouteOK(t *testing.T) {
  function TestRouteNotOK (line 120) | func TestRouteNotOK(t *testing.T) {
  function TestRouteNotOK2 (line 132) | func TestRouteNotOK2(t *testing.T) {
  function TestRouteRedirectTrailingSlash (line 144) | func TestRouteRedirectTrailingSlash(t *testing.T) {
  function TestRouteRedirectFixedPath (line 200) | func TestRouteRedirectFixedPath(t *testing.T) {
  function TestRouteParamsByName (line 228) | func TestRouteParamsByName(t *testing.T) {
  function TestRouteParamsByNameWithExtraSlash (line 260) | func TestRouteParamsByNameWithExtraSlash(t *testing.T) {
  function TestRouteStaticFile (line 293) | func TestRouteStaticFile(t *testing.T) {
  function TestRouteStaticListingDir (line 328) | func TestRouteStaticListingDir(t *testing.T) {
  function TestRouteStaticNoListing (line 340) | func TestRouteStaticNoListing(t *testing.T) {
  function TestRouterMiddlewareAndStatic (line 350) | func TestRouterMiddlewareAndStatic(t *testing.T) {
  function TestRouteNotAllowedEnabled (line 369) | func TestRouteNotAllowedEnabled(t *testing.T) {
  function TestRouteNotAllowedEnabled2 (line 384) | func TestRouteNotAllowedEnabled2(t *testing.T) {
  function TestRouteNotAllowedDisabled (line 394) | func TestRouteNotAllowedDisabled(t *testing.T) {
  function TestRouterNotFoundWithRemoveExtraSlash (line 409) | func TestRouterNotFoundWithRemoveExtraSlash(t *testing.T) {
  function TestRouterNotFound (line 432) | func TestRouterNotFound(t *testing.T) {
  function TestRouterStaticFSNotFound (line 484) | func TestRouterStaticFSNotFound(t *testing.T) {
  function TestRouterStaticFSFileNotFound (line 498) | func TestRouterStaticFSFileNotFound(t *testing.T) {
  function TestMiddlewareCalledOnceByRouterStaticFSNotFound (line 509) | func TestMiddlewareCalledOnceByRouterStaticFSNotFound(t *testing.T) {
  function TestRouteRawPath (line 529) | func TestRouteRawPath(t *testing.T) {
  function TestRouteRawPathNoUnescape (line 548) | func TestRouteRawPathNoUnescape(t *testing.T) {
  function TestRouteServeErrorWithWriteHeader (line 568) | func TestRouteServeErrorWithWriteHeader(t *testing.T) {
  function TestRouteContextHoldsFullPath (line 580) | func TestRouteContextHoldsFullPath(t *testing.T) {

FILE: framework/gin/test_helpers.go
  function CreateTestContext (line 10) | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) {

FILE: framework/gin/testdata/protoexample/test.pb.go
  type FOO (line 23) | type FOO
    method Enum (line 36) | func (x FOO) Enum() *FOO {
    method String (line 41) | func (x FOO) String() string {
    method UnmarshalJSON (line 44) | func (x *FOO) UnmarshalJSON(data []byte) error {
  constant FOO_X (line 26) | FOO_X FOO = 17
  type Test (line 53) | type Test struct
    method Reset (line 61) | func (m *Test) Reset()         { *m = Test{} }
    method String (line 62) | func (m *Test) String() string { return proto.CompactTextString(m) }
    method ProtoMessage (line 63) | func (*Test) ProtoMessage()    {}
    method GetLabel (line 67) | func (m *Test) GetLabel() string {
    method GetType (line 74) | func (m *Test) GetType() int32 {
    method GetReps (line 81) | func (m *Test) GetReps() []int64 {
    method GetOptionalgroup (line 88) | func (m *Test) GetOptionalgroup() *Test_OptionalGroup {
  constant Default_Test_Type (line 65) | Default_Test_Type int32 = 77
  type Test_OptionalGroup (line 95) | type Test_OptionalGroup struct
    method Reset (line 100) | func (m *Test_OptionalGroup) Reset()         { *m = Test_OptionalGroup...
    method String (line 101) | func (m *Test_OptionalGroup) String() string { return proto.CompactTex...
    method ProtoMessage (line 102) | func (*Test_OptionalGroup) ProtoMessage()    {}
    method GetRequiredField (line 104) | func (m *Test_OptionalGroup) GetRequiredField() string {
  function init (line 111) | func init() {

FILE: framework/gin/tree.go
  type Param (line 23) | type Param struct
  type Params (line 31) | type Params
    method Get (line 35) | func (ps Params) Get(name string) (string, bool) {
    method ByName (line 46) | func (ps Params) ByName(name string) (va string) {
  type methodTree (line 51) | type methodTree struct
  type methodTrees (line 56) | type methodTrees
    method get (line 58) | func (trees methodTrees) get(method string) *node {
  function min (line 67) | func min(a, b int) int {
  function longestCommonPrefix (line 74) | func longestCommonPrefix(a, b string) int {
  function countParams (line 93) | func countParams(path string) uint16 {
  type nodeType (line 101) | type nodeType
  constant static (line 104) | static nodeType = iota
  constant root (line 105) | root
  constant param (line 106) | param
  constant catchAll (line 107) | catchAll
  type node (line 110) | type node struct
    method addChild (line 84) | func (n *node) addChild(child *node) {
    method incrementChildPrio (line 122) | func (n *node) incrementChildPrio(pos int) int {
    method addRoute (line 146) | func (n *node) addRoute(path string, handlers HandlersChain) {
    method insertChild (line 286) | func (n *node) insertChild(path string, fullPath string, handlers Hand...
    method getValue (line 402) | func (n *node) getValue(path string, params *Params, unescape bool) (v...
    method findCaseInsensitivePath (line 612) | func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash b...
    method findCaseInsensitivePathRec (line 649) | func (n *node) findCaseInsensitivePathRec(path string, ciPath []byte, ...
  function findWildcard (line 263) | func findWildcard(path string) (wildcard string, i int, valid bool) {
  type nodeValue (line 390) | type nodeValue struct
  function shiftNRuneBytes (line 633) | func shiftNRuneBytes(rb [4]byte, n int) [4]byte {

FILE: framework/gin/tree_test.go
  function fakeHandler (line 18) | func fakeHandler(val string) HandlersChain {
  type testRequests (line 24) | type testRequests
  function getParams (line 31) | func getParams() *Params {
  function checkRequests (line 36) | func checkRequests(t *testing.T, tree *node, requests testRequests, unes...
  function checkPriorities (line 67) | func checkPriorities(t *testing.T, n *node) uint32 {
  function TestCountParams (line 87) | func TestCountParams(t *testing.T) {
  function TestTreeAddAndGet (line 96) | func TestTreeAddAndGet(t *testing.T) {
  function TestTreeWildcard (line 133) | func TestTreeWildcard(t *testing.T) {
  function TestUnescapeParameters (line 313) | func TestUnescapeParameters(t *testing.T) {
  function catchPanic (line 350) | func catchPanic(testFunc func()) (recv interface{}) {
  type testRoute (line 359) | type testRoute struct
  function testRoutes (line 364) | func testRoutes(t *testing.T, routes []testRoute) {
  function TestTreeWildcardConflict (line 382) | func TestTreeWildcardConflict(t *testing.T) {
  function TestCatchAllAfterSlash (line 414) | func TestCatchAllAfterSlash(t *testing.T) {
  function TestTreeChildConflict (line 421) | func TestTreeChildConflict(t *testing.T) {
  function TestTreeDupliatePath (line 440) | func TestTreeDupliatePath(t *testing.T) {
  function TestEmptyWildcardName (line 478) | func TestEmptyWildcardName(t *testing.T) {
  function TestTreeCatchAllConflict (line 497) | func TestTreeCatchAllConflict(t *testing.T) {
  function TestTreeCatchAllConflictRoot (line 508) | func TestTreeCatchAllConflictRoot(t *testing.T) {
  function TestTreeCatchMaxParams (line 516) | func TestTreeCatchMaxParams(t *testing.T) {
  function TestTreeDoubleWildcard (line 522) | func TestTreeDoubleWildcard(t *testing.T) {
  function TestTreeTrailingSlashRedirect (line 553) | func TestTreeTrailingSlashRedirect(t *testing.T) {
  function TestTreeRootTrailingSlashRedirect (line 634) | func TestTreeRootTrailingSlashRedirect(t *testing.T) {
  function TestTreeFindCaseInsensitivePath (line 652) | func TestTreeFindCaseInsensitivePath(t *testing.T) {
  function TestTreeInvalidNodeType (line 812) | func TestTreeInvalidNodeType(t *testing.T) {
  function TestTreeWildcardConflictEx (line 839) | func TestTreeWildcardConflictEx(t *testing.T) {

FILE: framework/gin/utils.go
  constant BindKey (line 18) | BindKey = "_gin-gonic/gin/bindkey"
  function Bind (line 21) | func Bind(val interface{}) HandlerFunc {
  function WrapF (line 39) | func WrapF(f http.HandlerFunc) HandlerFunc {
  function WrapH (line 46) | func WrapH(h http.Handler) HandlerFunc {
  type H (line 53) | type H
    method MarshalXML (line 56) | func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  function assert1 (line 77) | func assert1(guard bool, text string) {
  function filterFlags (line 83) | func filterFlags(content string) string {
  function chooseData (line 92) | func chooseData(custom, wildcard interface{}) interface{} {
  function parseAccept (line 102) | func parseAccept(acceptHeader string) []string {
  function lastChar (line 116) | func lastChar(str string) uint8 {
  function nameOfFunction (line 123) | func nameOfFunction(f interface{}) string {
  function joinPaths (line 127) | func joinPaths(absolutePath, relativePath string) string {
  function resolveAddress (line 139) | func resolveAddress(addr []string) string {

FILE: framework/gin/utils_test.go
  function init (line 17) | func init() {
  function BenchmarkParseAccept (line 21) | func BenchmarkParseAccept(b *testing.B) {
  type testStruct (line 27) | type testStruct struct
    method ServeHTTP (line 31) | func (t *testStruct) ServeHTTP(w http.ResponseWriter, req *http.Reques...
  function TestWrap (line 38) | func TestWrap(t *testing.T) {
  function TestLastChar (line 57) | func TestLastChar(t *testing.T) {
  function TestParseAccept (line 63) | func TestParseAccept(t *testing.T) {
  function TestChooseData (line 72) | func TestChooseData(t *testing.T) {
  function TestFilterFlags (line 80) | func TestFilterFlags(t *testing.T) {
  function TestFunctionName (line 88) | func TestFunctionName(t *testing.T) {
  function somefunction (line 92) | func somefunction() {
  function TestJoinPaths (line 96) | func TestJoinPaths(t *testing.T) {
  type bindTestStruct (line 109) | type bindTestStruct struct
  function TestBindMiddleware (line 114) | func TestBindMiddleware(t *testing.T) {
  function TestMarshalXMLforH (line 136) | func TestMarshalXMLforH(t *testing.T) {

FILE: framework/gin/version.go
  constant Version (line 8) | Version = "v1.7.3"

FILE: framework/middleware/cost.go
  function Cost (line 14) | func Cost() gin.HandlerFunc {

FILE: framework/middleware/gin-swagger/swagger.go
  type Config (line 17) | type Config struct
  function URL (line 24) | func URL(url string) func(c *Config) {
  function DeepLinking (line 31) | func DeepLinking(deepLinking bool) func(c *Config) {
  function WrapHandler (line 38) | func WrapHandler(h *webdav.Handler, confs ...func(c *Config)) gin.Handle...
  function CustomWrapHandler (line 52) | func CustomWrapHandler(config *Config, h *webdav.Handler) gin.HandlerFunc {
  function DisablingWrapHandler (line 107) | func DisablingWrapHandler(h *webdav.Handler, envName string) gin.Handler...
  function DisablingCustomWrapHandler (line 122) | func DisablingCustomWrapHandler(config *Config, h *webdav.Handler, envNa...
  constant swagger_index_templ (line 135) | swagger_index_templ = `<!-- HTML for static distribution bundle build -->

FILE: framework/middleware/gin-swagger/swaggerFiles/ab0x.go
  type HTTPFS (line 33) | type HTTPFS struct
    method Open (line 50) | func (hfs *HTTPFS) Open(path string) (http.File, error) {
  function init (line 35) | func init() {
  function ReadFile (line 60) | func ReadFile(path string) ([]byte, error) {
  function WriteFile (line 86) | func WriteFile(filename string, data []byte, perm os.FileMode) error {
  function WalkDirs (line 103) | func WalkDirs(name string, includeDirsInList bool, files ...string) ([]s...

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__favicon-16x16.png.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__favicon-32x32.png.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__index.html.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__oauth2-redirect.html.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui-bundle.js.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui-standalone-preset.js.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui-standalone-preset.js.map.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui.css.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui.css.map.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui.js.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swaggerFiles/b0xfile__swagger-ui.js.map.go
  function init (line 13) | func init() {

FILE: framework/middleware/gin-swagger/swagger_test.go
  function TestWrapHandler (line 16) | func TestWrapHandler(t *testing.T) {
  function TestWrapCustomHandler (line 26) | func TestWrapCustomHandler(t *testing.T) {
  function TestDisablingWrapHandler (line 45) | func TestDisablingWrapHandler(t *testing.T) {
  function TestDisablingCustomWrapHandler (line 82) | func TestDisablingCustomWrapHandler(t *testing.T) {
  function TestWithGzipMiddleware (line 101) | func TestWithGzipMiddleware(t *testing.T) {
  function performRequest (line 126) | func performRequest(method, target string, router *gin.Engine) *httptest...

FILE: framework/middleware/static/static.go
  constant INDEX (line 12) | INDEX = "index.html"
  type ServeFileSystem (line 14) | type ServeFileSystem interface
  type localFileSystem (line 19) | type localFileSystem struct
    method Exists (line 33) | func (l *localFileSystem) Exists(prefix string, filepath string) bool {
  function LocalFile (line 25) | func LocalFile(root string, indexes bool) *localFileSystem {
  function ServeRoot (line 54) | func ServeRoot(urlPrefix, root string) gin.HandlerFunc {
  function Serve (line 59) | func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc {

FILE: framework/middleware/timeout.go
  function Timeout (line 15) | func Timeout(d time.Duration) gin.HandlerFunc {

FILE: framework/middleware/trace.go
  function Trace (line 9) | func Trace() gin.HandlerFunc {

FILE: framework/provider.go
  type NewInstance (line 4) | type NewInstance
  type ServiceProvider (line 7) | type ServiceProvider interface

FILE: framework/provider/app/provider.go
  type HadeAppProvider (line 9) | type HadeAppProvider struct
    method Register (line 14) | func (h *HadeAppProvider) Register(container framework.Container) fram...
    method Boot (line 19) | func (h *HadeAppProvider) Boot(container framework.Container) error {
    method IsDefer (line 24) | func (h *HadeAppProvider) IsDefer() bool {
    method Params (line 29) | func (h *HadeAppProvider) Params(container framework.Container) []inte...
    method Name (line 34) | func (h *HadeAppProvider) Name() string {

FILE: framework/provider/app/service.go
  type HadeApp (line 13) | type HadeApp struct
    method AppID (line 22) | func (app HadeApp) AppID() string {
    method Version (line 27) | func (app HadeApp) Version() string {
    method BaseFolder (line 32) | func (app HadeApp) BaseFolder() string {
    method ConfigFolder (line 42) | func (app HadeApp) ConfigFolder() string {
    method LogFolder (line 50) | func (app HadeApp) LogFolder() string {
    method HttpFolder (line 57) | func (app HadeApp) HttpFolder() string {
    method ConsoleFolder (line 64) | func (app HadeApp) ConsoleFolder() string {
    method StorageFolder (line 71) | func (app HadeApp) StorageFolder() string {
    method ProviderFolder (line 79) | func (app HadeApp) ProviderFolder() string {
    method MiddlewareFolder (line 87) | func (app HadeApp) MiddlewareFolder() string {
    method CommandFolder (line 95) | func (app HadeApp) CommandFolder() string {
    method RuntimeFolder (line 103) | func (app HadeApp) RuntimeFolder() string {
    method TestFolder (line 111) | func (app HadeApp) TestFolder() string {
    method DeployFolder (line 119) | func (app HadeApp) DeployFolder() string {
    method LoadAppConfig (line 146) | func (app *HadeApp) LoadAppConfig(kv map[string]string) {
    method AppFolder (line 153) | func (app *HadeApp) AppFolder() string {
  function NewHadeApp (line 127) | func NewHadeApp(params ...interface{}) (interface{}, error) {

FILE: framework/provider/cache/provider.go
  type HadeCacheProvider (line 12) | type HadeCacheProvider struct
    method Register (line 19) | func (l *HadeCacheProvider) Register(c framework.Container) framework....
    method Boot (line 43) | func (l *HadeCacheProvider) Boot(c framework.Container) error {
    method IsDefer (line 48) | func (l *HadeCacheProvider) IsDefer() bool {
    method Params (line 53) | func (l *HadeCacheProvider) Params(c framework.Container) []interface{} {
    method Name (line 58) | func (l *HadeCacheProvider) Name() string {

FILE: framework/provider/cache/services/cache.go
  constant NoneDuration (line 9) | NoneDuration = time.Duration(-1)

FILE: framework/provider/cache/services/memory.go
  type MemoryData (line 14) | type MemoryData struct
  type MemoryCache (line 20) | type MemoryCache struct
    method Get (line 36) | func (m *MemoryCache) Get(ctx context.Context, key string) (string, er...
    method GetObj (line 44) | func (m *MemoryCache) GetObj(ctx context.Context, key string, obj inte...
    method GetMany (line 67) | func (m *MemoryCache) GetMany(ctx context.Context, keys []string) (map...
    method Set (line 84) | func (m *MemoryCache) Set(ctx context.Context, key string, val string,...
    method SetObj (line 88) | func (m *MemoryCache) SetObj(ctx context.Context, key string, val inte...
    method SetMany (line 101) | func (m *MemoryCache) SetMany(ctx context.Context, data map[string]str...
    method SetForever (line 115) | func (m *MemoryCache) SetForever(ctx context.Context, key string, val ...
    method SetForeverObj (line 119) | func (m *MemoryCache) SetForeverObj(ctx context.Context, key string, v...
    method Remember (line 123) | func (m *MemoryCache) Remember(ctx context.Context, key string, timeou...
    method SetTTL (line 149) | func (m *MemoryCache) SetTTL(ctx context.Context, key string, timeout ...
    method GetTTL (line 160) | func (m *MemoryCache) GetTTL(ctx context.Context, key string) (time.Du...
    method Calc (line 170) | func (m *MemoryCache) Calc(ctx context.Context, key string, step int64...
    method Increment (line 195) | func (m *MemoryCache) Increment(ctx context.Context, key string) (int6...
    method Decrement (line 199) | func (m *MemoryCache) Decrement(ctx context.Context, key string) (int6...
    method Del (line 203) | func (m *MemoryCache) Del(ctx context.Context, key string) error {
    method DelMany (line 210) | func (m *MemoryCache) DelMany(ctx context.Context, keys []string) error {
  function NewMemoryCache (line 26) | func NewMemoryCache(params ...interface{}) (interface{}, error) {

FILE: framework/provider/cache/services/memory_test.go
  function TestHadeMemoryService_Load (line 14) | func TestHadeMemoryService_Load(t *testing.T) {

FILE: framework/provider/cache/services/redis.go
  type RedisCache (line 15) | type RedisCache struct
    method GetObj (line 48) | func (r *RedisCache) GetObj(ctx context.Context, key string, model int...
    method GetMany (line 62) | func (r *RedisCache) GetMany(ctx context.Context, keys []string) (map[...
    method Set (line 89) | func (r *RedisCache) Set(ctx context.Context, key string, val string, ...
    method SetObj (line 94) | func (r *RedisCache) SetObj(ctx context.Context, key string, val inter...
    method SetMany (line 99) | func (r *RedisCache) SetMany(ctx context.Context, data map[string]stri...
    method SetForever (line 110) | func (r *RedisCache) SetForever(ctx context.Context, key string, val s...
    method SetForeverObj (line 115) | func (r *RedisCache) SetForeverObj(ctx context.Context, key string, va...
    method SetTTL (line 120) | func (r *RedisCache) SetTTL(ctx context.Context, key string, timeout t...
    method GetTTL (line 125) | func (r *RedisCache) GetTTL(ctx context.Context, key string) (time.Dur...
    method Remember (line 129) | func (r *RedisCache) Remember(ctx context.Context, key string, timeout...
    method Calc (line 154) | func (r *RedisCache) Calc(ctx context.Context, key string, step int64)...
    method Increment (line 158) | func (r *RedisCache) Increment(ctx context.Context, key string) (int64...
    method Decrement (line 162) | func (r *RedisCache) Decrement(ctx context.Context, key string) (int64...
    method Del (line 166) | func (r *RedisCache) Del(ctx context.Context, key string) error {
    method DelMany (line 170) | func (r *RedisCache) DelMany(ctx context.Context, keys []string) error {
  function NewRedisCache (line 22) | func NewRedisCache(params ...interface{}) (interface{}, error) {

FILE: framework/provider/cache/services/redis_test.go
  type Bar (line 15) | type Bar struct
    method MarshalBinary (line 19) | func (b *Bar) MarshalBinary() ([]byte, error) {
    method UnmarshalBinary (line 23) | func (b *Bar) UnmarshalBinary(bt []byte) error {
  function TestHadeRedisService_Load (line 27) | func TestHadeRedisService_Load(t *testing.T) {

FILE: framework/provider/config/fake_provider.go
  type FakeConfigProvider (line 8) | type FakeConfigProvider struct
    method Register (line 14) | func (provider *FakeConfigProvider) Register(c framework.Container) fr...
    method Boot (line 19) | func (provider *FakeConfigProvider) Boot(c framework.Container) error {
    method IsDefer (line 24) | func (provider *FakeConfigProvider) IsDefer() bool {
    method Params (line 29) | func (provider *FakeConfigProvider) Params(c framework.Container) []in...
    method Name (line 34) | func (provider *FakeConfigProvider) Name() string {

FILE: framework/provider/config/fake_service.go
  type FakeConfig (line 12) | type FakeConfig struct
    method find (line 28) | func (conf *FakeConfig) find(key string) interface{} {
    method IsExist (line 33) | func (conf *FakeConfig) IsExist(key string) bool {
    method Get (line 38) | func (conf *FakeConfig) Get(key string) interface{} {
    method GetBool (line 43) | func (conf *FakeConfig) GetBool(key string) bool {
    method GetInt (line 48) | func (conf *FakeConfig) GetInt(key string) int {
    method GetFloat64 (line 53) | func (conf *FakeConfig) GetFloat64(key string) float64 {
    method GetTime (line 58) | func (conf *FakeConfig) GetTime(key string) time.Time {
    method GetString (line 63) | func (conf *FakeConfig) GetString(key string) string {
    method GetIntSlice (line 68) | func (conf *FakeConfig) GetIntSlice(key string) []int {
    method GetStringSlice (line 73) | func (conf *FakeConfig) GetStringSlice(key string) []string {
    method GetStringMap (line 78) | func (conf *FakeConfig) GetStringMap(key string) map[string]interface{} {
    method GetStringMapString (line 83) | func (conf *FakeConfig) GetStringMapString(key string) map[string]stri...
    method GetStringMapStringSlice (line 88) | func (conf *FakeConfig) GetStringMapStringSlice(key string) map[string...
    method Load (line 93) | func (conf *FakeConfig) Load(key string, val interface{}) error {
  function NewFakeConfig (line 16) | func NewFakeConfig(params ...interface{}) (interface{}, error) {

FILE: framework/provider/config/provider.go
  type HadeConfigProvider (line 9) | type HadeConfigProvider struct
    method Register (line 12) | func (provider *HadeConfigProvider) Register(c framework.Container) fr...
    method Boot (line 17) | func (provider *HadeConfigProvider) Boot(c framework.Container) error {
    method IsDefer (line 22) | func (provider *HadeConfigProvider) IsDefer() bool {
    method Params (line 27) | func (provider *HadeConfigProvider) Params(c framework.Container) []in...
    method Name (line 38) | func (provider *HadeConfigProvider) Name() string {

FILE: framework/provider/config/provider_test.go
  function TestHadeConfig_Normal (line 15) | func TestHadeConfig_Normal(t *testing.T) {

FILE: framework/provider/config/service.go
  type HadeConfig (line 25) | type HadeConfig struct
    method loadConfigFile (line 36) | func (conf *HadeConfig) loadConfigFile(folder string, file string) err...
    method removeConfigFile (line 72) | func (conf *HadeConfig) removeConfigFile(folder string, file string) e...
    method find (line 224) | func (conf *HadeConfig) find(key string) interface{} {
    method IsExist (line 231) | func (conf *HadeConfig) IsExist(key string) bool {
    method Get (line 236) | func (conf *HadeConfig) Get(key string) interface{} {
    method GetBool (line 241) | func (conf *HadeConfig) GetBool(key string) bool {
    method GetInt (line 246) | func (conf *HadeConfig) GetInt(key string) int {
    method GetFloat64 (line 251) | func (conf *HadeConfig) GetFloat64(key string) float64 {
    method GetTime (line 256) | func (conf *HadeConfig) GetTime(key string) time.Time {
    method GetString (line 261) | func (conf *HadeConfig) GetString(key string) string {
    method GetIntSlice (line 266) | func (conf *HadeConfig) GetIntSlice(key string) []int {
    method GetStringSlice (line 271) | func (conf *HadeConfig) GetStringSlice(key string) []string {
    method GetStringMap (line 276) | func (conf *HadeConfig) GetStringMap(key string) map[string]interface{} {
    method GetStringMapString (line 281) | func (conf *HadeConfig) GetStringMapString(key string) map[string]stri...
    method GetStringMapStringSlice (line 286) | func (conf *HadeConfig) GetStringMapStringSlice(key string) map[string...
    method Load (line 291) | func (conf *HadeConfig) Load(key string, val interface{}) error {
  function NewHadeConfig (line 87) | func NewHadeConfig(params ...interface{}) (interface{}, error) {
  function replace (line 179) | func replace(content []byte, maps map[string]string) []byte {
  function searchMap (line 194) | func searchMap(source map[string]interface{}, path []string) interface{} {

FILE: framework/provider/config/service_test.go
  function TestHadeConfig_GetInt (line 13) | func TestHadeConfig_GetInt(t *testing.T) {

FILE: framework/provider/distributed/provider_local.go
  type LocalDistributedProvider (line 9) | type LocalDistributedProvider struct
    method Register (line 13) | func (h *LocalDistributedProvider) Register(container framework.Contai...
    method Boot (line 18) | func (h *LocalDistributedProvider) Boot(container framework.Container)...
    method IsDefer (line 23) | func (h *LocalDistributedProvider) IsDefer() bool {
    method Params (line 28) | func (h *LocalDistributedProvider) Params(container framework.Containe...
    method Name (line 33) | func (h *LocalDistributedProvider) Name() string {

FILE: framework/provider/distributed/service_local.go
  type LocalDistributedService (line 15) | type LocalDistributedService struct
    method Select (line 31) | func (s LocalDistributedService) Select(serviceName string, appID stri...
  function NewLocalDistributedService (line 20) | func NewLocalDistributedService(params ...interface{}) (interface{}, err...

FILE: framework/provider/env/provider.go
  type HadeEnvProvider (line 8) | type HadeEnvProvider struct
    method Register (line 13) | func (provider *HadeEnvProvider) Register(c framework.Container) frame...
    method Boot (line 18) | func (provider *HadeEnvProvider) Boot(c framework.Container) error {
    method IsDefer (line 25) | func (provider *HadeEnvProvider) IsDefer() bool {
    method Params (line 30) | func (provider *HadeEnvProvider) Params(c framework.Container) []inter...
    method Name (line 35) | func (provider *HadeEnvProvider) Name() string {

FILE: framework/provider/env/service.go
  type HadeEnv (line 16) | type HadeEnv struct
    method AppEnv (line 83) | func (en *HadeEnv) AppEnv() string {
    method IsExist (line 88) | func (en *HadeEnv) IsExist(key string) bool {
    method Get (line 94) | func (en *HadeEnv) Get(key string) string {
    method All (line 102) | func (en *HadeEnv) All() map[string]string {
  function NewHadeEnv (line 24) | func NewHadeEnv(params ...interface{}) (interface{}, error) {

FILE: framework/provider/env/testing_provider.go
  type HadeTestingEnvProvider (line 8) | type HadeTestingEnvProvider struct
    method Register (line 13) | func (provider *HadeTestingEnvProvider) Register(c framework.Container...
    method Boot (line 18) | func (provider *HadeTestingEnvProvider) Boot(c framework.Container) er...
    method IsDefer (line 23) | func (provider *HadeTestingEnvProvider) IsDefer() bool {
    method Params (line 28) | func (provider *HadeTestingEnvProvider) Params(c framework.Container) ...
    method Name (line 33) | func (provider *HadeTestingEnvProvider) Name() string {

FILE: framework/provider/env/testing_service.go
  type HadeTestingEnv (line 4) | type HadeTestingEnv struct
    method AppEnv (line 19) | func (en *HadeTestingEnv) AppEnv() string {
    method IsExist (line 24) | func (en *HadeTestingEnv) IsExist(key string) bool {
    method Get (line 30) | func (en *HadeTestingEnv) Get(key string) string {
    method All (line 38) | func (en *HadeTestingEnv) All() map[string]string {
  function NewHadeTestingEnv (line 12) | func NewHadeTestingEnv(params ...interface{}) (interface{}, error) {

FILE: framework/provider/id/provider.go
  type HadeIDProvider (line 8) | type HadeIDProvider struct
    method Register (line 12) | func (provider *HadeIDProvider) Register(c framework.Container) framew...
    method Boot (line 17) | func (provider *HadeIDProvider) Boot(c framework.Container) error {
    method IsDefer (line 22) | func (provider *HadeIDProvider) IsDefer() bool {
    method Params (line 27) | func (provider *HadeIDProvider) Params(c framework.Container) []interf...
    method Name (line 32) | func (provider *HadeIDProvider) Name() string {

FILE: framework/provider/id/provier_test.go
  function TestConsoleLog_Normal (line 12) | func TestConsoleLog_Normal(t *testing.T) {

FILE: framework/provider/id/service.go
  type HadeIDService (line 7) | type HadeIDService struct
    method NewID (line 14) | func (s *HadeIDService) NewID() string {
  function NewHadeIDService (line 10) | func NewHadeIDService(params ...interface{}) (interface{}, error) {

FILE: framework/provider/kernel/provider.go
  type HadeKernelProvider (line 10) | type HadeKernelProvider struct
    method Register (line 15) | func (provider *HadeKernelProvider) Register(c framework.Container) fr...
    method Boot (line 20) | func (provider *HadeKernelProvider) Boot(c framework.Container) error {
    method IsDefer (line 29) | func (provider *HadeKernelProvider) IsDefer() bool {
    method Params (line 34) | func (provider *HadeKernelProvider) Params(c framework.Container) []in...
    method Name (line 39) | func (provider *HadeKernelProvider) Name() string {

FILE: framework/provider/kernel/service.go
  type HadeKernelService (line 9) | type HadeKernelService struct
    method HttpEngine (line 20) | func (s *HadeKernelService) HttpEngine() http.Handler {
  function NewHadeKernelService (line 14) | func NewHadeKernelService(params ...interface{}) (interface{}, error) {

FILE: framework/provider/log/formatter/json.go
  function JsonFormatter (line 13) | func JsonFormatter(level contract.LogLevel, t time.Time, msg string, fie...

FILE: framework/provider/log/formatter/prefix.go
  function Prefix (line 5) | func Prefix(level contract.LogLevel) string {

FILE: framework/provider/log/formatter/text.go
  function TextFormatter (line 12) | func TextFormatter(level contract.LogLevel, t time.Time, msg string, fie...

FILE: framework/provider/log/provider.go
  type HadeLogServiceProvider (line 14) | type HadeLogServiceProvider struct
    method Register (line 30) | func (l *HadeLogServiceProvider) Register(c framework.Container) frame...
    method Boot (line 58) | func (l *HadeLogServiceProvider) Boot(c framework.Container) error {
    method IsDefer (line 63) | func (l *HadeLogServiceProvider) IsDefer() bool {
    method Params (line 68) | func (l *HadeLogServiceProvider) Params(c framework.Container) []inter...
    method Name (line 97) | func (l *HadeLogServiceProvider) Name() string {
  function logLevel (line 102) | func logLevel(config string) contract.LogLevel {

FILE: framework/provider/log/services/console.go
  type HadeConsoleLog (line 11) | type HadeConsoleLog struct
  function NewHadeConsoleLog (line 16) | func NewHadeConsoleLog(params ...interface{}) (interface{}, error) {

FILE: framework/provider/log/services/custom.go
  type HadeCustomLog (line 9) | type HadeCustomLog struct
  function NewHadeCustomLog (line 13) | func NewHadeCustomLog(params ...interface{}) (interface{}, error) {

FILE: framework/provider/log/services/log.go
  type HadeLog (line 15) | type HadeLog struct
    method IsLevelEnable (line 25) | func (log *HadeLog) IsLevelEnable(level contract.LogLevel) bool {
    method logf (line 30) | func (log *HadeLog) logf(level contract.LogLevel, ctx context.Context,...
    method SetOutput (line 81) | func (log *HadeLog) SetOutput(output io.Writer) {
    method Panic (line 86) | func (log *HadeLog) Panic(ctx context.Context, msg string, fields map[...
    method Fatal (line 91) | func (log *HadeLog) Fatal(ctx context.Context, msg string, fields map[...
    method Error (line 96) | func (log *HadeLog) Error(ctx context.Context, msg string, fields map[...
    method Warn (line 101) | func (log *HadeLog) Warn(ctx context.Context, msg string, fields map[s...
    method Info (line 106) | func (log *HadeLog) Info(ctx context.Context, msg string, fields map[s...
    method Debug (line 111) | func (log *HadeLog) Debug(ctx context.Context, msg string, fields map[...
    method Trace (line 116) | func (log *HadeLog) Trace(ctx context.Context, msg string, fields map[...
    method SetLevel (line 121) | func (log *HadeLog) SetLevel(level contract.LogLevel) {
    method SetCtxFielder (line 126) | func (log *HadeLog) SetCtxFielder(handler contract.CtxFielder) {
    method SetFormatter (line 131) | func (log *HadeLog) SetFormatter(formatter contract.Formatter) {

FILE: framework/provider/log/services/rotate.go
  type HadeRotateLog (line 18) | type HadeRotateLog struct
  function NewHadeRotateLog (line 28) | func NewHadeRotateLog(params ...interface{}) (interface{}, error) {

FILE: framework/provider/log/services/single.go
  type HadeSingleLog (line 14) | type HadeSingleLog struct
  function NewHadeSingleLog (line 23) | func NewHadeSingleLog(params ...interface{}) (interface{}, error) {

FILE: framework/provider/orm/config.go
  function GetBaseConfig (line 11) | func GetBaseConfig(c framework.Container) *contract.DBConfig {
  function WithConfigPath (line 26) | func WithConfigPath(configPath string) contract.DBOption {
  function WithGormConfig (line 38) | func WithGormConfig(gormConfig *gorm.Config) contract.DBOption {
  function WithDryRun (line 49) | func WithDryRun() contract.DBOption {
  function WithFullSaveAssociations (line 57) | func WithFullSaveAssociations() contract.DBOption {

FILE: framework/provider/orm/config_test.go
  function TestHadeConfig_Load (line 11) | func TestHadeConfig_Load(t *testing.T) {

FILE: framework/provider/orm/logger.go
  type OrmLogger (line 11) | type OrmLogger struct
    method LogMode (line 21) | func (o *OrmLogger) LogMode(level logger.LogLevel) logger.Interface {
    method Info (line 26) | func (o *OrmLogger) Info(ctx context.Context, s string, i ...interface...
    method Warn (line 34) | func (o *OrmLogger) Warn(ctx context.Context, s string, i ...interface...
    method Error (line 42) | func (o *OrmLogger) Error(ctx context.Context, s string, i ...interfac...
    method Trace (line 50) | func (o *OrmLogger) Trace(ctx context.Context, begin time.Time, fc fun...
  function NewOrmLogger (line 16) | func NewOrmLogger(logger contract.Log) *OrmLogger {

FILE: framework/provider/orm/provider.go
  type GormProvider (line 9) | type GormProvider struct
    method Register (line 13) | func (h *GormProvider) Register(container framework.Container) framewo...
    method Boot (line 18) | func (h *GormProvider) Boot(container framework.Container) error {
    method IsDefer (line 23) | func (h *GormProvider) IsDefer() bool {
    method Params (line 28) | func (h *GormProvider) Params(container framework.Container) []interfa...
    method Name (line 33) | func (h *GormProvider) Name() string {

FILE: framework/provider/orm/service.go
  type HadeGorm (line 18) | type HadeGorm struct
    method GetDB (line 38) | func (app *HadeGorm) GetDB(option ...contract.DBOption) (*gorm.DB, err...
  function NewHadeGorm (line 26) | func NewHadeGorm(params ...interface{}) (interface{}, error) {

FILE: framework/provider/redis/config.go
  function GetBaseConfig (line 13) | func GetBaseConfig(c framework.Container) *contract.RedisConfig {
  function WithConfigPath (line 27) | func WithConfigPath(configPath string) contract.RedisOption {
  function WithRedisConfig (line 130) | func WithRedisConfig(f func(options *contract.RedisConfig)) contract.Red...

FILE: framework/provider/redis/provider.go
  type RedisProvider (line 9) | type RedisProvider struct
    method Register (line 13) | func (h *RedisProvider) Register(container framework.Container) framew...
    method Boot (line 18) | func (h *RedisProvider) Boot(container framework.Container) error {
    method IsDefer (line 23) | func (h *RedisProvider) IsDefer() bool {
    method Params (line 28) | func (h *RedisProvider) Params(container framework.Container) []interf...
    method Name (line 33) | func (h *RedisProvider) Name() string {

FILE: framework/provider/redis/service.go
  type HadeRedis (line 11) | type HadeRedis struct
    method GetClient (line 31) | func (app *HadeRedis) GetClient(option ...contract.RedisOption) (*redi...
  function NewHadeRedis (line 19) | func NewHadeRedis(params ...interface{}) (interface{}, error) {

FILE: framework/provider/redis/service_test.go
  function TestHadeService_Load (line 13) | func TestHadeService_Load(t *testing.T) {

FILE: framework/provider/ssh/config.go
  function GetBaseConfig (line 14) | func GetBaseConfig(c framework.Container) *contract.SSHConfig {
  function WithConfigPath (line 30) | func WithConfigPath(configPath string) contract.SSHOption {
  function WithSSHConfig (line 112) | func WithSSHConfig(f func(options *contract.SSHConfig)) contract.SSHOpti...

FILE: framework/provider/ssh/provider.go
  type SSHProvider (line 9) | type SSHProvider struct
    method Register (line 13) | func (h *SSHProvider) Register(container framework.Container) framewor...
    method Boot (line 18) | func (h *SSHProvider) Boot(container framework.Container) error {
    method IsDefer (line 23) | func (h *SSHProvider) IsDefer() bool {
    method Params (line 28) | func (h *SSHPr
Copy disabled (too large) Download .json
Condensed preview — 412 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (34,905K chars).
[
  {
    "path": ".babelrc",
    "chars": 402,
    "preview": "{\n  \"presets\": [\n    [\"env\", {\n      \"modules\": false,\n      \"targets\": {\n        \"browsers\": [\"> 1%\", \"last 2 versions\""
  },
  {
    "path": ".editorconfig",
    "chars": 147,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 4\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
  },
  {
    "path": ".eslintignore",
    "chars": 51,
    "preview": "/build/\n/config/\n/dist/\n/*.js\n/test/unit/coverage/\n"
  },
  {
    "path": ".eslintrc.js",
    "chars": 828,
    "preview": "// https://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n  root: true,\n  parserOptions: {\n    parser: 'babe"
  },
  {
    "path": ".gitignore",
    "chars": 235,
    "preview": ".DS_Store\nnode_modules/\n/dist/\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n/test/unit/coverage/\n/test/e2e/reports/\nse"
  },
  {
    "path": ".postcssrc.js",
    "chars": 246,
    "preview": "// https://github.com/michael-ciniawsky/postcss-load-config\n\nmodule.exports = {\n  \"plugins\": {\n    \"postcss-import\": {},"
  },
  {
    "path": "LICENSE",
    "chars": 1076,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2021 jianfengye\n\nPermission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "README.md",
    "chars": 611,
    "preview": "# 官方网站\n\nhttp://hade.funaio.cn/\n\n# 框架特色:\n\n## 基于协议\n\n服务与服务间的协议是基于协议进行交互的。\n\n## 前后端协同\n\n前后端协同开发\n\n## 命令行\n\n有充分的命令行工具\n\n## 集成定时服务\n"
  },
  {
    "path": "app/console/command/foo/foo.go",
    "chars": 274,
    "preview": "package foo\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gohade/hade/framework/cobra\"\n)\n\nvar FooCommand = &cobra.Command{\n\tUse:   \"foo"
  },
  {
    "path": "app/console/kernel.go",
    "chars": 1388,
    "preview": "package console\n\nimport (\n    \"github.com/gohade/hade/app/console/command/foo\"\n    \"github.com/gohade/hade/framework\"\n  "
  },
  {
    "path": "app/http/kernel.go",
    "chars": 448,
    "preview": "package http\n\nimport (\n\t\"github.com/gohade/hade/framework\"\n\t\"github.com/gohade/hade/framework/gin\"\n)\n\n// NewHttpEngine 创"
  },
  {
    "path": "app/http/middleware/.gitkeeper",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "app/http/middleware/cors/.github/workflows/go.yml",
    "chars": 1660,
    "preview": "name: Run Tests\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\njobs:\n  lint:\n  "
  },
  {
    "path": "app/http/middleware/cors/.gitignore",
    "chars": 160,
    "preview": "*.o\n*.a\n*.so\n\n_obj\n_test\n\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmai"
  },
  {
    "path": "app/http/middleware/cors/LICENSE",
    "chars": 1066,
    "preview": "MIT License\n\nCopyright (c) 2016 Gin-Gonic\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
  },
  {
    "path": "app/http/middleware/cors/README.md",
    "chars": 2253,
    "preview": "# CORS gin's middleware\n\n[![Run Tests](https://github.com/gin-contrib/cors/actions/workflows/go.yml/badge.svg)](https://"
  },
  {
    "path": "app/http/middleware/cors/config.go",
    "chars": 2960,
    "preview": "package cors\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/gohade/hade/framework/gin\"\n)\n\ntype cors struct {\n\tallowAllOr"
  },
  {
    "path": "app/http/middleware/cors/cors.go",
    "chars": 4889,
    "preview": "package cors\n\nimport (\n\t\"errors\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/gohade/hade/framework/gin\"\n)\n\n// Config represents all"
  },
  {
    "path": "app/http/middleware/cors/cors_test.go",
    "chars": 14650,
    "preview": "package cors\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gohade/hade/framewor"
  },
  {
    "path": "app/http/middleware/cors/examples/example.go",
    "chars": 715,
    "preview": "package main\n\nimport (\n\t\"time\"\n\n\t\"github.com/gin-contrib/cors\"\n\t\"github.com/gohade/hade/framework/gin\"\n)\n\nfunc main() {\n"
  },
  {
    "path": "app/http/middleware/cors/utils.go",
    "chars": 2308,
    "preview": "package cors\n\nimport (\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype converter func(string) string\n\nfunc generateNor"
  },
  {
    "path": "app/http/module/demo/api.go",
    "chars": 1363,
    "preview": "package demo\n\nimport (\n\tdemoService \"github.com/gohade/hade/app/provider/demo\"\n\t\"github.com/gohade/hade/framework/gin\"\n)"
  },
  {
    "path": "app/http/module/demo/api_cache.go",
    "chars": 1658,
    "preview": "package demo\n\nimport (\n\t\"github.com/gohade/hade/framework/contract\"\n\t\"github.com/gohade/hade/framework/gin\"\n\t\"github.com"
  },
  {
    "path": "app/http/module/demo/api_orm.go",
    "chars": 1952,
    "preview": "package demo\n\nimport (\n    \"database/sql\"\n    \"github.com/gohade/hade/framework/contract\"\n    \"github.com/gohade/hade/fr"
  },
  {
    "path": "app/http/module/demo/dto.go",
    "chars": 90,
    "preview": "package demo\n\ntype UserDTO struct {\n\tID   int    `json:\"id\"`\n\tName string `json:\"name\"`\n}\n"
  },
  {
    "path": "app/http/module/demo/mapper.go",
    "chars": 525,
    "preview": "package demo\n\nimport (\n\tdemoService \"github.com/gohade/hade/app/provider/demo\"\n)\n\nfunc UserModelsToUserDTOs(models []Use"
  },
  {
    "path": "app/http/module/demo/model.go",
    "chars": 370,
    "preview": "package demo\n\nimport (\n\t\"database/sql\"\n\t\"time\"\n)\n\ntype UserModel struct {\n\tUserId int\n\tName   string\n\tAge    int\n}\n\n// U"
  },
  {
    "path": "app/http/module/demo/repository.go",
    "chars": 360,
    "preview": "package demo\n\ntype Repository struct {\n}\n\nfunc NewRepository() *Repository {\n\treturn &Repository{}\n}\n\nfunc (r *Repositor"
  },
  {
    "path": "app/http/module/demo/service.go",
    "chars": 291,
    "preview": "package demo\n\ntype Service struct {\n\trepository *Repository\n}\n\nfunc NewService() *Service {\n\trepository := NewRepository"
  },
  {
    "path": "app/http/route.go",
    "chars": 887,
    "preview": "package http\n\nimport (\n\t\"github.com/gohade/hade/app/http/middleware/cors\"\n\t\"github.com/gohade/hade/app/http/module/demo\""
  },
  {
    "path": "app/http/swagger/docs.go",
    "chars": 4133,
    "preview": "// Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n// This file was generated by swaggo/swag\npackage swagger"
  },
  {
    "path": "app/http/swagger/swagger.json",
    "chars": 2603,
    "preview": "{\n    \"swagger\": \"2.0\",\n    \"info\": {\n        \"description\": \"hade测试\",\n        \"title\": \"hade\",\n        \"termsOfService\""
  },
  {
    "path": "app/http/swagger/swagger.yaml",
    "chars": 1254,
    "preview": "basePath: /\ndefinitions:\n  demo.UserDTO:\n    properties:\n      id:\n        type: integer\n      name:\n        type: strin"
  },
  {
    "path": "app/http/swagger.go",
    "chars": 585,
    "preview": "// Package http API.\n// @title hade\n// @version 1.1\n// @description hade测试\n// @termsOfService https://github.com/swaggo/"
  },
  {
    "path": "app/provider/demo/contract.go",
    "chars": 141,
    "preview": "package demo\n\nconst DemoKey = \"demo\"\n\ntype IService interface {\n\tGetAllStudent() []Student\n}\n\ntype Student struct {\n\tID "
  },
  {
    "path": "app/provider/demo/provider.go",
    "chars": 547,
    "preview": "package demo\n\nimport (\n\t\"github.com/gohade/hade/framework\"\n)\n\ntype DemoProvider struct {\n\tframework.ServiceProvider\n\n\tc "
  },
  {
    "path": "app/provider/demo/service.go",
    "chars": 412,
    "preview": "package demo\n\nimport \"github.com/gohade/hade/framework\"\n\ntype Service struct {\n\tcontainer framework.Container\n}\n\nfunc Ne"
  },
  {
    "path": "app/provider/user/contract.go",
    "chars": 97,
    "preview": "package user\n\nconst UserKey = \"user\"\n\ntype Service interface {\n\t// 请在这里定义你的方法\n    Foo() string\n}\n"
  },
  {
    "path": "app/provider/user/provider.go",
    "chars": 539,
    "preview": "package user\n\nimport (\n\t\"github.com/gohade/hade/framework\"\n)\n\ntype UserProvider struct {\n\tframework.ServiceProvider\n\n\tc "
  },
  {
    "path": "app/provider/user/service.go",
    "chars": 333,
    "preview": "package user\n\nimport \"github.com/gohade/hade/framework\"\n\ntype UserService struct {\n\tcontainer framework.Container\n}\n\nfun"
  },
  {
    "path": "build/build.js",
    "chars": 1198,
    "preview": "'use strict'\nrequire('./check-versions')()\n\nprocess.env.NODE_ENV = 'production'\n\nconst ora = require('ora')\nconst rm = r"
  },
  {
    "path": "build/check-versions.js",
    "chars": 1290,
    "preview": "'use strict'\nconst chalk = require('chalk')\nconst semver = require('semver')\nconst packageConfig = require('../package.j"
  },
  {
    "path": "build/utils.js",
    "chars": 2587,
    "preview": "'use strict'\nconst path = require('path')\nconst config = require('../config')\nconst ExtractTextPlugin = require('extract"
  },
  {
    "path": "build/vue-loader.conf.js",
    "chars": 553,
    "preview": "'use strict'\nconst utils = require('./utils')\nconst config = require('../config')\nconst isProduction = process.env.NODE_"
  },
  {
    "path": "build/webpack.base.conf.js",
    "chars": 2385,
    "preview": "'use strict'\nconst path = require('path')\nconst utils = require('./utils')\nconst config = require('../config')\nconst vue"
  },
  {
    "path": "build/webpack.dev.conf.js",
    "chars": 3004,
    "preview": "'use strict'\nconst utils = require('./utils')\nconst webpack = require('webpack')\nconst config = require('../config')\ncon"
  },
  {
    "path": "build/webpack.prod.conf.js",
    "chars": 5196,
    "preview": "'use strict'\nconst path = require('path')\nconst utils = require('./utils')\nconst webpack = require('webpack')\nconst conf"
  },
  {
    "path": "config/dev.env.js",
    "chars": 156,
    "preview": "'use strict'\nconst merge = require('webpack-merge')\nconst prodEnv = require('./prod.env')\n\nmodule.exports = merge(prodEn"
  },
  {
    "path": "config/development/app.yaml",
    "chars": 419,
    "preview": "swagger: true\n\npath:\n#  log_folder: \"/home/jianfengye/hade/log/\"\n#  runtime_folder: \"/home/jianfengye/hade/runtime/\"\n\nde"
  },
  {
    "path": "config/development/database.yaml",
    "chars": 591,
    "preview": "conn_max_idle: 10 # 通用配置,连接池最大空闲连接数\nconn_max_open: 100 # 通用配置,连接池最大连接数\nconn_max_lifetime: 1h # 通用配置,连接数最大生命周期\nprotocol: "
  },
  {
    "path": "config/development/deploy.yaml",
    "chars": 483,
    "preview": "connections: # 要自动化部署的连接\n    - ssh.web-01\n\nremote_folder: \"/home/yejianfeng/coredemo/\"  # 远端的部署文件夹\n\nfrontend: # 前端部署配置\n "
  },
  {
    "path": "config/development/log.yaml",
    "chars": 319,
    "preview": "#driver: console\n#formatter: text\n#level: trace\n\n#driver: single\n#level: trace\n#folder: /tmp/\n#file: coredemo.log\n\ndrive"
  },
  {
    "path": "config/development/ssh.yaml",
    "chars": 487,
    "preview": "timeout: 3s\nnetwork: tcp\nweb-01:\n    host: 111.222.333.444 # ip地址\n    port: 22 # 端口\n    username: yejianfeng # 用户名\n    p"
  },
  {
    "path": "config/index.js",
    "chars": 2291,
    "preview": "'use strict'\n// Template version: 1.3.1\n// see http://vuejs-templates.github.io/webpack for documentation.\n\nconst path ="
  },
  {
    "path": "config/prod.env.js",
    "chars": 61,
    "preview": "'use strict'\nmodule.exports = {\n  NODE_ENV: '\"production\"'\n}\n"
  },
  {
    "path": "config/production/.gitkeeper",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "config/production/app.yaml",
    "chars": 140,
    "preview": "url: http://127.0.0.1:8066\n\nswagger_open: true\n\ndev_fresh: 1\n\npath:\n  storage: \"/hade_sts/testdata/storage/\"\n  log: \"\"\n "
  },
  {
    "path": "config/production/database.yaml",
    "chars": 289,
    "preview": "mysql:\n    hostname: 127.0.0.1\n    username: yejianfeng\n    password:  env(DB_PASSWORD)\n    timeout: 1\n    readtime: 2.3"
  },
  {
    "path": "config/production/deploy.yaml",
    "chars": 183,
    "preview": "host: 127.0.0.1\nuser: yejianfeng\npassword: 123abc \nrsa_key: \ntimeout: 1000\nremote_path: \"/home/yejianfeng/\"\npost_shell: "
  },
  {
    "path": "config/production/gift.yaml",
    "chars": 56,
    "preview": "endpoint: \"\"\naccess_key: \"\"\nsecret_key: \"\"\nuse_ssl: true"
  },
  {
    "path": "config/production/log.yaml",
    "chars": 29,
    "preview": "driver: console \nlevel: trace"
  },
  {
    "path": "config/production/swagger.yaml",
    "chars": 26,
    "preview": "url: http://127.0.0.1:8069"
  },
  {
    "path": "config/test.env.js",
    "chars": 149,
    "preview": "'use strict'\nconst merge = require('webpack-merge')\nconst devEnv = require('./dev.env')\n\nmodule.exports = merge(devEnv, "
  },
  {
    "path": "config/testing/app.yaml",
    "chars": 419,
    "preview": "swagger: true\n\npath:\n#  log_folder: \"/home/jianfengye/hade/log/\"\n#  runtime_folder: \"/home/jianfengye/hade/runtime/\"\n\nde"
  },
  {
    "path": "config/testing/cache.yaml",
    "chars": 161,
    "preview": "driver: redis # 连接驱动\nhost: 127.0.0.1 # ip地址\nport: 6379 # 端口\ndb: 0 #db\ntimeout: 10s # 连接超时\nread_timeout: 2s # 读超时\nwrite_t"
  },
  {
    "path": "config/testing/database.yaml",
    "chars": 974,
    "preview": "conn_max_idle: 10 # 通用配置,连接池最大空闲连接数\nconn_max_open: 100 # 通用配置,连接池最大连接数\nconn_max_lifetime: 1h # 通用配置,连接数最大生命周期\nprotocol: "
  },
  {
    "path": "config/testing/deploy.yaml",
    "chars": 287,
    "preview": "connections:\n    - ssh.web-01\n    - ssh.web-02\n\nremote_path: \"/home/jianfengye/hade\"\n\nfrontend:\n    pre_action:\n        "
  },
  {
    "path": "config/testing/log.yaml",
    "chars": 319,
    "preview": "#driver: console\n#formatter: text\n#level: trace\n\n#driver: single\n#level: trace\n#folder: /tmp/\n#file: coredemo.log\n\ndrive"
  },
  {
    "path": "config/testing/redis.yaml",
    "chars": 215,
    "preview": "timeout: 10s # 连接超时\nread_timeout: 2s # 读超时\nwrite_timeout: 2s # 写超时\n\nwrite:\n    host: 127.0.0.1 # ip地址\n    port: 6379 # 端"
  },
  {
    "path": "config/testing/ssh.yaml",
    "chars": 484,
    "preview": "timeout: 1s\nnetwork: tcp\nweb-01:\n    host: 118.190.3.55 # ip地址\n    port: 22 # 端口\n    username: yejianfeng # 用户名\n    pass"
  },
  {
    "path": "config/testing/swagger.yaml",
    "chars": 26,
    "preview": "url: http://127.0.0.1:8069"
  },
  {
    "path": "docs/.vuepress/config.js",
    "chars": 1821,
    "preview": "module.exports = {\n    title: \"hade框架\", // 设置网站标题\n    description: \"一个支持前后端开发的基于协议的框架\", //描述\n    dest: \"./dist/\", // 设置输"
  },
  {
    "path": "docs/.vuepress/enhanceApp.js",
    "chars": 34,
    "preview": "\nexport default ({ Vue }) => {\n};\n"
  },
  {
    "path": "docs/README.md",
    "chars": 427,
    "preview": "---\nhome: true\nactionText: 开始体验\nactionLink: /guide/introduce\nfooter: MIT Licensed | Copyright © 2020-present jianfengye\n"
  },
  {
    "path": "docs/guide/README.md",
    "chars": 92,
    "preview": "# 指南 \n\n---\n\nhade是一个注重协议,注重开发效率的前后端一体化框架。hade框架的目标在于将go+vue模型的应用开发最简化,并且提供统一,一体化的脚手架工具促进业务开发。"
  },
  {
    "path": "docs/guide/app.md",
    "chars": 1423,
    "preview": "# 运行\n\n## 命令\n\n这里的运行是运行整个 app,这个 app 可以只包含后端,也可以只包含前端,但是后端也是隐藏在前端后面运行。具体可以参考 app/http/route.go\n\n```\npackage http\n\nimport ("
  },
  {
    "path": "docs/guide/build.md",
    "chars": 1967,
    "preview": "# 编译\n\n---\n\n## 命令\n\n应用分为前端(frontend)和后端(backend),所以编译也分为三类\n- 编译前端 \n- 编译后端 \n- 自编译\n- 同时编译\n\n```\n[~/Documents/workspace/hade_w"
  },
  {
    "path": "docs/guide/command.md",
    "chars": 1941,
    "preview": "# 命令\n\n## 指南\n\nhade 允许自定义命令,挂载到 hade 上。并且提供了`./hade command` 系列命令。\n\n```\n[~/Documents/workspace/hade_workspace/demo5]$ ./ha"
  },
  {
    "path": "docs/guide/cron.md",
    "chars": 1290,
    "preview": "# 定时任务\n\n## 指南\n\nhade 中的定时任务是以命令的形式存在。hade 中也定义了一个命令 `./hade cron` 来对定时任务服务进行管理。\n\n```\nabout cron command\n\nUsage:\n  hade cr"
  },
  {
    "path": "docs/guide/dev.md",
    "chars": 2743,
    "preview": "# 调试模式\n\n## 命令\n\nhade 框架自带调试模式,不管是前端还是后端,都可以启动调试模式,边修改代码,边编译运行服务。\n\n对应的命令为 `./hade dev`\n\n```\n[~/Documents/workspace/hade_wo"
  },
  {
    "path": "docs/guide/env.md",
    "chars": 779,
    "preview": "# 环境变量\n\n## 设置\n\nhade 支持使用应用默认下的隐藏文件 `.env` 来配置各个机器不同的环境变量。\n\n```\nAPP_ENV=development\n\nDB_PASSWORD=mypassword\n```\n\n环境变量的设置可"
  },
  {
    "path": "docs/guide/install.md",
    "chars": 1395,
    "preview": "# 安装\n\n---\n## 可执行文件\n\n我们有两种方式来获取可执行的hade文件,第一种是直接下载对应操作系统的hade文件,另外一种是下载源码自己编译\n\n### 直接下载\n\n下载地址:\nxxx\n\n将生成的可执行文件 hade 放到 $PA"
  },
  {
    "path": "docs/guide/introduce.md",
    "chars": 261,
    "preview": "# 介绍\n\n---\n\nhade是一个注重协议,注重开发效率的前后端一体化框架。hade框架的目标在于将go+vue模型的应用开发最简化,并且提供统一,一体化的脚手架工具促进业务开发。\n\n我们相信在GO的框架开发中,指定协议比实现更为重要。h"
  },
  {
    "path": "docs/guide/middleware.md",
    "chars": 942,
    "preview": "# 中间件\n\n## 指南\nhade 的 HTTP 路由服务并没有自己开发,而是使用 gin。gin 生态已经有非常完善的(中间件体系)[https://github.com/gin-contrib]。\n\n我们没有必要重新开发这些中间件。所以"
  },
  {
    "path": "docs/guide/provider.md",
    "chars": 4858,
    "preview": "# 服务提供者\n\n## 指南\n\nhade框架使用ServiceProvider机制来满足协议,通过service Provder提供某个协议服务的具体实现。这样如果开发者对具体的实现协议的服务类的具体实现不满意,则可以很方便的通过切换具体协"
  },
  {
    "path": "docs/guide/structure.md",
    "chars": 4014,
    "preview": "# 目录结构\n\nhade 框架不仅仅是一个类库,也是一个定义了开发模式和目录结构的框架。 hade 希望所有使用这个框架的开发人员遵照统一的项目结构进行开发。\n\n## 默认目录结构\n默认创建的项目结构为:\n\n```\n[~/Documents"
  },
  {
    "path": "docs/guide/swagger.md",
    "chars": 2735,
    "preview": "# swagger\n\n## 命令\n\nhade 使用 [swaggo](https://github.com/swaggo/swag) 集成了 swagger 生成和服务项目。并且封装了 `./hade swagger` 命令。\n\n```\n["
  },
  {
    "path": "docs/guide/todo.md",
    "chars": 176,
    "preview": "# 待做事项\n---\n\nhade 框架目前还没有到完善地步,这里列一下计划后续做的工作,有兴趣的同学可以一起进行开发。\n\ngit 地址: https://hade\n\n- 增加traceid机制\n- 调试deploy命令\n- 增加module"
  },
  {
    "path": "docs/provider/README.md",
    "chars": 43,
    "preview": "# 服务提供者 \n\n---\n\n这里列出了 hade 框架自带的服务提供者接口和协议说明"
  },
  {
    "path": "docs/provider/app.md",
    "chars": 577,
    "preview": "# hade:app\n\n提供基础的 app 框架目录结构\n\n``` golang\npackage contract\n\n// AppKey is the key in container\nconst AppKey = \"hade:app\"\n\n"
  },
  {
    "path": "docs/provider/config.md",
    "chars": 1354,
    "preview": "# hade:config\n\n提供基础的配置文件获取方法\n\n``` golang\npackage contract\n\nimport \"time\"\n\nconst (\n\t// ConfigKey is config key in contain"
  },
  {
    "path": "docs/provider/env.md",
    "chars": 761,
    "preview": "# hade:env\n\n提供环境变量相关方法\n\n``` golang\npackage contract\n\nconst (\n\t// EnvProduction represent the environment which build for"
  },
  {
    "path": "docs/provider/log.md",
    "chars": 1195,
    "preview": "# hade:log\n\n提供日志记录相关操作\n\n``` golang\ntype Log interface {\n\t// Panic will call panic(fields) for debug\n\tPanic(ctx context.C"
  },
  {
    "path": "framework/cobra/.gitignore",
    "chars": 484,
    "preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
  },
  {
    "path": "framework/cobra/.golangci.yml",
    "chars": 720,
    "preview": "run:\n  deadline: 5m\n\nlinters:\n  disable-all: true\n  enable:\n    #- bodyclose\n    - deadcode\n    #- depguard\n    #- dogsl"
  },
  {
    "path": "framework/cobra/.mailmap",
    "chars": 171,
    "preview": "Steve Francia <steve.francia@gmail.com>\nBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>\nFabiano Franz <ffranz@redhat"
  },
  {
    "path": "framework/cobra/CHANGELOG.md",
    "chars": 2129,
    "preview": "# Cobra Changelog\n\n## v1.1.3\n\n* **Fix:** release-branch.cobra1.1 only: Revert \"Deprecate Go < 1.14\" to maintain backward"
  },
  {
    "path": "framework/cobra/CONDUCT.md",
    "chars": 3122,
    "preview": "## Cobra User Contract\n\n### Versioning\nCobra will follow a steady release cadence. Non breaking changes will be released"
  },
  {
    "path": "framework/cobra/CONTRIBUTING.md",
    "chars": 2097,
    "preview": "# Contributing to Cobra\n\nThank you so much for contributing to Cobra. We appreciate your time and help.\nHere are some gu"
  },
  {
    "path": "framework/cobra/LICENSE.txt",
    "chars": 10140,
    "preview": "                                Apache License\n                           Version 2.0, January 2004\n                    "
  },
  {
    "path": "framework/cobra/Makefile",
    "chars": 1077,
    "preview": "BIN=\"./bin\"\nSRC=$(shell find . -name \"*.go\")\n\nifeq (, $(shell which golangci-lint))\n$(warning \"could not find golangci-l"
  },
  {
    "path": "framework/cobra/README.md",
    "chars": 5155,
    "preview": "![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)\n\nCobr"
  },
  {
    "path": "framework/cobra/args.go",
    "chars": 3186,
    "preview": "package cobra\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype PositionalArgs func(cmd *Command, args []string) error\n\n// Legacy arg "
  },
  {
    "path": "framework/cobra/args_test.go",
    "chars": 6827,
    "preview": "package cobra\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNoArgs(t *testing.T) {\n\tc := &Command{Use: \"c\", Args: NoArgs, "
  },
  {
    "path": "framework/cobra/bash_completions.go",
    "chars": 21788,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/spf13/pflag\"\n)\n\n// Annotations for "
  },
  {
    "path": "framework/cobra/bash_completions.md",
    "chars": 3805,
    "preview": "# Generating Bash Completions For Your cobra.Command\n\nPlease refer to [Shell Completions](shell_completions.md) for deta"
  },
  {
    "path": "framework/cobra/bash_completionsV2.go",
    "chars": 9811,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc (c *Command) genBashCompletion(w io.Writer, includeDesc bool"
  },
  {
    "path": "framework/cobra/bash_completions_test.go",
    "chars": 9277,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc checkOmit(t *testing.T,"
  },
  {
    "path": "framework/cobra/cobra/Makefile",
    "chars": 392,
    "preview": "XC_OS=\"linux darwin\"\nXC_ARCH=\"amd64\"\nXC_PARALLEL=\"2\"\nBIN=\"../bin\"\nSRC=$(shell find . -name \"*.go\")\n\nifeq (, $(shell whic"
  },
  {
    "path": "framework/cobra/cobra/README.md",
    "chars": 3817,
    "preview": "# Cobra Generator\n\nCobra provides its own program that will create your application and add any\ncommands you want. It's "
  },
  {
    "path": "framework/cobra/cobra/cmd/add.go",
    "chars": 3457,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/add_test.go",
    "chars": 1100,
    "preview": "package cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestGoldenAddCmd(t *testing.T) {\n\tcommand := &Command{\n\t\tCmdName: "
  },
  {
    "path": "framework/cobra/cobra/cmd/golden_test.go",
    "chars": 1414,
    "preview": "package cmd\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os/exec\"\n)\n\nfunc init() {\n\t// Mute commands.\n\taddCmd.SetO"
  },
  {
    "path": "framework/cobra/cobra/cmd/helpers.go",
    "chars": 1690,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/helpers_test.go",
    "chars": 106,
    "preview": "package cmd\n\nimport \"testing\"\n\nfunc assertNoErr(t *testing.T, e error) {\n\tif e != nil {\n\t\tt.Error(e)\n\t}\n}\n"
  },
  {
    "path": "framework/cobra/cobra/cmd/init.go",
    "chars": 2067,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/init_test.go",
    "chars": 2110,
    "preview": "package cmd\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/spf13/viper\"\n)\n\nfunc getProjec"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_agpl.go",
    "chars": 35365,
    "preview": "package cmd\n\nfunc initAgpl() {\n\tLicenses[\"agpl\"] = License{\n\t\tName:            \"GNU Affero General Public License\",\n\t\tPo"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_apache_2.go",
    "chars": 12767,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_bsd_clause_2.go",
    "chars": 3474,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_bsd_clause_3.go",
    "chars": 3813,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_gpl_2.go",
    "chars": 19579,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_gpl_3.go",
    "chars": 36642,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_lgpl.go",
    "chars": 8492,
    "preview": "package cmd\n\nfunc initLgpl() {\n\tLicenses[\"lgpl\"] = License{\n\t\tName:            \"GNU Lesser General Public License\",\n\t\tPo"
  },
  {
    "path": "framework/cobra/cobra/cmd/license_mit.go",
    "chars": 2910,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/licenses.go",
    "chars": 3357,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/project.go",
    "chars": 2211,
    "preview": "package cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"text/template\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/cobra/cobra/tpl\"\n)\n\n//"
  },
  {
    "path": "framework/cobra/cobra/cmd/project_test.go",
    "chars": 37,
    "preview": "package cmd\n\n/* todo: write tests */\n"
  },
  {
    "path": "framework/cobra/cobra/cmd/root.go",
    "chars": 2397,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/cmd/testdata/LICENSE.golden",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "framework/cobra/cobra/cmd/testdata/main.go.golden",
    "chars": 662,
    "preview": "/*\nCopyright © 2021 NAME HERE <EMAIL ADDRESS>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may n"
  },
  {
    "path": "framework/cobra/cobra/cmd/testdata/root.go.golden",
    "chars": 2702,
    "preview": "/*\nCopyright © 2021 NAME HERE <EMAIL ADDRESS>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may n"
  },
  {
    "path": "framework/cobra/cobra/cmd/testdata/test.go.golden",
    "chars": 1587,
    "preview": "/*\nCopyright © 2021 NAME HERE <EMAIL ADDRESS>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may n"
  },
  {
    "path": "framework/cobra/cobra/main.go",
    "chars": 743,
    "preview": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra/tpl/main.go",
    "chars": 4017,
    "preview": "package tpl\n\nfunc MainTemplate() []byte {\n\treturn []byte(`/*\n{{ .Copyright }}\n{{ if .Legal.Header }}{{ .Legal.Header }}{"
  },
  {
    "path": "framework/cobra/cobra.go",
    "chars": 6736,
    "preview": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/cobra_test.go",
    "chars": 623,
    "preview": "package cobra\n\nimport (\n\t\"testing\"\n\t\"text/template\"\n)\n\nfunc assertNoErr(t *testing.T, e error) {\n\tif e != nil {\n\t\tt.Erro"
  },
  {
    "path": "framework/cobra/command.go",
    "chars": 48408,
    "preview": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/command_notwin.go",
    "chars": 88,
    "preview": "//go:build !windows\n// +build !windows\n\npackage cobra\n\nvar preExecHookFn func(*Command)\n"
  },
  {
    "path": "framework/cobra/command_test.go",
    "chars": 55201,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/spf"
  },
  {
    "path": "framework/cobra/command_win.go",
    "chars": 452,
    "preview": "//go:build windows\n// +build windows\n\npackage cobra\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/inconshreveable/mousetr"
  },
  {
    "path": "framework/cobra/completions.go",
    "chars": 29263,
    "preview": "package cobra\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\t// ShellCompRequestCmd is"
  },
  {
    "path": "framework/cobra/completions_test.go",
    "chars": 72039,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc validArgsFunc(cmd *Command, args []string, toC"
  },
  {
    "path": "framework/cobra/doc/README.md",
    "chars": 345,
    "preview": "# Documentation generation\n\n- [Man page docs](./man_docs.md)\n- [Markdown docs](./md_docs.md)\n- [Rest docs](./rest_docs.m"
  },
  {
    "path": "framework/cobra/doc/cmd_test.go",
    "chars": 2938,
    "preview": "package doc\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc emptyRun(*cobra.Command, []string) {}\n\nfu"
  },
  {
    "path": "framework/cobra/doc/man_docs.go",
    "chars": 7383,
    "preview": "// Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\")"
  },
  {
    "path": "framework/cobra/doc/man_docs.md",
    "chars": 519,
    "preview": "# Generating Man Pages For Your Own cobra.Command\n\nGenerating man pages from a cobra command is incredibly easy. An exam"
  },
  {
    "path": "framework/cobra/doc/man_docs_test.go",
    "chars": 6114,
    "preview": "package doc\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/s"
  },
  {
    "path": "framework/cobra/doc/man_examples_test.go",
    "chars": 588,
    "preview": "package doc_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/cobra/doc\"\n)\n\nfunc ExampleGenMa"
  },
  {
    "path": "framework/cobra/doc/md_docs.go",
    "chars": 4642,
    "preview": "//Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/doc/md_docs.md",
    "chars": 2808,
    "preview": "# Generating Markdown Docs For Your Own cobra.Command\n\nGenerating Markdown pages from a cobra command is incredibly easy"
  },
  {
    "path": "framework/cobra/doc/md_docs_test.go",
    "chars": 3050,
    "preview": "package doc\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc TestGen"
  },
  {
    "path": "framework/cobra/doc/rest_docs.go",
    "chars": 5332,
    "preview": "//Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/doc/rest_docs.md",
    "chars": 2917,
    "preview": "# Generating ReStructured Text Docs For Your Own cobra.Command\n\nGenerating ReST pages from a cobra command is incredibly"
  },
  {
    "path": "framework/cobra/doc/rest_docs_test.go",
    "chars": 2534,
    "preview": "package doc\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc TestGen"
  },
  {
    "path": "framework/cobra/doc/util.go",
    "chars": 1559,
    "preview": "// Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\")"
  },
  {
    "path": "framework/cobra/doc/yaml_docs.go",
    "chars": 4941,
    "preview": "// Copyright 2016 French Ben. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "framework/cobra/doc/yaml_docs.md",
    "chars": 2702,
    "preview": "# Generating Yaml Docs For Your Own cobra.Command\n\nGenerating yaml files from a cobra command is incredibly easy. An exa"
  },
  {
    "path": "framework/cobra/doc/yaml_docs_test.go",
    "chars": 1952,
    "preview": "package doc\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc TestGen"
  },
  {
    "path": "framework/cobra/fish_completions.go",
    "chars": 8132,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc genFishComp(buf io.StringWriter, name string, inc"
  },
  {
    "path": "framework/cobra/fish_completions.md",
    "chars": 127,
    "preview": "## Generating Fish Completions For Your cobra.Command\n\nPlease refer to [Shell Completions](shell_completions.md) for det"
  },
  {
    "path": "framework/cobra/fish_completions_test.go",
    "chars": 1921,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nfunc TestCompleteNoDesCmdInFishScript(t *testing.T) {\n\trootCmd := &Comman"
  },
  {
    "path": "framework/cobra/hade_command.go",
    "chars": 1433,
    "preview": "package cobra\n\nimport (\n\t\"github.com/gohade/hade/framework\"\n\t\"github.com/robfig/cron/v3\"\n\t\"log\"\n)\n\n// SetContainer 设置服务容"
  },
  {
    "path": "framework/cobra/hade_command_contract.go",
    "chars": 370,
    "preview": "package cobra\n\nimport \"github.com/gohade/hade/framework/contract\"\n\n// MustMakeApp 从容器中获取App服务\nfunc (c *Command) MustMake"
  },
  {
    "path": "framework/cobra/hade_command_distributed.go",
    "chars": 1650,
    "preview": "package cobra\n\nimport (\n\t\"github.com/gohade/hade/framework/contract\"\n\t\"github.com/robfig/cron/v3\"\n\t\"log\"\n\t\"time\"\n)\n\n// A"
  },
  {
    "path": "framework/cobra/powershell_completions.go",
    "chars": 10690,
    "preview": "// The generated scripts require PowerShell v5.0+ (which comes Windows 10, but\n// can be downloaded separately for windo"
  },
  {
    "path": "framework/cobra/powershell_completions.md",
    "chars": 158,
    "preview": "# Generating PowerShell Completions For Your Own cobra.Command\n\nPlease refer to [Shell Completions](shell_completions.md"
  },
  {
    "path": "framework/cobra/projects_using_cobra.md",
    "chars": 1776,
    "preview": "## Projects using Cobra\n\n- [Arduino CLI](https://github.com/arduino/arduino-cli)\n- [Bleve](http://www.blevesearch.com/)\n"
  },
  {
    "path": "framework/cobra/shell_completions.go",
    "chars": 3748,
    "preview": "package cobra\n\nimport (\n\t\"github.com/spf13/pflag\"\n)\n\n// MarkFlagRequired instructs the various shell completion implemen"
  },
  {
    "path": "framework/cobra/shell_completions.md",
    "chars": 24697,
    "preview": "# Generating shell completions\n\nCobra can generate shell completions for multiple shells.\nThe currently supported shells"
  },
  {
    "path": "framework/cobra/user_guide.md",
    "chars": 18737,
    "preview": "# User Guide\n\nWhile you are welcome to provide your own organization, typically a Cobra-based\napplication will follow th"
  },
  {
    "path": "framework/cobra/zsh_completions.go",
    "chars": 9023,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// GenZshCompletionFile generates zsh completion file including d"
  },
  {
    "path": "framework/cobra/zsh_completions.md",
    "chars": 3647,
    "preview": "## Generating Zsh Completion For Your cobra.Command\n\nPlease refer to [Shell Completions](shell_completions.md) for detai"
  },
  {
    "path": "framework/command/app.go",
    "chars": 7758,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/erikdubbelboer/gspt\"\n\t\"github.com/gohade/hade/framework\"\n\t\"gith"
  },
  {
    "path": "framework/command/build.go",
    "chars": 2162,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os/exec\"\n\n\t\"github.com/gohade/hade/framework/cobra\"\n)\n\n// build相关的命令\nfunc init"
  },
  {
    "path": "framework/command/cmd.go",
    "chars": 3065,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/AlecAivazis/survey/v2\"\n\t\"html/template\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n"
  },
  {
    "path": "framework/command/config.go",
    "chars": 1037,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework/cobra\"\n\t\"github.com/gohade/hade/framework/contract\"\n"
  },
  {
    "path": "framework/command/cron.go",
    "chars": 5396,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/erikdubbelboer/gspt\"\n\t\"github.com/sevlyar/go-daemon\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\""
  },
  {
    "path": "framework/command/deploy.go",
    "chars": 11477,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework\"\n\t\"github.com/gohade/hade/framework/cobra"
  },
  {
    "path": "framework/command/dev.go",
    "chars": 8738,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework\"\n\t\"github.com/pkg/errors\"\n\t\"net/http\"\n\t\"net/http/htt"
  },
  {
    "path": "framework/command/env.go",
    "chars": 1029,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework/util\"\n\n\t\"github.com/gohade/hade/framework/cobra\"\n\t\"g"
  },
  {
    "path": "framework/command/go_cmd.go",
    "chars": 490,
    "preview": "package command\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/gohade/hade/framework/cobra\"\n)\n\n// go just run local go "
  },
  {
    "path": "framework/command/go_cmd_test.go",
    "chars": 16,
    "preview": "package command\n"
  },
  {
    "path": "framework/command/help.go",
    "chars": 452,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework/cobra\"\n\t\"github.com/gohade/hade/framework/contract\"\n"
  },
  {
    "path": "framework/command/kernel.go",
    "chars": 844,
    "preview": "package command\n\nimport (\n\t\"github.com/gohade/hade/framework/cobra\"\n)\n\n// AddKernelCommands will add all command/* to ro"
  },
  {
    "path": "framework/command/middleware.go",
    "chars": 5036,
    "preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/AlecAivazis/survey/v2\"\n\t\"github.com/go-git/go-git/v5\"\n\t\"github.co"
  },
  {
    "path": "framework/command/new.go",
    "chars": 4660,
    "preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/AlecAivazis/survey/v2\"\n\t\"github.com/google/go-github/v"
  },
  {
    "path": "framework/command/npm.go",
    "chars": 490,
    "preview": "package command\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/gohade/hade/framework/cobra\"\n)\n\n// npm just run local go"
  },
  {
    "path": "framework/command/provider.go",
    "chars": 4803,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/AlecAivazis/survey/v2\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"text/template\"\n"
  },
  {
    "path": "framework/command/swagger.go",
    "chars": 1479,
    "preview": "package command\n\nimport (\n\t\"fmt\"\n\t\"github.com/gohade/hade/framework/cobra\"\n\t\"github.com/gohade/hade/framework/contract\"\n"
  },
  {
    "path": "framework/container.go",
    "chars": 3878,
    "preview": "package framework\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// Container 是一个服务容器,提供绑定服务和获取服务的功能\ntype Contain"
  },
  {
    "path": "framework/contract/app.go",
    "chars": 831,
    "preview": "package contract\n\n// AppKey 定义字符串凭证\nconst AppKey = \"hade:app\"\n\n// App 定义接口\ntype App interface {\n\t// AppID 表示当前这个app的唯一id"
  },
  {
    "path": "framework/contract/cache.go",
    "chars": 2158,
    "preview": "package contract\n\nimport (\n    \"context\"\n    \"github.com/gohade/hade/framework\"\n    \"time\"\n)\n\nconst CacheKey = \"hade:cac"
  },
  {
    "path": "framework/contract/config.go",
    "chars": 1140,
    "preview": "package contract\n\nimport \"time\"\n\nconst (\n\t// ConfigKey is config key in container\n\tConfigKey = \"hade:config\"\n)\n\n// Confi"
  },
  {
    "path": "framework/contract/distributed.go",
    "chars": 431,
    "preview": "package contract\n\nimport \"time\"\n\n// DistributedKey 定义字符串凭证\nconst DistributedKey = \"hade:distributed\"\n\n// Distributed 分布式"
  },
  {
    "path": "framework/contract/env.go",
    "chars": 506,
    "preview": "package contract\n\nconst (\n\t// EnvProduction 代表生产环境\n\tEnvProduction = \"production\"\n\t// EnvTesting 代表测试环境\n\tEnvTesting = \"te"
  },
  {
    "path": "framework/contract/id.go",
    "chars": 88,
    "preview": "package contract\n\nconst IDKey = \"hade:id\"\n\ntype IDService interface {\n\tNewID() string\n}\n"
  },
  {
    "path": "framework/contract/kernel.go",
    "chars": 181,
    "preview": "package contract\n\nimport (\n\t\"net/http\"\n)\n\nconst KernelKey = \"hade:kernel\"\n\n// Kernel 接口提供框架最核心的结构\ntype Kernel interface "
  },
  {
    "path": "framework/contract/log.go",
    "chars": 1827,
    "preview": "package contract\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"time\"\n)\n\nconst LogKey = \"hade:log\"\n\ntype LogLevel uint32\n\nconst (\n\t// Unkn"
  },
  {
    "path": "framework/contract/orm.go",
    "chars": 2441,
    "preview": "package contract\n\nimport (\n\t\"github.com/go-sql-driver/mysql\"\n\t\"github.com/gohade/hade/framework\"\n\t\"gorm.io/gorm\"\n\t\"net\"\n"
  }
]

// ... and 212 more files (download for full content)

About this extraction

This page contains the full source code of the gohade/coredemo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 412 files (69.7 MB), approximately 7.0M tokens, and a symbol index with 2214 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!