Copy disabled (too large)
Download .txt
Showing preview only (14,916K chars total). Download the full file to get everything.
Repository: eddycjy/go-gin-example
Branch: master
Commit: 4f5174ca325b
Files: 932
Total size: 30.1 MB
Directory structure:
gitextract_tmwv_ouc/
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── README_ZH.md
├── conf/
│ └── app.ini
├── docs/
│ ├── docs.go
│ ├── sql/
│ │ └── blog.sql
│ ├── swagger/
│ │ ├── swagger.json
│ │ └── swagger.yaml
│ ├── swagger.json
│ └── swagger.yaml
├── go.mod
├── go.sum
├── main.go
├── middleware/
│ └── jwt/
│ └── jwt.go
├── models/
│ ├── article.go
│ ├── auth.go
│ ├── models.go
│ └── tag.go
├── pkg/
│ ├── app/
│ │ ├── form.go
│ │ ├── request.go
│ │ └── response.go
│ ├── e/
│ │ ├── cache.go
│ │ ├── code.go
│ │ └── msg.go
│ ├── export/
│ │ └── excel.go
│ ├── file/
│ │ └── file.go
│ ├── gredis/
│ │ └── redis.go
│ ├── logging/
│ │ ├── file.go
│ │ └── log.go
│ ├── qrcode/
│ │ └── qrcode.go
│ ├── setting/
│ │ └── setting.go
│ ├── upload/
│ │ └── image.go
│ └── util/
│ ├── jwt.go
│ ├── md5.go
│ ├── pagination.go
│ └── util.go
├── routers/
│ ├── api/
│ │ ├── auth.go
│ │ ├── upload.go
│ │ └── v1/
│ │ ├── article.go
│ │ └── tag.go
│ └── router.go
├── runtime/
│ └── fonts/
│ └── msyhbd.ttc
├── service/
│ ├── article_service/
│ │ ├── article.go
│ │ └── article_poster.go
│ ├── auth_service/
│ │ └── auth.go
│ ├── cache_service/
│ │ ├── article.go
│ │ └── tag.go
│ └── tag_service/
│ └── tag.go
└── vendor/
├── github.com/
│ ├── 360EntSecGroup-Skylar/
│ │ └── excelize/
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── README_zh.md
│ │ ├── cell.go
│ │ ├── chart.go
│ │ ├── col.go
│ │ ├── comment.go
│ │ ├── date.go
│ │ ├── excelize.go
│ │ ├── file.go
│ │ ├── lib.go
│ │ ├── picture.go
│ │ ├── rows.go
│ │ ├── shape.go
│ │ ├── sheet.go
│ │ ├── sheetpr.go
│ │ ├── sheetview.go
│ │ ├── styles.go
│ │ ├── table.go
│ │ ├── templates.go
│ │ ├── vmlDrawing.go
│ │ ├── xmlChart.go
│ │ ├── xmlComments.go
│ │ ├── xmlContentTypes.go
│ │ ├── xmlDecodeDrawing.go
│ │ ├── xmlDrawing.go
│ │ ├── xmlSharedStrings.go
│ │ ├── xmlStyles.go
│ │ ├── xmlTable.go
│ │ ├── xmlWorkbook.go
│ │ └── xmlWorksheet.go
│ ├── PuerkitoBio/
│ │ ├── purell/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ └── purell.go
│ │ └── urlesc/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── urlesc.go
│ ├── Unknwon/
│ │ └── com/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cmd.go
│ │ ├── convert.go
│ │ ├── dir.go
│ │ ├── file.go
│ │ ├── html.go
│ │ ├── http.go
│ │ ├── math.go
│ │ ├── path.go
│ │ ├── regex.go
│ │ ├── slice.go
│ │ ├── string.go
│ │ ├── time.go
│ │ └── url.go
│ ├── alecthomas/
│ │ └── template/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── exec.go
│ │ ├── funcs.go
│ │ ├── go.mod
│ │ ├── helper.go
│ │ ├── parse/
│ │ │ ├── lex.go
│ │ │ ├── node.go
│ │ │ └── parse.go
│ │ └── template.go
│ ├── astaxie/
│ │ └── beego/
│ │ ├── LICENSE
│ │ └── validation/
│ │ ├── README.md
│ │ ├── util.go
│ │ ├── validation.go
│ │ └── validators.go
│ ├── boombuler/
│ │ └── barcode/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── barcode.go
│ │ ├── qr/
│ │ │ ├── alphanumeric.go
│ │ │ ├── automatic.go
│ │ │ ├── blocks.go
│ │ │ ├── encoder.go
│ │ │ ├── errorcorrection.go
│ │ │ ├── numeric.go
│ │ │ ├── qrcode.go
│ │ │ ├── unicode.go
│ │ │ └── versioninfo.go
│ │ ├── scaledbarcode.go
│ │ └── utils/
│ │ ├── base1dcode.go
│ │ ├── bitlist.go
│ │ ├── galoisfield.go
│ │ ├── gfpoly.go
│ │ ├── reedsolomon.go
│ │ └── runeint.go
│ ├── dgrijalva/
│ │ └── jwt-go/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── MIGRATION_GUIDE.md
│ │ ├── README.md
│ │ ├── VERSION_HISTORY.md
│ │ ├── claims.go
│ │ ├── doc.go
│ │ ├── ecdsa.go
│ │ ├── ecdsa_utils.go
│ │ ├── errors.go
│ │ ├── hmac.go
│ │ ├── map_claims.go
│ │ ├── none.go
│ │ ├── parser.go
│ │ ├── rsa.go
│ │ ├── rsa_pss.go
│ │ ├── rsa_utils.go
│ │ ├── signing_method.go
│ │ └── token.go
│ ├── gin-contrib/
│ │ └── sse/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── sse-decoder.go
│ │ ├── sse-encoder.go
│ │ └── writer.go
│ ├── gin-gonic/
│ │ └── gin/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS.md
│ │ ├── BENCHMARKS.md
│ │ ├── CHANGELOG.md
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── auth.go
│ │ ├── binding/
│ │ │ ├── binding.go
│ │ │ ├── default_validator.go
│ │ │ ├── form.go
│ │ │ ├── form_mapping.go
│ │ │ ├── json.go
│ │ │ ├── msgpack.go
│ │ │ ├── protobuf.go
│ │ │ ├── query.go
│ │ │ ├── uri.go
│ │ │ ├── xml.go
│ │ │ └── yaml.go
│ │ ├── codecov.yml
│ │ ├── context.go
│ │ ├── context_appengine.go
│ │ ├── debug.go
│ │ ├── deprecated.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── fs.go
│ │ ├── gin.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── internal/
│ │ │ └── json/
│ │ │ ├── json.go
│ │ │ └── jsoniter.go
│ │ ├── logger.go
│ │ ├── mode.go
│ │ ├── path.go
│ │ ├── recovery.go
│ │ ├── render/
│ │ │ ├── data.go
│ │ │ ├── html.go
│ │ │ ├── json.go
│ │ │ ├── msgpack.go
│ │ │ ├── protobuf.go
│ │ │ ├── reader.go
│ │ │ ├── redirect.go
│ │ │ ├── render.go
│ │ │ ├── text.go
│ │ │ ├── xml.go
│ │ │ └── yaml.go
│ │ ├── response_writer.go
│ │ ├── routergroup.go
│ │ ├── test_helpers.go
│ │ ├── tree.go
│ │ ├── utils.go
│ │ └── version.go
│ ├── go-ini/
│ │ └── ini/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── README_ZH.md
│ │ ├── error.go
│ │ ├── file.go
│ │ ├── ini.go
│ │ ├── key.go
│ │ ├── parser.go
│ │ ├── section.go
│ │ └── struct.go
│ ├── go-openapi/
│ │ ├── jsonpointer/
│ │ │ ├── .editorconfig
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CODE_OF_CONDUCT.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ └── pointer.go
│ │ ├── jsonreference/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CODE_OF_CONDUCT.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ └── reference.go
│ │ └── spec/
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── .golangci.yml
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── bindata.go
│ │ ├── cache.go
│ │ ├── contact_info.go
│ │ ├── debug.go
│ │ ├── expander.go
│ │ ├── external_docs.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── header.go
│ │ ├── info.go
│ │ ├── items.go
│ │ ├── license.go
│ │ ├── normalizer.go
│ │ ├── operation.go
│ │ ├── parameter.go
│ │ ├── path_item.go
│ │ ├── paths.go
│ │ ├── ref.go
│ │ ├── response.go
│ │ ├── responses.go
│ │ ├── schema.go
│ │ ├── schema_loader.go
│ │ ├── security_scheme.go
│ │ ├── spec.go
│ │ ├── swagger.go
│ │ ├── tag.go
│ │ ├── unused.go
│ │ └── xml_object.go
│ ├── go-sql-driver/
│ │ └── mysql/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS
│ │ ├── CHANGELOG.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appengine.go
│ │ ├── auth.go
│ │ ├── buffer.go
│ │ ├── collations.go
│ │ ├── conncheck.go
│ │ ├── conncheck_dummy.go
│ │ ├── connection.go
│ │ ├── connector.go
│ │ ├── const.go
│ │ ├── driver.go
│ │ ├── driver_go110.go
│ │ ├── dsn.go
│ │ ├── errors.go
│ │ ├── fields.go
│ │ ├── infile.go
│ │ ├── packets.go
│ │ ├── result.go
│ │ ├── rows.go
│ │ ├── statement.go
│ │ ├── transaction.go
│ │ └── utils.go
│ ├── golang/
│ │ ├── freetype/
│ │ │ ├── AUTHORS
│ │ │ ├── CONTRIBUTORS
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── freetype.go
│ │ │ ├── raster/
│ │ │ │ ├── geom.go
│ │ │ │ ├── paint.go
│ │ │ │ ├── raster.go
│ │ │ │ └── stroke.go
│ │ │ └── truetype/
│ │ │ ├── face.go
│ │ │ ├── glyph.go
│ │ │ ├── hint.go
│ │ │ ├── opcodes.go
│ │ │ └── truetype.go
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ └── proto/
│ │ ├── clone.go
│ │ ├── decode.go
│ │ ├── deprecated.go
│ │ ├── discard.go
│ │ ├── encode.go
│ │ ├── equal.go
│ │ ├── extensions.go
│ │ ├── lib.go
│ │ ├── message_set.go
│ │ ├── pointer_reflect.go
│ │ ├── pointer_unsafe.go
│ │ ├── properties.go
│ │ ├── table_marshal.go
│ │ ├── table_merge.go
│ │ ├── table_unmarshal.go
│ │ ├── text.go
│ │ └── text_parser.go
│ ├── gomodule/
│ │ └── redigo/
│ │ ├── LICENSE
│ │ ├── internal/
│ │ │ └── commandinfo.go
│ │ └── redis/
│ │ ├── conn.go
│ │ ├── doc.go
│ │ ├── go16.go
│ │ ├── go17.go
│ │ ├── go18.go
│ │ ├── log.go
│ │ ├── pool.go
│ │ ├── pool17.go
│ │ ├── pubsub.go
│ │ ├── redis.go
│ │ ├── reply.go
│ │ ├── scan.go
│ │ └── script.go
│ ├── jinzhu/
│ │ ├── gorm/
│ │ │ ├── .codeclimate.yml
│ │ │ ├── .gitignore
│ │ │ ├── License
│ │ │ ├── README.md
│ │ │ ├── association.go
│ │ │ ├── callback.go
│ │ │ ├── callback_create.go
│ │ │ ├── callback_delete.go
│ │ │ ├── callback_query.go
│ │ │ ├── callback_query_preload.go
│ │ │ ├── callback_row_query.go
│ │ │ ├── callback_save.go
│ │ │ ├── callback_update.go
│ │ │ ├── dialect.go
│ │ │ ├── dialect_common.go
│ │ │ ├── dialect_mysql.go
│ │ │ ├── dialect_postgres.go
│ │ │ ├── dialect_sqlite3.go
│ │ │ ├── dialects/
│ │ │ │ └── mysql/
│ │ │ │ └── mysql.go
│ │ │ ├── docker-compose.yml
│ │ │ ├── errors.go
│ │ │ ├── field.go
│ │ │ ├── interface.go
│ │ │ ├── join_table_handler.go
│ │ │ ├── logger.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── model_struct.go
│ │ │ ├── scope.go
│ │ │ ├── search.go
│ │ │ ├── test_all.sh
│ │ │ ├── utils.go
│ │ │ └── wercker.yml
│ │ └── inflection/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── inflections.go
│ ├── mailru/
│ │ └── easyjson/
│ │ ├── LICENSE
│ │ ├── buffer/
│ │ │ └── pool.go
│ │ ├── jlexer/
│ │ │ ├── bytestostr.go
│ │ │ ├── bytestostr_nounsafe.go
│ │ │ ├── error.go
│ │ │ └── lexer.go
│ │ └── jwriter/
│ │ └── writer.go
│ ├── mattn/
│ │ └── go-isatty/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── isatty_android.go
│ │ ├── isatty_bsd.go
│ │ ├── isatty_others.go
│ │ ├── isatty_solaris.go
│ │ ├── isatty_tcgets.go
│ │ └── isatty_windows.go
│ ├── modern-go/
│ │ └── concurrent/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── executor.go
│ │ ├── go_above_19.go
│ │ ├── go_below_19.go
│ │ ├── log.go
│ │ ├── test.sh
│ │ └── unbounded_executor.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── swaggo/
│ │ └── swag/
│ │ ├── .gitignore
│ │ ├── .goreleaser.yml
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── Makefile
│ │ ├── PULL_REQUEST_TEMPLATE.md
│ │ ├── README.md
│ │ ├── debug.go
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── license
│ │ ├── operation.go
│ │ ├── parser.go
│ │ ├── property.go
│ │ ├── schema.go
│ │ ├── swagger.go
│ │ └── version.go
│ ├── tealeg/
│ │ └── xlsx/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS.txt
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── LICENSE
│ │ ├── README.org
│ │ ├── cell.go
│ │ ├── col.go
│ │ ├── date.go
│ │ ├── doc.go
│ │ ├── file.go
│ │ ├── format_code.go
│ │ ├── hsl.go
│ │ ├── lib.go
│ │ ├── read.go
│ │ ├── reftable.go
│ │ ├── row.go
│ │ ├── sheet.go
│ │ ├── stream_file.go
│ │ ├── stream_file_builder.go
│ │ ├── style.go
│ │ ├── templates.go
│ │ ├── theme.go
│ │ ├── write.go
│ │ ├── xmlContentTypes.go
│ │ ├── xmlSharedStrings.go
│ │ ├── xmlStyle.go
│ │ ├── xmlTheme.go
│ │ ├── xmlWorkbook.go
│ │ └── xmlWorksheet.go
│ ├── ugorji/
│ │ └── go/
│ │ └── codec/
│ │ ├── 0_importpath.go
│ │ ├── LICENSE
│ │ ├── binc.go
│ │ ├── build.sh
│ │ ├── cbor.go
│ │ ├── codecgen.go
│ │ ├── decode.go
│ │ ├── doc.go
│ │ ├── encode.go
│ │ ├── fast-path.generated.go
│ │ ├── fast-path.go.tmpl
│ │ ├── fast-path.not.go
│ │ ├── gen-dec-array.go.tmpl
│ │ ├── gen-dec-map.go.tmpl
│ │ ├── gen-enc-chan.go.tmpl
│ │ ├── gen-helper.generated.go
│ │ ├── gen-helper.go.tmpl
│ │ ├── gen.generated.go
│ │ ├── gen.go
│ │ ├── go.mod
│ │ ├── goversion_arrayof_gte_go15.go
│ │ ├── goversion_arrayof_lt_go15.go
│ │ ├── goversion_makemap_gte_go19.go
│ │ ├── goversion_makemap_lt_go19.go
│ │ ├── goversion_unexportedembeddedptr_gte_go110.go
│ │ ├── goversion_unexportedembeddedptr_lt_go110.go
│ │ ├── goversion_unsupported_lt_go14.go
│ │ ├── goversion_vendor_eq_go15.go
│ │ ├── goversion_vendor_eq_go16.go
│ │ ├── goversion_vendor_gte_go17.go
│ │ ├── goversion_vendor_lt_go15.go
│ │ ├── helper.go
│ │ ├── helper_internal.go
│ │ ├── helper_not_unsafe.go
│ │ ├── helper_unsafe.go
│ │ ├── json.go
│ │ ├── mammoth-test.go.tmpl
│ │ ├── mammoth2-test.go.tmpl
│ │ ├── msgpack.go
│ │ ├── prebuild.go
│ │ ├── rpc.go
│ │ ├── simple.go
│ │ ├── sort-slice.generated.go
│ │ ├── sort-slice.go.tmpl
│ │ ├── test-cbor-goldens.json
│ │ └── test.py
│ └── unknwon/
│ └── com/
│ ├── go.mod
│ └── go.sum
├── golang.org/
│ └── x/
│ ├── image/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── font/
│ │ │ └── font.go
│ │ └── math/
│ │ └── fixed/
│ │ └── fixed.go
│ ├── net/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── context/
│ │ │ ├── context.go
│ │ │ ├── go17.go
│ │ │ ├── go19.go
│ │ │ ├── pre_go17.go
│ │ │ └── pre_go19.go
│ │ ├── idna/
│ │ │ ├── idna10.0.0.go
│ │ │ ├── idna9.0.0.go
│ │ │ ├── punycode.go
│ │ │ ├── tables10.0.0.go
│ │ │ ├── tables11.0.0.go
│ │ │ ├── tables9.0.0.go
│ │ │ ├── trie.go
│ │ │ └── trieval.go
│ │ └── webdav/
│ │ ├── file.go
│ │ ├── if.go
│ │ ├── internal/
│ │ │ └── xml/
│ │ │ ├── README
│ │ │ ├── marshal.go
│ │ │ ├── read.go
│ │ │ ├── typeinfo.go
│ │ │ └── xml.go
│ │ ├── lock.go
│ │ ├── prop.go
│ │ ├── webdav.go
│ │ └── xml.go
│ ├── sys/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ └── unix/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── affinity_linux.go
│ │ ├── aliases.go
│ │ ├── asm_aix_ppc64.s
│ │ ├── asm_darwin_386.s
│ │ ├── asm_darwin_amd64.s
│ │ ├── asm_darwin_arm.s
│ │ ├── asm_darwin_arm64.s
│ │ ├── asm_dragonfly_amd64.s
│ │ ├── asm_freebsd_386.s
│ │ ├── asm_freebsd_amd64.s
│ │ ├── asm_freebsd_arm.s
│ │ ├── asm_freebsd_arm64.s
│ │ ├── asm_linux_386.s
│ │ ├── asm_linux_amd64.s
│ │ ├── asm_linux_arm.s
│ │ ├── asm_linux_arm64.s
│ │ ├── asm_linux_mips64x.s
│ │ ├── asm_linux_mipsx.s
│ │ ├── asm_linux_ppc64x.s
│ │ ├── asm_linux_riscv64.s
│ │ ├── asm_linux_s390x.s
│ │ ├── asm_netbsd_386.s
│ │ ├── asm_netbsd_amd64.s
│ │ ├── asm_netbsd_arm.s
│ │ ├── asm_netbsd_arm64.s
│ │ ├── asm_openbsd_386.s
│ │ ├── asm_openbsd_amd64.s
│ │ ├── asm_openbsd_arm.s
│ │ ├── asm_openbsd_arm64.s
│ │ ├── asm_solaris_amd64.s
│ │ ├── bluetooth_linux.go
│ │ ├── cap_freebsd.go
│ │ ├── constants.go
│ │ ├── dev_aix_ppc.go
│ │ ├── dev_aix_ppc64.go
│ │ ├── dev_darwin.go
│ │ ├── dev_dragonfly.go
│ │ ├── dev_freebsd.go
│ │ ├── dev_linux.go
│ │ ├── dev_netbsd.go
│ │ ├── dev_openbsd.go
│ │ ├── dirent.go
│ │ ├── endian_big.go
│ │ ├── endian_little.go
│ │ ├── env_unix.go
│ │ ├── errors_freebsd_386.go
│ │ ├── errors_freebsd_amd64.go
│ │ ├── errors_freebsd_arm.go
│ │ ├── fcntl.go
│ │ ├── fcntl_darwin.go
│ │ ├── fcntl_linux_32bit.go
│ │ ├── gccgo.go
│ │ ├── gccgo_c.c
│ │ ├── gccgo_linux_amd64.go
│ │ ├── ioctl.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── pagesize_unix.go
│ │ ├── pledge_openbsd.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── readdirent_getdents.go
│ │ ├── readdirent_getdirentries.go
│ │ ├── sockcmsg_linux.go
│ │ ├── sockcmsg_unix.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_aix.go
│ │ ├── syscall_aix_ppc.go
│ │ ├── syscall_aix_ppc64.go
│ │ ├── syscall_bsd.go
│ │ ├── syscall_darwin.go
│ │ ├── syscall_darwin_386.go
│ │ ├── syscall_darwin_amd64.go
│ │ ├── syscall_darwin_arm.go
│ │ ├── syscall_darwin_arm64.go
│ │ ├── syscall_darwin_libSystem.go
│ │ ├── syscall_dragonfly.go
│ │ ├── syscall_dragonfly_amd64.go
│ │ ├── syscall_freebsd.go
│ │ ├── syscall_freebsd_386.go
│ │ ├── syscall_freebsd_amd64.go
│ │ ├── syscall_freebsd_arm.go
│ │ ├── syscall_freebsd_arm64.go
│ │ ├── syscall_linux.go
│ │ ├── syscall_linux_386.go
│ │ ├── syscall_linux_amd64.go
│ │ ├── syscall_linux_amd64_gc.go
│ │ ├── syscall_linux_arm.go
│ │ ├── syscall_linux_arm64.go
│ │ ├── syscall_linux_gc.go
│ │ ├── syscall_linux_gc_386.go
│ │ ├── syscall_linux_gccgo_386.go
│ │ ├── syscall_linux_gccgo_arm.go
│ │ ├── syscall_linux_mips64x.go
│ │ ├── syscall_linux_mipsx.go
│ │ ├── syscall_linux_ppc64x.go
│ │ ├── syscall_linux_riscv64.go
│ │ ├── syscall_linux_s390x.go
│ │ ├── syscall_linux_sparc64.go
│ │ ├── syscall_netbsd.go
│ │ ├── syscall_netbsd_386.go
│ │ ├── syscall_netbsd_amd64.go
│ │ ├── syscall_netbsd_arm.go
│ │ ├── syscall_netbsd_arm64.go
│ │ ├── syscall_openbsd.go
│ │ ├── syscall_openbsd_386.go
│ │ ├── syscall_openbsd_amd64.go
│ │ ├── syscall_openbsd_arm.go
│ │ ├── syscall_openbsd_arm64.go
│ │ ├── syscall_solaris.go
│ │ ├── syscall_solaris_amd64.go
│ │ ├── syscall_unix.go
│ │ ├── syscall_unix_gc.go
│ │ ├── syscall_unix_gc_ppc64x.go
│ │ ├── timestruct.go
│ │ ├── unveil_openbsd.go
│ │ ├── xattr_bsd.go
│ │ ├── zerrors_aix_ppc.go
│ │ ├── zerrors_aix_ppc64.go
│ │ ├── zerrors_darwin_386.go
│ │ ├── zerrors_darwin_amd64.go
│ │ ├── zerrors_darwin_arm.go
│ │ ├── zerrors_darwin_arm64.go
│ │ ├── zerrors_dragonfly_amd64.go
│ │ ├── zerrors_freebsd_386.go
│ │ ├── zerrors_freebsd_amd64.go
│ │ ├── zerrors_freebsd_arm.go
│ │ ├── zerrors_freebsd_arm64.go
│ │ ├── zerrors_linux_386.go
│ │ ├── zerrors_linux_amd64.go
│ │ ├── zerrors_linux_arm.go
│ │ ├── zerrors_linux_arm64.go
│ │ ├── zerrors_linux_mips.go
│ │ ├── zerrors_linux_mips64.go
│ │ ├── zerrors_linux_mips64le.go
│ │ ├── zerrors_linux_mipsle.go
│ │ ├── zerrors_linux_ppc64.go
│ │ ├── zerrors_linux_ppc64le.go
│ │ ├── zerrors_linux_riscv64.go
│ │ ├── zerrors_linux_s390x.go
│ │ ├── zerrors_linux_sparc64.go
│ │ ├── zerrors_netbsd_386.go
│ │ ├── zerrors_netbsd_amd64.go
│ │ ├── zerrors_netbsd_arm.go
│ │ ├── zerrors_netbsd_arm64.go
│ │ ├── zerrors_openbsd_386.go
│ │ ├── zerrors_openbsd_amd64.go
│ │ ├── zerrors_openbsd_arm.go
│ │ ├── zerrors_openbsd_arm64.go
│ │ ├── zerrors_solaris_amd64.go
│ │ ├── zptrace386_linux.go
│ │ ├── zptracearm_linux.go
│ │ ├── zptracemips_linux.go
│ │ ├── zptracemipsle_linux.go
│ │ ├── zsyscall_aix_ppc.go
│ │ ├── zsyscall_aix_ppc64.go
│ │ ├── zsyscall_aix_ppc64_gc.go
│ │ ├── zsyscall_aix_ppc64_gccgo.go
│ │ ├── zsyscall_darwin_386.1_11.go
│ │ ├── zsyscall_darwin_386.go
│ │ ├── zsyscall_darwin_386.s
│ │ ├── zsyscall_darwin_amd64.1_11.go
│ │ ├── zsyscall_darwin_amd64.go
│ │ ├── zsyscall_darwin_amd64.s
│ │ ├── zsyscall_darwin_arm.1_11.go
│ │ ├── zsyscall_darwin_arm.go
│ │ ├── zsyscall_darwin_arm.s
│ │ ├── zsyscall_darwin_arm64.1_11.go
│ │ ├── zsyscall_darwin_arm64.go
│ │ ├── zsyscall_darwin_arm64.s
│ │ ├── zsyscall_dragonfly_amd64.go
│ │ ├── zsyscall_freebsd_386.go
│ │ ├── zsyscall_freebsd_amd64.go
│ │ ├── zsyscall_freebsd_arm.go
│ │ ├── zsyscall_freebsd_arm64.go
│ │ ├── zsyscall_linux_386.go
│ │ ├── zsyscall_linux_amd64.go
│ │ ├── zsyscall_linux_arm.go
│ │ ├── zsyscall_linux_arm64.go
│ │ ├── zsyscall_linux_mips.go
│ │ ├── zsyscall_linux_mips64.go
│ │ ├── zsyscall_linux_mips64le.go
│ │ ├── zsyscall_linux_mipsle.go
│ │ ├── zsyscall_linux_ppc64.go
│ │ ├── zsyscall_linux_ppc64le.go
│ │ ├── zsyscall_linux_riscv64.go
│ │ ├── zsyscall_linux_s390x.go
│ │ ├── zsyscall_linux_sparc64.go
│ │ ├── zsyscall_netbsd_386.go
│ │ ├── zsyscall_netbsd_amd64.go
│ │ ├── zsyscall_netbsd_arm.go
│ │ ├── zsyscall_netbsd_arm64.go
│ │ ├── zsyscall_openbsd_386.go
│ │ ├── zsyscall_openbsd_amd64.go
│ │ ├── zsyscall_openbsd_arm.go
│ │ ├── zsyscall_openbsd_arm64.go
│ │ ├── zsyscall_solaris_amd64.go
│ │ ├── zsysctl_openbsd_386.go
│ │ ├── zsysctl_openbsd_amd64.go
│ │ ├── zsysctl_openbsd_arm.go
│ │ ├── zsysctl_openbsd_arm64.go
│ │ ├── zsysnum_darwin_386.go
│ │ ├── zsysnum_darwin_amd64.go
│ │ ├── zsysnum_darwin_arm.go
│ │ ├── zsysnum_darwin_arm64.go
│ │ ├── zsysnum_dragonfly_amd64.go
│ │ ├── zsysnum_freebsd_386.go
│ │ ├── zsysnum_freebsd_amd64.go
│ │ ├── zsysnum_freebsd_arm.go
│ │ ├── zsysnum_freebsd_arm64.go
│ │ ├── zsysnum_linux_386.go
│ │ ├── zsysnum_linux_amd64.go
│ │ ├── zsysnum_linux_arm.go
│ │ ├── zsysnum_linux_arm64.go
│ │ ├── zsysnum_linux_mips.go
│ │ ├── zsysnum_linux_mips64.go
│ │ ├── zsysnum_linux_mips64le.go
│ │ ├── zsysnum_linux_mipsle.go
│ │ ├── zsysnum_linux_ppc64.go
│ │ ├── zsysnum_linux_ppc64le.go
│ │ ├── zsysnum_linux_riscv64.go
│ │ ├── zsysnum_linux_s390x.go
│ │ ├── zsysnum_linux_sparc64.go
│ │ ├── zsysnum_netbsd_386.go
│ │ ├── zsysnum_netbsd_amd64.go
│ │ ├── zsysnum_netbsd_arm.go
│ │ ├── zsysnum_netbsd_arm64.go
│ │ ├── zsysnum_openbsd_386.go
│ │ ├── zsysnum_openbsd_amd64.go
│ │ ├── zsysnum_openbsd_arm.go
│ │ ├── zsysnum_openbsd_arm64.go
│ │ ├── ztypes_aix_ppc.go
│ │ ├── ztypes_aix_ppc64.go
│ │ ├── ztypes_darwin_386.go
│ │ ├── ztypes_darwin_amd64.go
│ │ ├── ztypes_darwin_arm.go
│ │ ├── ztypes_darwin_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_freebsd_arm64.go
│ │ ├── ztypes_linux_386.go
│ │ ├── ztypes_linux_amd64.go
│ │ ├── ztypes_linux_arm.go
│ │ ├── ztypes_linux_arm64.go
│ │ ├── ztypes_linux_mips.go
│ │ ├── ztypes_linux_mips64.go
│ │ ├── ztypes_linux_mips64le.go
│ │ ├── ztypes_linux_mipsle.go
│ │ ├── ztypes_linux_ppc64.go
│ │ ├── ztypes_linux_ppc64le.go
│ │ ├── ztypes_linux_riscv64.go
│ │ ├── ztypes_linux_s390x.go
│ │ ├── ztypes_linux_sparc64.go
│ │ ├── ztypes_netbsd_386.go
│ │ ├── ztypes_netbsd_amd64.go
│ │ ├── ztypes_netbsd_arm.go
│ │ ├── ztypes_netbsd_arm64.go
│ │ ├── ztypes_openbsd_386.go
│ │ ├── ztypes_openbsd_amd64.go
│ │ ├── ztypes_openbsd_arm.go
│ │ ├── ztypes_openbsd_arm64.go
│ │ └── ztypes_solaris_amd64.go
│ ├── text/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── secure/
│ │ │ └── bidirule/
│ │ │ ├── bidirule.go
│ │ │ ├── bidirule10.0.0.go
│ │ │ └── bidirule9.0.0.go
│ │ ├── transform/
│ │ │ └── transform.go
│ │ ├── unicode/
│ │ │ ├── bidi/
│ │ │ │ ├── bidi.go
│ │ │ │ ├── bracket.go
│ │ │ │ ├── core.go
│ │ │ │ ├── prop.go
│ │ │ │ ├── tables10.0.0.go
│ │ │ │ ├── tables11.0.0.go
│ │ │ │ ├── tables9.0.0.go
│ │ │ │ └── trieval.go
│ │ │ └── norm/
│ │ │ ├── composition.go
│ │ │ ├── forminfo.go
│ │ │ ├── input.go
│ │ │ ├── iter.go
│ │ │ ├── normalize.go
│ │ │ ├── readwriter.go
│ │ │ ├── tables10.0.0.go
│ │ │ ├── tables11.0.0.go
│ │ │ ├── tables9.0.0.go
│ │ │ ├── transform.go
│ │ │ └── trie.go
│ │ └── width/
│ │ ├── kind_string.go
│ │ ├── tables10.0.0.go
│ │ ├── tables11.0.0.go
│ │ ├── tables9.0.0.go
│ │ ├── transform.go
│ │ ├── trieval.go
│ │ └── width.go
│ └── tools/
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ └── go/
│ ├── ast/
│ │ └── astutil/
│ │ ├── enclosing.go
│ │ ├── imports.go
│ │ ├── rewrite.go
│ │ └── util.go
│ ├── buildutil/
│ │ ├── allpackages.go
│ │ ├── fakecontext.go
│ │ ├── overlay.go
│ │ ├── tags.go
│ │ └── util.go
│ ├── internal/
│ │ └── cgo/
│ │ ├── cgo.go
│ │ └── cgo_pkgconfig.go
│ └── loader/
│ ├── doc.go
│ ├── loader.go
│ └── util.go
├── google.golang.org/
│ └── appengine/
│ ├── LICENSE
│ └── cloudsql/
│ ├── cloudsql.go
│ ├── cloudsql_classic.go
│ └── cloudsql_vm.go
├── gopkg.in/
│ ├── go-playground/
│ │ └── validator.v8/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── baked_in.go
│ │ ├── cache.go
│ │ ├── doc.go
│ │ ├── regexes.go
│ │ ├── util.go
│ │ └── validator.go
│ └── yaml.v2/
│ ├── .travis.yml
│ ├── LICENSE
│ ├── LICENSE.libyaml
│ ├── NOTICE
│ ├── README.md
│ ├── apic.go
│ ├── decode.go
│ ├── emitterc.go
│ ├── encode.go
│ ├── go.mod
│ ├── parserc.go
│ ├── readerc.go
│ ├── resolve.go
│ ├── scannerc.go
│ ├── sorter.go
│ ├── writerc.go
│ ├── yaml.go
│ ├── yamlh.go
│ └── yamlprivateh.go
└── modules.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea/
.DS_Store
runtime/*
!runtime/qrcode/bg.jpg
!runtime/fonts
================================================
FILE: Dockerfile
================================================
FROM golang:latest
ENV GOPROXY https://goproxy.cn,direct
WORKDIR $GOPATH/src/github.com/EDDYCJY/go-gin-example
COPY . $GOPATH/src/github.com/EDDYCJY/go-gin-example
RUN go build .
EXPOSE 8000
ENTRYPOINT ["./go-gin-example"]
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) The go-gin-example Authors
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: Makefile
================================================
.PHONY: build clean tool lint help
all: build
build:
@go build -v .
tool:
go vet ./...; true
gofmt -w .
lint:
golint ./...
clean:
rm -rf go-gin-example
go clean -i .
help:
@echo "make: compile packages and dependencies"
@echo "make tool: run specified go tool"
@echo "make lint: golint ./..."
@echo "make clean: remove object files and cached files"
================================================
FILE: README.md
================================================
# Go Gin Example - Blog API[](https://goreportcard.com/report/github.com/EDDYCJY/go-gin-example) [](https://godoc.org/github.com/EDDYCJY/go-gin-example) [](https://raw.githubusercontent.com/EDDYCJY/go-gin-example/master/LICENSE)
A production-ready RESTful blog API example built with Go and Gin framework, demonstrating real-world patterns and best practices.
[简体中文](https://github.com/EDDYCJY/go-gin-example/blob/master/README_ZH.md)
## Project Overview
This project is a comprehensive blog backend API system that provides complete article and tag management functionalities, along with features like JWT authentication, image upload, QR code generation, and Excel import/export.
## Tech Stack
| Category | Technology |
|----------|------------|
| Language | Go |
| Web Framework | [Gin](https://github.com/gin-gonic/gin) |
| ORM | [GORM](https://github.com/jinzhu/gorm) |
| Database | MySQL |
| Cache | Redis (via [Redigo](https://github.com/gomodule/redigo)) |
| Authentication | JWT ([jwt-go](https://github.com/dgrijalva/jwt-go)) |
| Configuration | [go-ini](https://github.com/go-ini/ini) |
| API Documentation | [Swagger](https://github.com/swaggo/gin-swagger) |
| Excel Processing | [excelize](https://github.com/360EntSecGroup-Skylar/excelize), [xlsx](https://github.com/tealeg/xlsx) |
| Image Processing | [freetype](https://github.com/golang/freetype), [barcode](https://github.com/boombuler/barcode) |
| Validation | [beego/validation](https://github.com/astaxie/beego/validation) |
## Project Structure
```
go-gin-example/
├── conf/ # Configuration files
│ └── app.ini # Application configuration
├── docs/ # Documentation
│ ├── sql/ # Database scripts
│ │ └── blog.sql # Database schema
│ └── swagger/ # Swagger documentation
├── middleware/ # Middleware
│ └── jwt/ # JWT authentication middleware
│ └── jwt.go
├── models/ # Data models (ORM)
│ ├── article.go # Article model
│ ├── auth.go # Auth model
│ ├── models.go # Database initialization
│ └── tag.go # Tag model
├── pkg/ # Shared packages
│ ├── app/ # Application utilities
│ │ ├── form.go # Form binding
│ │ ├── request.go # Request handling
│ │ └── response.go # Response formatting
│ ├── e/ # Error codes
│ │ ├── cache.go # Cache key constants
│ │ ├── code.go # Error code definitions
│ │ └── msg.go # Error messages
│ ├── export/ # Excel export utilities
│ │ └── excel.go
│ ├── file/ # File utilities
│ │ └── file.go
│ ├── gredis/ # Redis client
│ │ └── redis.go
│ ├── logging/ # Logging utilities
│ │ ├── file.go
│ │ └── log.go
│ ├── qrcode/ # QR code generation
│ │ └── qrcode.go
│ ├── setting/ # Configuration management
│ │ └── setting.go
│ ├── upload/ # Image upload utilities
│ │ └── image.go
│ └── util/ # Common utilities
│ ├── jwt.go # JWT utilities
│ ├── md5.go # MD5 hashing
│ ├── pagination.go # Pagination helper
│ └── util.go
├── routers/ # Route definitions
│ ├── api/ # API handlers
│ │ ├── v1/ # API v1 handlers
│ │ │ ├── article.go # Article endpoints
│ │ │ └── tag.go # Tag endpoints
│ │ ├── auth.go # Authentication endpoint
│ │ └── upload.go # Image upload endpoint
│ └── router.go # Route initialization
├── runtime/ # Runtime resources
│ ├── fonts/ # Font files
│ └── qrcode/ # QR code resources
├── service/ # Business logic layer
│ ├── article_service/ # Article services
│ │ ├── article.go # Article CRUD operations
│ │ └── article_poster.go # Poster generation
│ ├── auth_service/ # Auth services
│ │ └── auth.go
│ ├── cache_service/ # Cache key generation
│ │ ├── article.go
│ │ └── tag.go
│ └── tag_service/ # Tag services
│ └── tag.go
├── Dockerfile # Docker build file
├── Makefile # Build automation
├── go.mod # Go module definition
├── go.sum # Dependency checksums
└── main.go # Application entry point
```
## Architecture
The project follows a layered architecture pattern:
```
┌─────────────────────────────────────────────────────────────┐
│ HTTP Requests │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Middleware Layer │
│ (JWT Authentication) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Router Layer │
│ (routers/api/v1/*.go) │
│ - Request validation │
│ - Parameter binding │
│ - Response formatting │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Service Layer │
│ (service/*/*.go) │
│ - Business logic │
│ - Cache management │
│ - Cross-model operations │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Model Layer │
│ (models/*.go) │
│ - Database operations │
│ - CRUD methods │
│ - Data structures │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Storage Layer │
│ MySQL (Primary) + Redis (Cache) │
└─────────────────────────────────────────────────────────────┘
```
## Feature Tree
```
Go Gin Blog API
├── Authentication
│ └── JWT Login Validation
│ ├── Token Generation (3-hour expiry)
│ ├── Token Validation
│ └── Token Refresh
├── Article Management
│ ├── Create Article
│ ├── Read Article (with Redis caching)
│ ├── Update Article
│ ├── Delete Article (soft delete)
│ ├── List Articles (paginated)
│ ├── Count Articles
│ └── Generate Article Poster
│ ├── Embed QR Code
│ ├── Apply Background Image
│ ├── Render Text Overlay
│ └── Save Merged Image
├── Tag Management
│ ├── CRUD Operations
│ │ ├── Create Tag
│ │ ├── Read Tags (paginated, cached)
│ │ ├── Update Tag
│ │ └── Delete Tag (soft delete)
│ ├── Export Tags to Excel
│ └── Import Tags from Excel
├── File Upload
│ └── Image Upload
│ ├── Format validation (.jpg, .jpeg, .png)
│ ├── Size validation (max 5MB)
│ └── MD5-based naming
├── API Documentation
│ └── Swagger UI (/swagger/*any)
└── Static File Serving
├── Exported Excel files (/export)
├── Uploaded images (/upload/images)
└── Generated QR codes (/qrcode)
```
## API Endpoints
### Public Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| POST | `/auth` | User authentication, returns JWT token |
| GET | `/swagger/*any` | Swagger API documentation |
| POST | `/upload` | Image upload |
| POST | `/tags/export` | Export tags to Excel |
| POST | `/tags/import` | Import tags from Excel |
### Protected Endpoints (Require JWT Token)
#### Tags
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/api/v1/tags` | Get tag list (paginated) |
| POST | `/api/v1/tags` | Create new tag |
| PUT | `/api/v1/tags/:id` | Update tag by ID |
| DELETE | `/api/v1/tags/:id` | Delete tag by ID |
#### Articles
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/api/v1/articles` | Get article list (paginated) |
| GET | `/api/v1/articles/:id` | Get article by ID |
| POST | `/api/v1/articles` | Create new article |
| PUT | `/api/v1/articles/:id` | Update article by ID |
| DELETE | `/api/v1/articles/:id` | Delete article by ID |
| POST | `/api/v1/articles/poster/generate` | Generate article poster with QR code |
## Database Schema
### Tables
**blog_auth** - User authentication
```sql
- id: INT (PK, AUTO_INCREMENT)
- username: VARCHAR(50)
- password: VARCHAR(50)
```
**blog_tag** - Article tags
```sql
- id: INT (PK, AUTO_INCREMENT)
- name: VARCHAR(100) - Tag name
- created_on: INT - Creation timestamp
- created_by: VARCHAR(100) - Creator
- modified_on: INT - Modification timestamp
- modified_by: VARCHAR(100) - Modifier
- deleted_on: INT - Deletion timestamp (soft delete)
- state: TINYINT - Status (0: disabled, 1: enabled)
```
**blog_article** - Articles
```sql
- id: INT (PK, AUTO_INCREMENT)
- tag_id: INT (FK) - Associated tag ID
- title: VARCHAR(100) - Article title
- desc: VARCHAR(255) - Description
- content: TEXT - Article content
- cover_image_url: VARCHAR(255) - Cover image URL
- created_on: INT - Creation timestamp
- created_by: VARCHAR(100) - Creator
- modified_on: INT - Modification timestamp
- modified_by: VARCHAR(255) - Modifier
- deleted_on: INT - Deletion timestamp (soft delete)
- state: TINYINT - Status
```
## Configuration
Configuration is managed through `conf/app.ini`:
```ini
[app]
PageSize = 10 # Pagination page size
JwtSecret = 233 # JWT signing secret
PrefixUrl = http://127.0.0.1:8000
RuntimeRootPath = runtime/
ImageSavePath = upload/images/
ImageMaxSize = 5 # Max image size in MB
ImageAllowExts = .jpg,.jpeg,.png
ExportSavePath = export/
QrCodeSavePath = qrcode/
FontSavePath = fonts/
LogSavePath = logs/
[server]
RunMode = debug # debug or release
HttpPort = 8000
ReadTimeout = 60 # seconds
WriteTimeout = 60 # seconds
[database]
Type = mysql
User = root
Password = rootroot
Host = 127.0.0.1:3306
Name = blog
TablePrefix = blog_
[redis]
Host = 127.0.0.1:6379
Password =
MaxIdle = 30
MaxActive = 30
IdleTimeout = 200
```
## Getting Started
### Prerequisites
- Go 1.13+
- MySQL 5.6+
- Redis
### Database Setup
1. Create a MySQL database named `blog`
2. Execute the SQL script:
```bash
mysql -u root -p blog < docs/sql/blog.sql
```
### Configuration
1. Edit `conf/app.ini` to match your environment
2. Update database credentials
3. Update Redis connection settings
### Running the Application
```bash
# Build
make build
# Run
./go-gin-example
# Or run directly
go run main.go
```
The server will start at `http://localhost:8000`
### Using Docker
```bash
# Build image
docker build -t go-gin-example .
# Run container
docker run -p 8000:8000 go-gin-example
```
## API Usage Examples
### 1. Get Authentication Token
```bash
curl -X POST http://localhost:8000/auth \
-d "username=test&password=test123"
```
Response:
```json
{
"code": 200,
"msg": "ok",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
```
### 2. Create a Tag
```bash
curl -X POST "http://localhost:8000/api/v1/tags?token=YOUR_TOKEN" \
-d "name=Go&created_by=admin&state=1"
```
### 3. Get Tags List
```bash
curl "http://localhost:8000/api/v1/tags?token=YOUR_TOKEN"
```
### 4. Create an Article
```bash
curl -X POST "http://localhost:8000/api/v1/articles?token=YOUR_TOKEN" \
-d "tag_id=1&title=Hello Gin&desc=Introduction to Gin&content=Article content...&created_by=admin&cover_image_url=http://example.com/image.jpg&state=1"
```
### 5. Upload an Image
```bash
curl -X POST http://localhost:8000/upload \
-F "image=@/path/to/image.jpg"
```
### 6. Export Tags to Excel
```bash
curl -X POST http://localhost:8000/tags/export
```
## Key Design Patterns
### 1. Soft Delete
All models use soft delete by setting `deleted_on` timestamp instead of actual deletion.
### 2. Redis Caching
Articles and tags are cached in Redis with 1-hour TTL to reduce database load.
### 3. Service Layer Pattern
Business logic is separated into service layer, keeping handlers thin and focused on request/response handling.
### 4. Unified Response Format
All API responses follow consistent format:
```json
{
"code": 200,
"msg": "ok",
"data": {}
}
```
### 5. Custom GORM Callbacks
Custom callbacks for automatic timestamp management:
- `CreatedOn` set on create
- `ModifiedOn` updated on modifications
- `DeletedOn` set on soft delete
## Error Codes
| Code | Description |
|------|-------------|
| 200 | Success |
| 400 | Invalid parameters |
| 500 | Internal server error |
| 10001 | Tag already exists |
| 10003 | Tag not found |
| 10011 | Article not found |
| 20001 | Token validation failed |
| 20002 | Token expired |
| 20003 | Token generation error |
| 20004 | Authentication failed |
| 30001 | Image save failed |
| 30002 | Image check failed |
| 30003 | Invalid image format |
## Development Commands
```bash
# Build
make build
# Run code analysis
make tool
# Run linter
make lint
# Clean build artifacts
make clean
```
## License
MIT License - See [LICENSE](LICENSE) for details.
## Credits
Project by [EDDYCJY](https://github.com/EDDYCJY/go-gin-example)
================================================
FILE: README_ZH.md
================================================
# Go Gin Example - 博客 API [](https://goreportcard.com/report/github.com/EDDYCJY/go-gin-example) [](https://godoc.org/github.com/EDDYCJY/go-gin-example) [](https://raw.githubusercontent.com/EDDYCJY/go-gin-example/master/LICENSE)
一个基于 Go 和 Gin 框架构建的生产级 RESTful 博客 API 示例,展示了真实项目的设计模式和最佳实践。
## 目录
本项目提供 [Gin实践](https://segmentfault.com/a/1190000013297625) 的连载示例代码
1. [Gin实践 连载一 Golang介绍与环境安装](https://book.eddycjy.com/golang/gin/install.html)
2. [Gin实践 连载二 搭建Blog API's(一)](https://book.eddycjy.com/golang/gin/api-01.html)
3. [Gin实践 连载三 搭建Blog API's(二)](https://book.eddycjy.com/golang/gin/api-02.html)
4. [Gin实践 连载四 搭建Blog API's(三)](https://book.eddycjy.com/golang/gin/api-03.html)
5. [Gin实践 连载五 使用JWT进行身份校验](https://book.eddycjy.com/golang/gin/jwt.html)
6. [Gin实践 连载六 编写一个简单的文件日志](https://book.eddycjy.com/golang/gin/log.html)
7. [Gin实践 连载七 Golang优雅重启HTTP服务](https://book.eddycjy.com/golang/gin/reload-http.html)
8. [Gin实践 连载八 为它加上Swagger](https://book.eddycjy.com/golang/gin/swagger.html)
9. [Gin实践 连载九 将Golang应用部署到Docker](https://book.eddycjy.com/golang/gin/golang-docker.html)
10. [Gin实践 连载十 定制 GORM Callbacks](https://book.eddycjy.com/golang/gin/gorm-callback.html)
11. [Gin实践 连载十一 Cron定时任务](https://book.eddycjy.com/golang/gin/cron.html)
12. [Gin实践 连载十二 优化配置结构及实现图片上传](https://book.eddycjy.com/golang/gin/config-upload.html)
13. [Gin实践 连载十三 优化你的应用结构和实现Redis缓存](https://book.eddycjy.com/golang/gin/application-redis.html)
14. [Gin实践 连载十四 实现导出、导入 Excel](https://book.eddycjy.com/golang/gin/excel.html)
15. [Gin实践 连载十五 生成二维码、合并海报](https://book.eddycjy.com/golang/gin/image.html)
16. [Gin实践 连载十六 在图片上绘制文字](https://book.eddycjy.com/golang/gin/font.html)
17. [Gin实践 连载十七 用 Nginx 部署 Go 应用](https://book.eddycjy.com/golang/gin/nginx.html)
18. [Gin实践 番外 Golang交叉编译](https://book.eddycjy.com/golang/gin/cgo.html)
19. [Gin实践 番外 请入门 Makefile](https://book.eddycjy.com/golang/gin/makefile.html)
## 技术栈
| 分类 | 技术 |
|------|------|
| 编程语言 | Go |
| Web 框架 | [Gin](https://github.com/gin-gonic/gin) |
| ORM | [GORM](https://github.com/jinzhu/gorm) |
| 数据库 | MySQL |
| 缓存 | Redis (通过 [Redigo](https://github.com/gomodule/redigo)) |
| 认证 | JWT ([jwt-go](https://github.com/dgrijalva/jwt-go)) |
| 配置管理 | [go-ini](https://github.com/go-ini/ini) |
| API 文档 | [Swagger](https://github.com/swaggo/gin-swagger) |
| Excel 处理 | [excelize](https://github.com/360EntSecGroup-Skylar/excelize), [xlsx](https://github.com/tealeg/xlsx) |
| 图片处理 | [freetype](https://github.com/golang/freetype), [barcode](https://github.com/boombuler/barcode) |
| 参数校验 | [beego/validation](https://github.com/astaxie/beego/validation) |
## 项目结构
```
go-gin-example/
├── conf/ # 配置文件目录
│ └── app.ini # 应用配置文件
├── docs/ # 文档目录
│ ├── sql/ # 数据库脚本
│ │ └── blog.sql # 数据库表结构
│ └── swagger/ # Swagger 文档
├── middleware/ # 中间件
│ └── jwt/ # JWT 认证中间件
│ └── jwt.go
├── models/ # 数据模型层 (ORM)
│ ├── article.go # 文章模型
│ ├── auth.go # 认证模型
│ ├── models.go # 数据库初始化
│ └── tag.go # 标签模型
├── pkg/ # 公共包
│ ├── app/ # 应用工具
│ │ ├── form.go # 表单绑定
│ │ ├── request.go # 请求处理
│ │ └── response.go # 响应格式化
│ ├── e/ # 错误码
│ │ ├── cache.go # 缓存键常量
│ │ ├── code.go # 错误码定义
│ │ └── msg.go # 错误信息
│ ├── export/ # Excel 导出工具
│ │ └── excel.go
│ ├── file/ # 文件工具
│ │ └── file.go
│ ├── gredis/ # Redis 客户端
│ │ └── redis.go
│ ├── logging/ # 日志工具
│ │ ├── file.go
│ │ └── log.go
│ ├── qrcode/ # 二维码生成
│ │ └── qrcode.go
│ ├── setting/ # 配置管理
│ │ └── setting.go
│ ├── upload/ # 图片上传工具
│ │ └── image.go
│ └── util/ # 通用工具
│ ├── jwt.go # JWT 工具
│ ├── md5.go # MD5 哈希
│ ├── pagination.go # 分页助手
│ └── util.go
├── routers/ # 路由定义
│ ├── api/ # API 处理器
│ │ ├── v1/ # API v1 处理器
│ │ │ ├── article.go # 文章接口
│ │ │ └── tag.go # 标签接口
│ │ ├── auth.go # 认证接口
│ │ └── upload.go # 图片上传接口
│ └── router.go # 路由初始化
├── runtime/ # 运行时资源
│ ├── fonts/ # 字体文件
│ └── qrcode/ # 二维码资源
├── service/ # 业务逻辑层
│ ├── article_service/ # 文章服务
│ │ ├── article.go # 文章 CRUD 操作
│ │ └── article_poster.go # 海报生成
│ ├── auth_service/ # 认证服务
│ │ └── auth.go
│ ├── cache_service/ # 缓存键生成
│ │ ├── article.go
│ │ └── tag.go
│ └── tag_service/ # 标签服务
│ └── tag.go
├── Dockerfile # Docker 构建文件
├── Makefile # 构建自动化
├── go.mod # Go 模块定义
├── go.sum # 依赖校验
└── main.go # 应用入口
```
## 架构设计
项目采用分层架构模式:
```
┌─────────────────────────────────────────────────────────────┐
│ HTTP 请求 │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 中间件层 │
│ (JWT 认证) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 路由层 │
│ (routers/api/v1/*.go) │
│ - 请求校验 │
│ - 参数绑定 │
│ - 响应格式化 │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 服务层 │
│ (service/*/*.go) │
│ - 业务逻辑 │
│ - 缓存管理 │
│ - 跨模型操作 │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 模型层 │
│ (models/*.go) │
│ - 数据库操作 │
│ - CRUD 方法 │
│ - 数据结构 │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 存储层 │
│ MySQL (主存储) + Redis (缓存) │
└─────────────────────────────────────────────────────────────┘
```
## 功能树
```
Go Gin 博客 API
├── 认证模块
│ └── JWT 登录验证
│ ├── Token 生成(3小时有效期)
│ ├── Token 验证
│ └── Token 刷新
├── 文章管理
│ ├── 创建文章
│ ├── 查询文章(带 Redis 缓存)
│ ├── 更新文章
│ ├── 删除文章(软删除)
│ ├── 文章列表(分页)
│ ├── 文章统计
│ └── 生成文章海报
│ ├── 嵌入二维码
│ ├── 应用背景图
│ ├── 渲染文字叠加
│ └── 保存合成图片
├── 标签管理
│ ├── CRUD 操作
│ │ ├── 创建标签
│ │ ├── 查询标签(分页,带缓存)
│ │ ├── 更新标签
│ │ └── 删除标签(软删除)
│ ├── 导出标签到 Excel
│ └── 从 Excel 导入标签
├── 文件上传
│ └── 图片上传
│ ├── 格式校验 (.jpg, .jpeg, .png)
│ ├── 大小校验(最大 5MB)
│ └── MD5 命名
├── API 文档
│ └── Swagger UI (/swagger/*any)
└── 静态文件服务
├── 导出的 Excel 文件 (/export)
├── 上传的图片 (/upload/images)
└── 生成的二维码 (/qrcode)
```
## API 接口
### 公开接口
| 方法 | 接口 | 描述 |
|------|------|------|
| POST | `/auth` | 用户认证,返回 JWT Token |
| GET | `/swagger/*any` | Swagger API 文档 |
| POST | `/upload` | 图片上传 |
| POST | `/tags/export` | 导出标签到 Excel |
| POST | `/tags/import` | 从 Excel 导入标签 |
### 受保护接口(需要 JWT Token)
#### 标签接口
| 方法 | 接口 | 描述 |
|------|------|------|
| GET | `/api/v1/tags` | 获取标签列表(分页) |
| POST | `/api/v1/tags` | 创建新标签 |
| PUT | `/api/v1/tags/:id` | 根据 ID 更新标签 |
| DELETE | `/api/v1/tags/:id` | 根据 ID 删除标签 |
#### 文章接口
| 方法 | 接口 | 描述 |
|------|------|------|
| GET | `/api/v1/articles` | 获取文章列表(分页) |
| GET | `/api/v1/articles/:id` | 根据 ID 获取文章 |
| POST | `/api/v1/articles` | 创建新文章 |
| PUT | `/api/v1/articles/:id` | 根据 ID 更新文章 |
| DELETE | `/api/v1/articles/:id` | 根据 ID 删除文章 |
| POST | `/api/v1/articles/poster/generate` | 生成带二维码的文章海报 |
## 数据库设计
### 数据表
**blog_auth** - 用户认证表
```sql
- id: INT (主键, 自增)
- username: VARCHAR(50) - 用户名
- password: VARCHAR(50) - 密码
```
**blog_tag** - 文章标签表
```sql
- id: INT (主键, 自增)
- name: VARCHAR(100) - 标签名称
- created_on: INT - 创建时间戳
- created_by: VARCHAR(100) - 创建人
- modified_on: INT - 修改时间戳
- modified_by: VARCHAR(100) - 修改人
- deleted_on: INT - 删除时间戳(软删除)
- state: TINYINT - 状态 (0: 禁用, 1: 启用)
```
**blog_article** - 文章表
```sql
- id: INT (主键, 自增)
- tag_id: INT (外键) - 关联标签 ID
- title: VARCHAR(100) - 文章标题
- desc: VARCHAR(255) - 文章简述
- content: TEXT - 文章内容
- cover_image_url: VARCHAR(255) - 封面图片地址
- created_on: INT - 创建时间戳
- created_by: VARCHAR(100) - 创建人
- modified_on: INT - 修改时间戳
- modified_by: VARCHAR(255) - 修改人
- deleted_on: INT - 删除时间戳(软删除)
- state: TINYINT - 状态
```
## 配置说明
配置文件位于 `conf/app.ini`:
```ini
[app]
PageSize = 10 # 分页大小
JwtSecret = 233 # JWT 签名密钥
PrefixUrl = http://127.0.0.1:8000
RuntimeRootPath = runtime/
ImageSavePath = upload/images/
ImageMaxSize = 5 # 图片最大大小(MB)
ImageAllowExts = .jpg,.jpeg,.png
ExportSavePath = export/
QrCodeSavePath = qrcode/
FontSavePath = fonts/
LogSavePath = logs/
[server]
RunMode = debug # debug 或 release
HttpPort = 8000
ReadTimeout = 60 # 秒
WriteTimeout = 60 # 秒
[database]
Type = mysql
User = root
Password = rootroot
Host = 127.0.0.1:3306
Name = blog
TablePrefix = blog_
[redis]
Host = 127.0.0.1:6379
Password =
MaxIdle = 30
MaxActive = 30
IdleTimeout = 200
```
## 快速开始
### 环境要求
- Go 1.13+
- MySQL 5.6+
- Redis
### 数据库初始化
1. 创建名为 `blog` 的 MySQL 数据库
2. 执行 SQL 脚本:
```bash
mysql -u root -p blog < docs/sql/blog.sql
```
### 配置修改
1. 编辑 `conf/app.ini` 以匹配您的环境
2. 更新数据库连接信息
3. 更新 Redis 连接配置
### 运行应用
```bash
# 构建
make build
# 运行
./go-gin-example
# 或直接运行
go run main.go
```
服务将启动在 `http://localhost:8000`
### 使用 Docker
```bash
# 构建镜像
docker build -t go-gin-example .
# 运行容器
docker run -p 8000:8000 go-gin-example
```
## API 使用示例
### 1. 获取认证 Token
```bash
curl -X POST http://localhost:8000/auth \
-d "username=test&password=test123"
```
响应:
```json
{
"code": 200,
"msg": "ok",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
```
### 2. 创建标签
```bash
curl -X POST "http://localhost:8000/api/v1/tags?token=YOUR_TOKEN" \
-d "name=Go&created_by=admin&state=1"
```
### 3. 获取标签列表
```bash
curl "http://localhost:8000/api/v1/tags?token=YOUR_TOKEN"
```
### 4. 创建文章
```bash
curl -X POST "http://localhost:8000/api/v1/articles?token=YOUR_TOKEN" \
-d "tag_id=1&title=Hello Gin&desc=Gin 入门介绍&content=文章内容...&created_by=admin&cover_image_url=http://example.com/image.jpg&state=1"
```
### 5. 上传图片
```bash
curl -X POST http://localhost:8000/upload \
-F "image=@/path/to/image.jpg"
```
### 6. 导出标签到 Excel
```bash
curl -X POST http://localhost:8000/tags/export
```
## 核心设计模式
### 1. 软删除
所有模型使用软删除,通过设置 `deleted_on` 时间戳而非实际删除数据。
### 2. Redis 缓存
文章和标签数据缓存在 Redis 中,TTL 为 1 小时,以减少数据库负载。
### 3. 服务层模式
业务逻辑分离到服务层,保持处理器精简,专注于请求/响应处理。
### 4. 统一响应格式
所有 API 响应遵循统一格式:
```json
{
"code": 200,
"msg": "ok",
"data": {}
}
```
### 5. 自定义 GORM 回调
自定义回调实现自动时间戳管理:
- `CreatedOn` 在创建时设置
- `ModifiedOn` 在修改时更新
- `DeletedOn` 在软删除时设置
## 错误码说明
| 错误码 | 描述 |
|--------|------|
| 200 | 成功 |
| 400 | 请求参数无效 |
| 500 | 服务器内部错误 |
| 10001 | 标签已存在 |
| 10003 | 标签不存在 |
| 10011 | 文章不存在 |
| 20001 | Token 验证失败 |
| 20002 | Token 已过期 |
| 20003 | Token 生成错误 |
| 20004 | 认证失败 |
| 30001 | 图片保存失败 |
| 30002 | 图片检查失败 |
| 30003 | 图片格式无效 |
## 开发命令
```bash
# 构建
make build
# 运行代码分析
make tool
# 运行代码检查
make lint
# 清理构建产物
make clean
```
## 许可证
MIT License - 详见 [LICENSE](LICENSE) 文件。
## 联系我

================================================
FILE: conf/app.ini
================================================
[app]
PageSize = 10
JwtSecret = 233
PrefixUrl = http://127.0.0.1:8000
RuntimeRootPath = runtime/
ImageSavePath = upload/images/
# MB
ImageMaxSize = 5
ImageAllowExts = .jpg,.jpeg,.png
ExportSavePath = export/
QrCodeSavePath = qrcode/
FontSavePath = fonts/
LogSavePath = logs/
LogSaveName = log
LogFileExt = log
TimeFormat = 20060102
[server]
#debug or release
RunMode = debug
HttpPort = 8000
ReadTimeout = 60
WriteTimeout = 60
[database]
Type = mysql
User = root
Password = rootroot
Host = 127.0.0.1:3306
Name = blog
TablePrefix = blog_
[redis]
Host = 127.0.0.1:6379
Password =
MaxIdle = 30
MaxActive = 30
IdleTimeout = 200
================================================
FILE: docs/docs.go
================================================
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-03-22 15:19:36.759704 +0800 CST m=+0.052176208
package docs
import (
"bytes"
"encoding/json"
"strings"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"title": "{{.Title}}",
"termsOfService": "https://github.com/EDDYCJY/go-gin-example",
"contact": {},
"license": {
"name": "MIT",
"url": "https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/articles": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple articles",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/articles/{id}": {
"get": {
"produces": [
"application/json"
],
"summary": "Get a single article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"put": {
"produces": [
"application/json"
],
"summary": "Update article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple article tags",
"parameters": [
{
"type": "string",
"description": "Name",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "State",
"name": "state",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/export": {
"post": {
"produces": [
"application/json"
],
"summary": "Export article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/import": {
"post": {
"produces": [
"application/json"
],
"summary": "Import Image",
"parameters": [
{
"type": "file",
"description": "Image File",
"name": "image",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/{id}": {
"put": {
"produces": [
"application/json"
],
"summary": "Update article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Name",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/auth": {
"get": {
"produces": [
"application/json"
],
"summary": "Get Auth",
"parameters": [
{
"type": "string",
"description": "userName",
"name": "username",
"in": "query",
"required": true
},
{
"type": "string",
"description": "password",
"name": "password",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
}
},
"definitions": {
"app.Response": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"type": "object"
},
"msg": {
"type": "string"
}
}
}
}
}`
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.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Golang Gin API",
Description: "An example of gin",
}
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)
},
}).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: docs/sql/blog.sql
================================================
/*
Navicat MySQL Data Transfer
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 50639
File Encoding : 65001
Date: 2018-03-18 16:52:35
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for blog_article
-- ----------------------------
DROP TABLE IF EXISTS `blog_article`;
CREATE TABLE `blog_article` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tag_id` int(10) unsigned DEFAULT '0' COMMENT '标签ID',
`title` varchar(100) DEFAULT '' COMMENT '文章标题',
`desc` varchar(255) DEFAULT '' COMMENT '简述',
`content` text COMMENT '内容',
`cover_image_url` varchar(255) DEFAULT '' COMMENT '封面图片地址',
`created_on` int(10) unsigned DEFAULT '0' COMMENT '新建时间',
`created_by` varchar(100) DEFAULT '' COMMENT '创建人',
`modified_on` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
`modified_by` varchar(255) DEFAULT '' COMMENT '修改人',
`deleted_on` int(10) unsigned DEFAULT '0',
`state` tinyint(3) unsigned DEFAULT '1' COMMENT '删除时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章管理';
-- ----------------------------
-- Table structure for blog_auth
-- ----------------------------
DROP TABLE IF EXISTS `blog_auth`;
CREATE TABLE `blog_auth` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT '' COMMENT '账号',
`password` varchar(50) DEFAULT '' COMMENT '密码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
INSERT INTO `blog_auth` (`id`, `username`, `password`) VALUES ('1', 'test', 'test123');
-- ----------------------------
-- Table structure for blog_tag
-- ----------------------------
DROP TABLE IF EXISTS `blog_tag`;
CREATE TABLE `blog_tag` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT '' COMMENT '标签名称',
`created_on` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
`created_by` varchar(100) DEFAULT '' COMMENT '创建人',
`modified_on` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
`modified_by` varchar(100) DEFAULT '' COMMENT '修改人',
`deleted_on` int(10) unsigned DEFAULT '0' COMMENT '删除时间',
`state` tinyint(3) unsigned DEFAULT '1' COMMENT '状态 0为禁用、1为启用',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章标签管理';
================================================
FILE: docs/swagger/swagger.json
================================================
{
"swagger": "2.0",
"info": {
"description": "An example of gin",
"title": "Golang Gin API",
"termsOfService": "https://github.com/EDDYCJY/go-gin-example",
"contact": {},
"license": {
"name": "MIT",
"url": "https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE"
},
"version": "1.0"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/articles": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple articles",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/articles/{id}": {
"get": {
"produces": [
"application/json"
],
"summary": "Get a single article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
},
"put": {
"produces": [
"application/json"
],
"summary": "Update article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple article tags",
"parameters": [
{
"type": "string",
"description": "Name",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "State",
"name": "state",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/export": {
"post": {
"produces": [
"application/json"
],
"summary": "Export article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/import": {
"post": {
"produces": [
"application/json"
],
"summary": "Import article tag",
"parameters": [
{
"description": "Excel File",
"name": "file",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/{id}": {
"put": {
"produces": [
"application/json"
],
"summary": "Update article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "ID",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/app.Response"
}
}
}
}
}
},
"definitions": {
"app.Response": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"type": "object"
},
"msg": {
"type": "string"
}
}
}
}
}
================================================
FILE: docs/swagger/swagger.yaml
================================================
basePath: '{{.BasePath}}'
definitions:
app.Response:
properties:
code:
type: integer
data:
type: object
msg:
type: string
type: object
host: '{{.Host}}'
info:
contact: {}
description: An example of gin
license:
name: MIT
url: https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE
termsOfService: https://github.com/EDDYCJY/go-gin-example
title: Golang Gin API
version: "1.0"
paths:
/api/v1/articles:
get:
parameters:
- description: TagID
in: body
name: tag_id
schema:
type: object
- description: State
in: body
name: state
schema:
type: object
- description: CreatedBy
in: body
name: created_by
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Get multiple articles
post:
parameters:
- description: TagID
in: body
name: tag_id
required: true
schema:
type: object
- description: Title
in: body
name: title
required: true
schema:
type: object
- description: Desc
in: body
name: desc
required: true
schema:
type: object
- description: Content
in: body
name: content
required: true
schema:
type: object
- description: CreatedBy
in: body
name: created_by
required: true
schema:
type: object
- description: State
in: body
name: state
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Add article
/api/v1/articles/{id}:
delete:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Delete article
get:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Get a single article
put:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
- description: TagID
in: body
name: tag_id
schema:
type: object
- description: Title
in: body
name: title
schema:
type: object
- description: Desc
in: body
name: desc
schema:
type: object
- description: Content
in: body
name: content
schema:
type: object
- description: ModifiedBy
in: body
name: modified_by
required: true
schema:
type: object
- description: State
in: body
name: state
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Update article
/api/v1/tags:
get:
parameters:
- description: Name
in: query
name: name
type: string
- description: State
in: query
name: state
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Get multiple article tags
post:
parameters:
- description: Name
in: body
name: name
required: true
schema:
type: object
- description: State
in: body
name: state
schema:
type: object
- description: CreatedBy
in: body
name: created_by
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Add article tag
/api/v1/tags/{id}:
delete:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Delete article tag
put:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
- description: ID
in: body
name: name
required: true
schema:
type: object
- description: State
in: body
name: state
schema:
type: object
- description: ModifiedBy
in: body
name: modified_by
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Update article tag
/api/v1/tags/export:
post:
parameters:
- description: Name
in: body
name: name
schema:
type: object
- description: State
in: body
name: state
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Export article tag
/api/v1/tags/import:
post:
parameters:
- description: Excel File
in: body
name: file
required: true
schema:
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
type: object
summary: Import article tag
swagger: "2.0"
================================================
FILE: docs/swagger.json
================================================
{
"swagger": "2.0",
"info": {
"description": "An example of gin",
"title": "Golang Gin API",
"termsOfService": "https://github.com/EDDYCJY/go-gin-example",
"contact": {},
"license": {
"name": "MIT",
"url": "https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE"
},
"version": "1.0"
},
"paths": {
"/api/v1/articles": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple articles",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article",
"parameters": [
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/articles/{id}": {
"get": {
"produces": [
"application/json"
],
"summary": "Get a single article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"put": {
"produces": [
"application/json"
],
"summary": "Update article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "TagID",
"name": "tag_id",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Title",
"name": "title",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Desc",
"name": "desc",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Content",
"name": "content",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags": {
"get": {
"produces": [
"application/json"
],
"summary": "Get multiple article tags",
"parameters": [
{
"type": "string",
"description": "Name",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "State",
"name": "state",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"post": {
"produces": [
"application/json"
],
"summary": "Add article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "CreatedBy",
"name": "created_by",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/export": {
"post": {
"produces": [
"application/json"
],
"summary": "Export article tag",
"parameters": [
{
"description": "Name",
"name": "name",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/import": {
"post": {
"produces": [
"application/json"
],
"summary": "Import Image",
"parameters": [
{
"type": "file",
"description": "Image File",
"name": "image",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/api/v1/tags/{id}": {
"put": {
"produces": [
"application/json"
],
"summary": "Update article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Name",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "State",
"name": "state",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "ModifiedBy",
"name": "modified_by",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"summary": "Delete article tag",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
},
"/auth": {
"get": {
"produces": [
"application/json"
],
"summary": "Get Auth",
"parameters": [
{
"type": "string",
"description": "userName",
"name": "username",
"in": "query",
"required": true
},
{
"type": "string",
"description": "password",
"name": "password",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
}
}
}
},
"definitions": {
"app.Response": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"type": "object"
},
"msg": {
"type": "string"
}
}
}
}
}
================================================
FILE: docs/swagger.yaml
================================================
definitions:
app.Response:
properties:
code:
type: integer
data:
type: object
msg:
type: string
type: object
info:
contact: {}
description: An example of gin
license:
name: MIT
url: https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE
termsOfService: https://github.com/EDDYCJY/go-gin-example
title: Golang Gin API
version: "1.0"
paths:
/api/v1/articles:
get:
parameters:
- description: TagID
in: body
name: tag_id
schema:
type: integer
- description: State
in: body
name: state
schema:
type: integer
- description: CreatedBy
in: body
name: created_by
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Get multiple articles
post:
parameters:
- description: TagID
in: body
name: tag_id
required: true
schema:
type: integer
- description: Title
in: body
name: title
required: true
schema:
type: string
- description: Desc
in: body
name: desc
required: true
schema:
type: string
- description: Content
in: body
name: content
required: true
schema:
type: string
- description: CreatedBy
in: body
name: created_by
required: true
schema:
type: string
- description: State
in: body
name: state
required: true
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Add article
/api/v1/articles/{id}:
delete:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Delete article
get:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Get a single article
put:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
- description: TagID
in: body
name: tag_id
schema:
type: string
- description: Title
in: body
name: title
schema:
type: string
- description: Desc
in: body
name: desc
schema:
type: string
- description: Content
in: body
name: content
schema:
type: string
- description: ModifiedBy
in: body
name: modified_by
required: true
schema:
type: string
- description: State
in: body
name: state
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Update article
/api/v1/tags:
get:
parameters:
- description: Name
in: query
name: name
type: string
- description: State
in: query
name: state
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Get multiple article tags
post:
parameters:
- description: Name
in: body
name: name
required: true
schema:
type: string
- description: State
in: body
name: state
schema:
type: integer
- description: CreatedBy
in: body
name: created_by
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Add article tag
/api/v1/tags/{id}:
delete:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Delete article tag
put:
parameters:
- description: ID
in: path
name: id
required: true
type: integer
- description: Name
in: body
name: name
required: true
schema:
type: string
- description: State
in: body
name: state
schema:
type: integer
- description: ModifiedBy
in: body
name: modified_by
required: true
schema:
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Update article tag
/api/v1/tags/export:
post:
parameters:
- description: Name
in: body
name: name
schema:
type: string
- description: State
in: body
name: state
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Export article tag
/api/v1/tags/import:
post:
parameters:
- description: Image File
in: formData
name: image
required: true
type: file
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Import Image
/auth:
get:
parameters:
- description: userName
in: query
name: username
required: true
type: string
- description: password
in: query
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/app.Response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/app.Response'
summary: Get Auth
swagger: "2.0"
================================================
FILE: go.mod
================================================
module github.com/EDDYCJY/go-gin-example
go 1.13
require (
github.com/360EntSecGroup-Skylar/excelize v1.3.1-0.20180527032555-9e463b461434
github.com/PuerkitoBio/purell v1.1.1-0.20180310210909-975f53781597 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/astaxie/beego v1.9.3-0.20171218111859-f16688817aa4
github.com/boombuler/barcode v1.0.1-0.20180315051053-3c06908149f7
github.com/denisenkom/go-mssqldb v0.0.0-20190920000552-128d9f4ae1cd // indirect
github.com/dgrijalva/jwt-go v3.1.0+incompatible
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/gin-gonic/gin v1.4.0
github.com/go-ini/ini v1.32.1-0.20180214101753-32e4be5f41bb
github.com/go-sql-driver/mysql v1.4.1-0.20190510102335-877a9775f068 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/gomodule/redigo v2.0.1-0.20180401191855-9352ab68be13+incompatible
github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d // indirect
github.com/jinzhu/now v1.0.1 // indirect
github.com/json-iterator/go v1.1.7 // indirect
github.com/lib/pq v1.2.0 // indirect
github.com/mattn/go-sqlite3 v1.11.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.5.1
github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893
github.com/unknwon/com v1.0.1
golang.org/x/image v0.0.0-20180628062038-cc896f830ced // indirect
golang.org/x/sys v0.0.0-20190921204832-2dccfee4fd3e // indirect
google.golang.org/appengine v1.6.3 // indirect
gopkg.in/ini.v1 v1.47.0 // indirect
)
================================================
FILE: go.sum
================================================
github.com/360EntSecGroup-Skylar/excelize v1.3.1-0.20180527032555-9e463b461434 h1:sJVNhDPQ1uL3izsJQGWFQb3lUvFloaTIgqz0ClEp6aQ=
github.com/360EntSecGroup-Skylar/excelize v1.3.1-0.20180527032555-9e463b461434/go.mod h1:R8KYLmGns0vDPe6/HyphW0mzW+MFexlGDafU0ykVEnU=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1-0.20180310210909-975f53781597 h1:8+pMa56PPVkN6NbWGZbNIWLVIitrF8AQZ95d4UAhqmE=
github.com/PuerkitoBio/purell v1.1.1-0.20180310210909-975f53781597/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/astaxie/beego v1.9.3-0.20171218111859-f16688817aa4 h1:dNIynF6ICiq1NghlpIBxljb2JbyC61/JqWB5A9cfUfo=
github.com/astaxie/beego v1.9.3-0.20171218111859-f16688817aa4/go.mod h1:0R4++1tUqERR0WYFWdfkcrsyoVBCG4DgpDGokT3yb+U=
github.com/boombuler/barcode v1.0.1-0.20180315051053-3c06908149f7 h1:s7NuEzhW8Z2v7X7lUwHMqXt8HKYYd5YwtEt0CCMff3Q=
github.com/boombuler/barcode v1.0.1-0.20180315051053-3c06908149f7/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.0.0-20190920000552-128d9f4ae1cd h1:tXCgEGHPT4XELDS7nB0OBb9968yCOd+MnyNf+6m1u40=
github.com/denisenkom/go-mssqldb v0.0.0-20190920000552-128d9f4ae1cd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/dgrijalva/jwt-go v3.1.0+incompatible h1:FFziAwDQQ2dz1XClWMkwvukur3evtZx7x/wMHKM1i20=
github.com/dgrijalva/jwt-go v3.1.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/gzip v0.0.1 h1:ezvKOL6jH+jlzdHNE4h9h8q8uMpDQjyl0NN0Jd7jozc=
github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w=
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 h1:AzN37oI0cOS+cougNAV9szl6CVoj2RYwzS3DpUQNtlY=
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.3.0 h1:kCmZyPklC0gVdL728E6Aj20uYBJV93nj/TkwBTKhFbs=
github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y=
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
github.com/go-ini/ini v1.32.1-0.20180214101753-32e4be5f41bb h1:v+YnQ81wH+hTjaP5nFSpqASFbe9UETYm1vG65qp7Zc0=
github.com/go-ini/ini v1.32.1-0.20180214101753-32e4be5f41bb/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk=
github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4=
github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-sql-driver/mysql v1.4.1-0.20190510102335-877a9775f068 h1:q2kwd9Bcgl2QpSi/Wjcx9jzwyICt3EWTP5to43QhwaA=
github.com/go-sql-driver/mysql v1.4.1-0.20190510102335-877a9775f068/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gomodule/redigo v2.0.1-0.20180401191855-9352ab68be13+incompatible h1:cQom4uMS2ufhGPAJgSa67FXfrHg6ytNKmWtKN/l/n+I=
github.com/gomodule/redigo v2.0.1-0.20180401191855-9352ab68be13+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64 h1:8I4kQ5M5OjZKNsgRUs20soTdIoo1GbiGApV31kJ9e6Y=
github.com/jinzhu/gorm v0.0.0-20180213101209-6e1387b44c64/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc=
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PXuP99tXNrhbq2BaPz9B+jNAvH1JPQQpG/9GCXY=
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/swaggo/gin-swagger v1.2.0 h1:YskZXEiv51fjOMTsXrOetAjrMDfFaXD79PEoQBOe2W0=
github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI=
github.com/swaggo/swag v1.5.1 h1:2Agm8I4K5qb00620mHq0VJ05/KT4FtmALPIcQR9lEZM=
github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y=
github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893 h1:x+HNL/+eUTIzieDdCKbl6QjneUXKuiiTBvC9s5USpT0=
github.com/tealeg/xlsx v1.0.4-0.20180419195153-f36fa3be8893/go.mod h1:uxu5UY2ovkuRPWKQ8Q7JG0JbSivrISjdPzZQKeo74mA=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go v1.1.5-pre h1:jyJKFOSEbdOc2HODrf2qcCkYOdq7zzXqA9bhW5oV4fM=
github.com/ugorji/go v1.1.5-pre/go.mod h1:FwP/aQVg39TXzItUBMwnWp9T9gPQnXw4Poh4/oBQZ/0=
github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ugorji/go/codec v1.1.5-pre h1:5YV9PsFAN+ndcCtTM7s60no7nY7eTG3LPtxhSwuxzCs=
github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI=
github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=
github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/image v0.0.0-20180628062038-cc896f830ced h1:2QsAEqOy4Mp+V4HL2Wr1iBNpZWaL72EvTO4oj5bmr5w=
golang.org/x/image v0.0.0-20180628062038-cc896f830ced/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a h1:+KkCgOMgnKSgenxTBoiwkMqTiouMIy/3o8RLdmSbGoY=
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190921204832-2dccfee4fd3e h1:9ZBATxGrhPGloVV3LDg+OqDyEtcYRtQ9eIVlIjan6+M=
golang.org/x/sys v0.0.0-20190921204832-2dccfee4fd3e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b h1:mSUCVIwDx4hfXJfWsOPfdzEHxzb2Xjl6BQ8YgPnazQA=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b h1:/mJ+GKieZA6hFDQGdWZrjj4AXPl5ylY+5HusG80roy0=
golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/appengine v1.6.3 h1:hvZejVcIxAKHR8Pq2gXaDggf6CWT1QEqO+JEBeOKCG8=
google.golang.org/appengine v1.6.3/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
gopkg.in/ini.v1 v1.47.0 h1:XAVsOWcIxjm6JVEbCbSZgSBZIF0BrCzXs4orAQr6uc8=
gopkg.in/ini.v1 v1.47.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
================================================
FILE: main.go
================================================
package main
import (
"fmt"
"log"
"net/http"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/models"
"github.com/EDDYCJY/go-gin-example/pkg/gredis"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/routers"
"github.com/EDDYCJY/go-gin-example/pkg/util"
)
func init() {
setting.Setup()
models.Setup()
logging.Setup()
gredis.Setup()
util.Setup()
}
// @title Golang Gin API
// @version 1.0
// @description An example of gin
// @termsOfService https://github.com/EDDYCJY/go-gin-example
// @license.name MIT
// @license.url https://github.com/EDDYCJY/go-gin-example/blob/master/LICENSE
func main() {
gin.SetMode(setting.ServerSetting.RunMode)
routersInit := routers.InitRouter()
readTimeout := setting.ServerSetting.ReadTimeout
writeTimeout := setting.ServerSetting.WriteTimeout
endPoint := fmt.Sprintf(":%d", setting.ServerSetting.HttpPort)
maxHeaderBytes := 1 << 20
server := &http.Server{
Addr: endPoint,
Handler: routersInit,
ReadTimeout: readTimeout,
WriteTimeout: writeTimeout,
MaxHeaderBytes: maxHeaderBytes,
}
log.Printf("[info] start http server listening %s", endPoint)
server.ListenAndServe()
// If you want Graceful Restart, you need a Unix system and download github.com/fvbock/endless
//endless.DefaultReadTimeOut = readTimeout
//endless.DefaultWriteTimeOut = writeTimeout
//endless.DefaultMaxHeaderBytes = maxHeaderBytes
//server := endless.NewServer(endPoint, routersInit)
//server.BeforeBegin = func(add string) {
// log.Printf("Actual pid is %d", syscall.Getpid())
//}
//
//err := server.ListenAndServe()
//if err != nil {
// log.Printf("Server err: %v", err)
//}
}
================================================
FILE: middleware/jwt/jwt.go
================================================
package jwt
import (
"net/http"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/e"
"github.com/EDDYCJY/go-gin-example/pkg/util"
)
// JWT is jwt middleware
func JWT() gin.HandlerFunc {
return func(c *gin.Context) {
var code int
var data interface{}
code = e.SUCCESS
token := c.Query("token")
if token == "" {
code = e.INVALID_PARAMS
} else {
_, err := util.ParseToken(token)
if err != nil {
switch err.(*jwt.ValidationError).Errors {
case jwt.ValidationErrorExpired:
code = e.ERROR_AUTH_CHECK_TOKEN_TIMEOUT
default:
code = e.ERROR_AUTH_CHECK_TOKEN_FAIL
}
}
}
if code != e.SUCCESS {
c.JSON(http.StatusUnauthorized, gin.H{
"code": code,
"msg": e.GetMsg(code),
"data": data,
})
c.Abort()
return
}
c.Next()
}
}
================================================
FILE: models/article.go
================================================
package models
import (
"github.com/jinzhu/gorm"
)
type Article struct {
Model
TagID int `json:"tag_id" gorm:"index"`
Tag Tag `json:"tag"`
Title string `json:"title"`
Desc string `json:"desc"`
Content string `json:"content"`
CoverImageUrl string `json:"cover_image_url"`
CreatedBy string `json:"created_by"`
ModifiedBy string `json:"modified_by"`
State int `json:"state"`
}
// ExistArticleByID checks if an article exists based on ID
func ExistArticleByID(id int) (bool, error) {
var article Article
err := db.Select("id").Where("id = ? AND deleted_on = ? ", id, 0).First(&article).Error
if err != nil && err != gorm.ErrRecordNotFound {
return false, err
}
if article.ID > 0 {
return true, nil
}
return false, nil
}
// GetArticleTotal gets the total number of articles based on the constraints
func GetArticleTotal(maps interface{}) (int, error) {
var count int
if err := db.Model(&Article{}).Where(maps).Count(&count).Error; err != nil {
return 0, err
}
return count, nil
}
// GetArticles gets a list of articles based on paging constraints
func GetArticles(pageNum int, pageSize int, maps interface{}) ([]*Article, error) {
var articles []*Article
err := db.Preload("Tag").Where(maps).Offset(pageNum).Limit(pageSize).Find(&articles).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
return articles, nil
}
// GetArticle Get a single article based on ID
func GetArticle(id int) (*Article, error) {
var article Article
err := db.Where("id = ? AND deleted_on = ? ", id, 0).First(&article).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
err = db.Model(&article).Related(&article.Tag).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
return &article, nil
}
// EditArticle modify a single article
func EditArticle(id int, data interface{}) error {
if err := db.Model(&Article{}).Where("id = ? AND deleted_on = ? ", id, 0).Updates(data).Error; err != nil {
return err
}
return nil
}
// AddArticle add a single article
func AddArticle(data map[string]interface{}) error {
article := Article{
TagID: data["tag_id"].(int),
Title: data["title"].(string),
Desc: data["desc"].(string),
Content: data["content"].(string),
CreatedBy: data["created_by"].(string),
State: data["state"].(int),
CoverImageUrl: data["cover_image_url"].(string),
}
if err := db.Create(&article).Error; err != nil {
return err
}
return nil
}
// DeleteArticle delete a single article
func DeleteArticle(id int) error {
if err := db.Where("id = ?", id).Delete(Article{}).Error; err != nil {
return err
}
return nil
}
// CleanAllArticle clear all article
func CleanAllArticle() error {
if err := db.Unscoped().Where("deleted_on != ? ", 0).Delete(&Article{}).Error; err != nil {
return err
}
return nil
}
================================================
FILE: models/auth.go
================================================
package models
import "github.com/jinzhu/gorm"
type Auth struct {
ID int `gorm:"primary_key" json:"id"`
Username string `json:"username"`
Password string `json:"password"`
}
// CheckAuth checks if authentication information exists
func CheckAuth(username, password string) (bool, error) {
var auth Auth
err := db.Select("id").Where(Auth{Username: username, Password: password}).First(&auth).Error
if err != nil && err != gorm.ErrRecordNotFound {
return false, err
}
if auth.ID > 0 {
return true, nil
}
return false, nil
}
================================================
FILE: models/models.go
================================================
package models
import (
"fmt"
"log"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"time"
)
var db *gorm.DB
type Model struct {
ID int `gorm:"primary_key" json:"id"`
CreatedOn int `json:"created_on"`
ModifiedOn int `json:"modified_on"`
DeletedOn int `json:"deleted_on"`
}
// Setup initializes the database instance
func Setup() {
var err error
db, err = gorm.Open(setting.DatabaseSetting.Type, fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local",
setting.DatabaseSetting.User,
setting.DatabaseSetting.Password,
setting.DatabaseSetting.Host,
setting.DatabaseSetting.Name))
if err != nil {
log.Fatalf("models.Setup err: %v", err)
}
gorm.DefaultTableNameHandler = func(db *gorm.DB, defaultTableName string) string {
return setting.DatabaseSetting.TablePrefix + defaultTableName
}
db.SingularTable(true)
db.Callback().Create().Replace("gorm:update_time_stamp", updateTimeStampForCreateCallback)
db.Callback().Update().Replace("gorm:update_time_stamp", updateTimeStampForUpdateCallback)
db.Callback().Delete().Replace("gorm:delete", deleteCallback)
db.DB().SetMaxIdleConns(10)
db.DB().SetMaxOpenConns(100)
}
// CloseDB closes database connection (unnecessary)
func CloseDB() {
defer db.Close()
}
// updateTimeStampForCreateCallback will set `CreatedOn`, `ModifiedOn` when creating
func updateTimeStampForCreateCallback(scope *gorm.Scope) {
if !scope.HasError() {
nowTime := time.Now().Unix()
if createTimeField, ok := scope.FieldByName("CreatedOn"); ok {
if createTimeField.IsBlank {
createTimeField.Set(nowTime)
}
}
if modifyTimeField, ok := scope.FieldByName("ModifiedOn"); ok {
if modifyTimeField.IsBlank {
modifyTimeField.Set(nowTime)
}
}
}
}
// updateTimeStampForUpdateCallback will set `ModifiedOn` when updating
func updateTimeStampForUpdateCallback(scope *gorm.Scope) {
if _, ok := scope.Get("gorm:update_column"); !ok {
scope.SetColumn("ModifiedOn", time.Now().Unix())
}
}
// deleteCallback will set `DeletedOn` where deleting
func deleteCallback(scope *gorm.Scope) {
if !scope.HasError() {
var extraOption string
if str, ok := scope.Get("gorm:delete_option"); ok {
extraOption = fmt.Sprint(str)
}
deletedOnField, hasDeletedOnField := scope.FieldByName("DeletedOn")
if !scope.Search.Unscoped && hasDeletedOnField {
scope.Raw(fmt.Sprintf(
"UPDATE %v SET %v=%v%v%v",
scope.QuotedTableName(),
scope.Quote(deletedOnField.DBName),
scope.AddToVars(time.Now().Unix()),
addExtraSpaceIfExist(scope.CombinedConditionSql()),
addExtraSpaceIfExist(extraOption),
)).Exec()
} else {
scope.Raw(fmt.Sprintf(
"DELETE FROM %v%v%v",
scope.QuotedTableName(),
addExtraSpaceIfExist(scope.CombinedConditionSql()),
addExtraSpaceIfExist(extraOption),
)).Exec()
}
}
}
// addExtraSpaceIfExist adds a separator
func addExtraSpaceIfExist(str string) string {
if str != "" {
return " " + str
}
return ""
}
================================================
FILE: models/tag.go
================================================
package models
import (
"github.com/jinzhu/gorm"
)
type Tag struct {
Model
Name string `json:"name"`
CreatedBy string `json:"created_by"`
ModifiedBy string `json:"modified_by"`
State int `json:"state"`
}
// ExistTagByName checks if there is a tag with the same name
func ExistTagByName(name string) (bool, error) {
var tag Tag
err := db.Select("id").Where("name = ? AND deleted_on = ? ", name, 0).First(&tag).Error
if err != nil && err != gorm.ErrRecordNotFound {
return false, err
}
if tag.ID > 0 {
return true, nil
}
return false, nil
}
// AddTag Add a Tag
func AddTag(name string, state int, createdBy string) error {
tag := Tag{
Name: name,
State: state,
CreatedBy: createdBy,
}
if err := db.Create(&tag).Error; err != nil {
return err
}
return nil
}
// GetTags gets a list of tags based on paging and constraints
func GetTags(pageNum int, pageSize int, maps interface{}) ([]Tag, error) {
var (
tags []Tag
err error
)
if pageSize > 0 && pageNum > 0 {
err = db.Where(maps).Find(&tags).Offset(pageNum).Limit(pageSize).Error
} else {
err = db.Where(maps).Find(&tags).Error
}
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
return tags, nil
}
// GetTagTotal counts the total number of tags based on the constraint
func GetTagTotal(maps interface{}) (int, error) {
var count int
if err := db.Model(&Tag{}).Where(maps).Count(&count).Error; err != nil {
return 0, err
}
return count, nil
}
// ExistTagByID determines whether a Tag exists based on the ID
func ExistTagByID(id int) (bool, error) {
var tag Tag
err := db.Select("id").Where("id = ? AND deleted_on = ? ", id, 0).First(&tag).Error
if err != nil && err != gorm.ErrRecordNotFound {
return false, err
}
if tag.ID > 0 {
return true, nil
}
return false, nil
}
// DeleteTag delete a tag
func DeleteTag(id int) error {
if err := db.Where("id = ?", id).Delete(&Tag{}).Error; err != nil {
return err
}
return nil
}
// EditTag modify a single tag
func EditTag(id int, data interface{}) error {
if err := db.Model(&Tag{}).Where("id = ? AND deleted_on = ? ", id, 0).Updates(data).Error; err != nil {
return err
}
return nil
}
// CleanAllTag clear all tag
func CleanAllTag() (bool, error) {
if err := db.Unscoped().Where("deleted_on != ? ", 0).Delete(&Tag{}).Error; err != nil {
return false, err
}
return true, nil
}
================================================
FILE: pkg/app/form.go
================================================
package app
import (
"github.com/astaxie/beego/validation"
"github.com/gin-gonic/gin"
"net/http"
"github.com/EDDYCJY/go-gin-example/pkg/e"
)
// BindAndValid binds and validates data
func BindAndValid(c *gin.Context, form interface{}) (int, int) {
err := c.Bind(form)
if err != nil {
return http.StatusBadRequest, e.INVALID_PARAMS
}
valid := validation.Validation{}
check, err := valid.Valid(form)
if err != nil {
return http.StatusInternalServerError, e.ERROR
}
if !check {
MarkErrors(valid.Errors)
return http.StatusBadRequest, e.INVALID_PARAMS
}
return http.StatusOK, e.SUCCESS
}
================================================
FILE: pkg/app/request.go
================================================
package app
import (
"github.com/astaxie/beego/validation"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
)
// MarkErrors logs error logs
func MarkErrors(errors []*validation.Error) {
for _, err := range errors {
logging.Info(err.Key, err.Message)
}
return
}
================================================
FILE: pkg/app/response.go
================================================
package app
import (
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/e"
)
type Gin struct {
C *gin.Context
}
type Response struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
// Response setting gin.JSON
func (g *Gin) Response(httpCode, errCode int, data interface{}) {
g.C.JSON(httpCode, Response{
Code: errCode,
Msg: e.GetMsg(errCode),
Data: data,
})
return
}
================================================
FILE: pkg/e/cache.go
================================================
package e
const (
CACHE_ARTICLE = "ARTICLE"
CACHE_TAG = "TAG"
)
================================================
FILE: pkg/e/code.go
================================================
package e
const (
SUCCESS = 200
ERROR = 500
INVALID_PARAMS = 400
ERROR_EXIST_TAG = 10001
ERROR_EXIST_TAG_FAIL = 10002
ERROR_NOT_EXIST_TAG = 10003
ERROR_GET_TAGS_FAIL = 10004
ERROR_COUNT_TAG_FAIL = 10005
ERROR_ADD_TAG_FAIL = 10006
ERROR_EDIT_TAG_FAIL = 10007
ERROR_DELETE_TAG_FAIL = 10008
ERROR_EXPORT_TAG_FAIL = 10009
ERROR_IMPORT_TAG_FAIL = 10010
ERROR_NOT_EXIST_ARTICLE = 10011
ERROR_CHECK_EXIST_ARTICLE_FAIL = 10012
ERROR_ADD_ARTICLE_FAIL = 10013
ERROR_DELETE_ARTICLE_FAIL = 10014
ERROR_EDIT_ARTICLE_FAIL = 10015
ERROR_COUNT_ARTICLE_FAIL = 10016
ERROR_GET_ARTICLES_FAIL = 10017
ERROR_GET_ARTICLE_FAIL = 10018
ERROR_GEN_ARTICLE_POSTER_FAIL = 10019
ERROR_AUTH_CHECK_TOKEN_FAIL = 20001
ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
ERROR_AUTH_TOKEN = 20003
ERROR_AUTH = 20004
ERROR_UPLOAD_SAVE_IMAGE_FAIL = 30001
ERROR_UPLOAD_CHECK_IMAGE_FAIL = 30002
ERROR_UPLOAD_CHECK_IMAGE_FORMAT = 30003
)
================================================
FILE: pkg/e/msg.go
================================================
package e
var MsgFlags = map[int]string{
SUCCESS: "ok",
ERROR: "fail",
INVALID_PARAMS: "请求参数错误",
ERROR_EXIST_TAG: "已存在该标签名称",
ERROR_EXIST_TAG_FAIL: "获取已存在标签失败",
ERROR_NOT_EXIST_TAG: "该标签不存在",
ERROR_GET_TAGS_FAIL: "获取所有标签失败",
ERROR_COUNT_TAG_FAIL: "统计标签失败",
ERROR_ADD_TAG_FAIL: "新增标签失败",
ERROR_EDIT_TAG_FAIL: "修改标签失败",
ERROR_DELETE_TAG_FAIL: "删除标签失败",
ERROR_EXPORT_TAG_FAIL: "导出标签失败",
ERROR_IMPORT_TAG_FAIL: "导入标签失败",
ERROR_NOT_EXIST_ARTICLE: "该文章不存在",
ERROR_ADD_ARTICLE_FAIL: "新增文章失败",
ERROR_DELETE_ARTICLE_FAIL: "删除文章失败",
ERROR_CHECK_EXIST_ARTICLE_FAIL: "检查文章是否存在失败",
ERROR_EDIT_ARTICLE_FAIL: "修改文章失败",
ERROR_COUNT_ARTICLE_FAIL: "统计文章失败",
ERROR_GET_ARTICLES_FAIL: "获取多个文章失败",
ERROR_GET_ARTICLE_FAIL: "获取单个文章失败",
ERROR_GEN_ARTICLE_POSTER_FAIL: "生成文章海报失败",
ERROR_AUTH_CHECK_TOKEN_FAIL: "Token鉴权失败",
ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "Token已超时",
ERROR_AUTH_TOKEN: "Token生成失败",
ERROR_AUTH: "Token错误",
ERROR_UPLOAD_SAVE_IMAGE_FAIL: "保存图片失败",
ERROR_UPLOAD_CHECK_IMAGE_FAIL: "检查图片失败",
ERROR_UPLOAD_CHECK_IMAGE_FORMAT: "校验图片错误,图片格式或大小有问题",
}
// GetMsg get error information based on Code
func GetMsg(code int) string {
msg, ok := MsgFlags[code]
if ok {
return msg
}
return MsgFlags[ERROR]
}
================================================
FILE: pkg/export/excel.go
================================================
package export
import "github.com/EDDYCJY/go-gin-example/pkg/setting"
const EXT = ".xlsx"
// GetExcelFullUrl get the full access path of the Excel file
func GetExcelFullUrl(name string) string {
return setting.AppSetting.PrefixUrl + "/" + GetExcelPath() + name
}
// GetExcelPath get the relative save path of the Excel file
func GetExcelPath() string {
return setting.AppSetting.ExportSavePath
}
// GetExcelFullPath Get the full save path of the Excel file
func GetExcelFullPath() string {
return setting.AppSetting.RuntimeRootPath + GetExcelPath()
}
================================================
FILE: pkg/file/file.go
================================================
package file
import (
"fmt"
"io/ioutil"
"mime/multipart"
"os"
"path"
)
// GetSize get the file size
func GetSize(f multipart.File) (int, error) {
content, err := ioutil.ReadAll(f)
return len(content), err
}
// GetExt get the file ext
func GetExt(fileName string) string {
return path.Ext(fileName)
}
// CheckNotExist check if the file exists
func CheckNotExist(src string) bool {
_, err := os.Stat(src)
return os.IsNotExist(err)
}
// CheckPermission check if the file has permission
func CheckPermission(src string) bool {
_, err := os.Stat(src)
return os.IsPermission(err)
}
// IsNotExistMkDir create a directory if it does not exist
func IsNotExistMkDir(src string) error {
if notExist := CheckNotExist(src); notExist == true {
if err := MkDir(src); err != nil {
return err
}
}
return nil
}
// MkDir create a directory
func MkDir(src string) error {
err := os.MkdirAll(src, os.ModePerm)
if err != nil {
return err
}
return nil
}
// Open a file according to a specific mode
func Open(name string, flag int, perm os.FileMode) (*os.File, error) {
f, err := os.OpenFile(name, flag, perm)
if err != nil {
return nil, err
}
return f, nil
}
// MustOpen maximize trying to open the file
func MustOpen(fileName, filePath string) (*os.File, error) {
dir, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("os.Getwd err: %v", err)
}
src := dir + "/" + filePath
perm := CheckPermission(src)
if perm == true {
return nil, fmt.Errorf("file.CheckPermission Permission denied src: %s", src)
}
err = IsNotExistMkDir(src)
if err != nil {
return nil, fmt.Errorf("file.IsNotExistMkDir src: %s, err: %v", src, err)
}
f, err := Open(src+fileName, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0644)
if err != nil {
return nil, fmt.Errorf("Fail to OpenFile :%v", err)
}
return f, nil
}
================================================
FILE: pkg/gredis/redis.go
================================================
package gredis
import (
"encoding/json"
"time"
"github.com/gomodule/redigo/redis"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
)
var RedisConn *redis.Pool
// Setup Initialize the Redis instance
func Setup() error {
RedisConn = &redis.Pool{
MaxIdle: setting.RedisSetting.MaxIdle,
MaxActive: setting.RedisSetting.MaxActive,
IdleTimeout: setting.RedisSetting.IdleTimeout,
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", setting.RedisSetting.Host)
if err != nil {
return nil, err
}
if setting.RedisSetting.Password != "" {
if _, err := c.Do("AUTH", setting.RedisSetting.Password); err != nil {
c.Close()
return nil, err
}
}
return c, err
},
TestOnBorrow: func(c redis.Conn, t time.Time) error {
_, err := c.Do("PING")
return err
},
}
return nil
}
// Set a key/value
func Set(key string, data interface{}, time int) error {
conn := RedisConn.Get()
defer conn.Close()
value, err := json.Marshal(data)
if err != nil {
return err
}
_, err = conn.Do("SET", key, value)
if err != nil {
return err
}
_, err = conn.Do("EXPIRE", key, time)
if err != nil {
return err
}
return nil
}
// Exists check a key
func Exists(key string) bool {
conn := RedisConn.Get()
defer conn.Close()
exists, err := redis.Bool(conn.Do("EXISTS", key))
if err != nil {
return false
}
return exists
}
// Get get a key
func Get(key string) ([]byte, error) {
conn := RedisConn.Get()
defer conn.Close()
reply, err := redis.Bytes(conn.Do("GET", key))
if err != nil {
return nil, err
}
return reply, nil
}
// Delete delete a kye
func Delete(key string) (bool, error) {
conn := RedisConn.Get()
defer conn.Close()
return redis.Bool(conn.Do("DEL", key))
}
// LikeDeletes batch delete
func LikeDeletes(key string) error {
conn := RedisConn.Get()
defer conn.Close()
keys, err := redis.Strings(conn.Do("KEYS", "*"+key+"*"))
if err != nil {
return err
}
for _, key := range keys {
_, err = Delete(key)
if err != nil {
return err
}
}
return nil
}
================================================
FILE: pkg/logging/file.go
================================================
package logging
import (
"fmt"
"time"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
)
// getLogFilePath get the log file save path
func getLogFilePath() string {
return fmt.Sprintf("%s%s", setting.AppSetting.RuntimeRootPath, setting.AppSetting.LogSavePath)
}
// getLogFileName get the save name of the log file
func getLogFileName() string {
return fmt.Sprintf("%s%s.%s",
setting.AppSetting.LogSaveName,
time.Now().Format(setting.AppSetting.TimeFormat),
setting.AppSetting.LogFileExt,
)
}
================================================
FILE: pkg/logging/log.go
================================================
package logging
import (
"fmt"
"github.com/EDDYCJY/go-gin-example/pkg/file"
"log"
"os"
"path/filepath"
"runtime"
)
type Level int
var (
F *os.File
DefaultPrefix = ""
DefaultCallerDepth = 2
logger *log.Logger
logPrefix = ""
levelFlags = []string{"DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
)
const (
DEBUG Level = iota
INFO
WARNING
ERROR
FATAL
)
// Setup initialize the log instance
func Setup() {
var err error
filePath := getLogFilePath()
fileName := getLogFileName()
F, err = file.MustOpen(fileName, filePath)
if err != nil {
log.Fatalf("logging.Setup err: %v", err)
}
logger = log.New(F, DefaultPrefix, log.LstdFlags)
}
// Debug output logs at debug level
func Debug(v ...interface{}) {
setPrefix(DEBUG)
logger.Println(v)
}
// Info output logs at info level
func Info(v ...interface{}) {
setPrefix(INFO)
logger.Println(v)
}
// Warn output logs at warn level
func Warn(v ...interface{}) {
setPrefix(WARNING)
logger.Println(v)
}
// Error output logs at error level
func Error(v ...interface{}) {
setPrefix(ERROR)
logger.Println(v)
}
// Fatal output logs at fatal level
func Fatal(v ...interface{}) {
setPrefix(FATAL)
logger.Fatalln(v)
}
// setPrefix set the prefix of the log output
func setPrefix(level Level) {
_, file, line, ok := runtime.Caller(DefaultCallerDepth)
if ok {
logPrefix = fmt.Sprintf("[%s][%s:%d]", levelFlags[level], filepath.Base(file), line)
} else {
logPrefix = fmt.Sprintf("[%s]", levelFlags[level])
}
logger.SetPrefix(logPrefix)
}
================================================
FILE: pkg/qrcode/qrcode.go
================================================
package qrcode
import (
"image/jpeg"
"github.com/boombuler/barcode"
"github.com/boombuler/barcode/qr"
"github.com/EDDYCJY/go-gin-example/pkg/file"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/pkg/util"
)
type QrCode struct {
URL string
Width int
Height int
Ext string
Level qr.ErrorCorrectionLevel
Mode qr.Encoding
}
const (
EXT_JPG = ".jpg"
)
// NewQrCode initialize instance
func NewQrCode(url string, width, height int, level qr.ErrorCorrectionLevel, mode qr.Encoding) *QrCode {
return &QrCode{
URL: url,
Width: width,
Height: height,
Level: level,
Mode: mode,
Ext: EXT_JPG,
}
}
// GetQrCodePath get save path
func GetQrCodePath() string {
return setting.AppSetting.QrCodeSavePath
}
// GetQrCodeFullPath get full save path
func GetQrCodeFullPath() string {
return setting.AppSetting.RuntimeRootPath + setting.AppSetting.QrCodeSavePath
}
// GetQrCodeFullUrl get the full access path
func GetQrCodeFullUrl(name string) string {
return setting.AppSetting.PrefixUrl + "/" + GetQrCodePath() + name
}
// GetQrCodeFileName get qr file name
func GetQrCodeFileName(value string) string {
return util.EncodeMD5(value)
}
// GetQrCodeExt get qr file ext
func (q *QrCode) GetQrCodeExt() string {
return q.Ext
}
// Encode generate QR code
func (q *QrCode) Encode(path string) (string, string, error) {
name := GetQrCodeFileName(q.URL) + q.GetQrCodeExt()
src := path + name
if file.CheckNotExist(src) == true {
code, err := qr.Encode(q.URL, q.Level, q.Mode)
if err != nil {
return "", "", err
}
code, err = barcode.Scale(code, q.Width, q.Height)
if err != nil {
return "", "", err
}
f, err := file.MustOpen(name, path)
if err != nil {
return "", "", err
}
defer f.Close()
err = jpeg.Encode(f, code, nil)
if err != nil {
return "", "", err
}
}
return name, path, nil
}
================================================
FILE: pkg/setting/setting.go
================================================
package setting
import (
"log"
"time"
"github.com/go-ini/ini"
)
type App struct {
JwtSecret string
PageSize int
PrefixUrl string
RuntimeRootPath string
ImageSavePath string
ImageMaxSize int
ImageAllowExts []string
ExportSavePath string
QrCodeSavePath string
FontSavePath string
LogSavePath string
LogSaveName string
LogFileExt string
TimeFormat string
}
var AppSetting = &App{}
type Server struct {
RunMode string
HttpPort int
ReadTimeout time.Duration
WriteTimeout time.Duration
}
var ServerSetting = &Server{}
type Database struct {
Type string
User string
Password string
Host string
Name string
TablePrefix string
}
var DatabaseSetting = &Database{}
type Redis struct {
Host string
Password string
MaxIdle int
MaxActive int
IdleTimeout time.Duration
}
var RedisSetting = &Redis{}
var cfg *ini.File
// Setup initialize the configuration instance
func Setup() {
var err error
cfg, err = ini.Load("conf/app.ini")
if err != nil {
log.Fatalf("setting.Setup, fail to parse 'conf/app.ini': %v", err)
}
mapTo("app", AppSetting)
mapTo("server", ServerSetting)
mapTo("database", DatabaseSetting)
mapTo("redis", RedisSetting)
AppSetting.ImageMaxSize = AppSetting.ImageMaxSize * 1024 * 1024
ServerSetting.ReadTimeout = ServerSetting.ReadTimeout * time.Second
ServerSetting.WriteTimeout = ServerSetting.WriteTimeout * time.Second
RedisSetting.IdleTimeout = RedisSetting.IdleTimeout * time.Second
}
// mapTo map section
func mapTo(section string, v interface{}) {
err := cfg.Section(section).MapTo(v)
if err != nil {
log.Fatalf("Cfg.MapTo %s err: %v", section, err)
}
}
================================================
FILE: pkg/upload/image.go
================================================
package upload
import (
"fmt"
"log"
"mime/multipart"
"os"
"path"
"strings"
"github.com/EDDYCJY/go-gin-example/pkg/file"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/pkg/util"
)
// GetImageFullUrl get the full access path
func GetImageFullUrl(name string) string {
return setting.AppSetting.PrefixUrl + "/" + GetImagePath() + name
}
// GetImageName get image name
func GetImageName(name string) string {
ext := path.Ext(name)
fileName := strings.TrimSuffix(name, ext)
fileName = util.EncodeMD5(fileName)
return fileName + ext
}
// GetImagePath get save path
func GetImagePath() string {
return setting.AppSetting.ImageSavePath
}
// GetImageFullPath get full save path
func GetImageFullPath() string {
return setting.AppSetting.RuntimeRootPath + GetImagePath()
}
// CheckImageExt check image file ext
func CheckImageExt(fileName string) bool {
ext := file.GetExt(fileName)
for _, allowExt := range setting.AppSetting.ImageAllowExts {
if strings.ToUpper(allowExt) == strings.ToUpper(ext) {
return true
}
}
return false
}
// CheckImageSize check image size
func CheckImageSize(f multipart.File) bool {
size, err := file.GetSize(f)
if err != nil {
log.Println(err)
logging.Warn(err)
return false
}
return size <= setting.AppSetting.ImageMaxSize
}
// CheckImage check if the file exists
func CheckImage(src string) error {
dir, err := os.Getwd()
if err != nil {
return fmt.Errorf("os.Getwd err: %v", err)
}
err = file.IsNotExistMkDir(dir + "/" + src)
if err != nil {
return fmt.Errorf("file.IsNotExistMkDir err: %v", err)
}
perm := file.CheckPermission(src)
if perm == true {
return fmt.Errorf("file.CheckPermission Permission denied src: %s", src)
}
return nil
}
================================================
FILE: pkg/util/jwt.go
================================================
package util
import (
"time"
"github.com/dgrijalva/jwt-go"
)
var jwtSecret []byte
type Claims struct {
Username string `json:"username"`
Password string `json:"password"`
jwt.StandardClaims
}
// GenerateToken generate tokens used for auth
func GenerateToken(username, password string) (string, error) {
nowTime := time.Now()
expireTime := nowTime.Add(3 * time.Hour)
claims := Claims{
EncodeMD5(username),
EncodeMD5(password),
jwt.StandardClaims{
ExpiresAt: expireTime.Unix(),
Issuer: "gin-blog",
},
}
tokenClaims := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
token, err := tokenClaims.SignedString(jwtSecret)
return token, err
}
// ParseToken parsing token
func ParseToken(token string) (*Claims, error) {
tokenClaims, err := jwt.ParseWithClaims(token, &Claims{}, func(token *jwt.Token) (interface{}, error) {
return jwtSecret, nil
})
if tokenClaims != nil {
if claims, ok := tokenClaims.Claims.(*Claims); ok && tokenClaims.Valid {
return claims, nil
}
}
return nil, err
}
================================================
FILE: pkg/util/md5.go
================================================
package util
import (
"crypto/md5"
"encoding/hex"
)
// EncodeMD5 md5 encryption
func EncodeMD5(value string) string {
m := md5.New()
m.Write([]byte(value))
return hex.EncodeToString(m.Sum(nil))
}
================================================
FILE: pkg/util/pagination.go
================================================
package util
import (
"github.com/unknwon/com"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
)
// GetPage get page parameters
func GetPage(c *gin.Context) int {
result := 0
page := com.StrTo(c.Query("page")).MustInt()
if page > 0 {
result = (page - 1) * setting.AppSetting.PageSize
}
return result
}
================================================
FILE: pkg/util/util.go
================================================
package util
import "github.com/EDDYCJY/go-gin-example/pkg/setting"
// Setup Initialize the util
func Setup() {
jwtSecret = []byte(setting.AppSetting.JwtSecret)
}
================================================
FILE: routers/api/auth.go
================================================
package api
import (
"net/http"
"github.com/astaxie/beego/validation"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/app"
"github.com/EDDYCJY/go-gin-example/pkg/e"
"github.com/EDDYCJY/go-gin-example/pkg/util"
"github.com/EDDYCJY/go-gin-example/service/auth_service"
)
type auth struct {
Username string `valid:"Required; MaxSize(50)"`
Password string `valid:"Required; MaxSize(50)"`
}
// @Summary Get Auth
// @Produce json
// @Param username query string true "userName"
// @Param password query string true "password"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /auth [get]
func GetAuth(c *gin.Context) {
appG := app.Gin{C: c}
valid := validation.Validation{}
username := c.PostForm("username")
password := c.PostForm("password")
a := auth{Username: username, Password: password}
ok, _ := valid.Valid(&a)
if !ok {
app.MarkErrors(valid.Errors)
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
return
}
authService := auth_service.Auth{Username: username, Password: password}
isExist, err := authService.Check()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_AUTH_CHECK_TOKEN_FAIL, nil)
return
}
if !isExist {
appG.Response(http.StatusUnauthorized, e.ERROR_AUTH, nil)
return
}
token, err := util.GenerateToken(username, password)
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_AUTH_TOKEN, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, map[string]string{
"token": token,
})
}
================================================
FILE: routers/api/upload.go
================================================
package api
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/app"
"github.com/EDDYCJY/go-gin-example/pkg/e"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/pkg/upload"
)
// @Summary Import Image
// @Produce json
// @Param image formData file true "Image File"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags/import [post]
func UploadImage(c *gin.Context) {
appG := app.Gin{C: c}
file, image, err := c.Request.FormFile("image")
if err != nil {
logging.Warn(err)
appG.Response(http.StatusInternalServerError, e.ERROR, nil)
return
}
if image == nil {
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
return
}
imageName := upload.GetImageName(image.Filename)
fullPath := upload.GetImageFullPath()
savePath := upload.GetImagePath()
src := fullPath + imageName
if !upload.CheckImageExt(imageName) || !upload.CheckImageSize(file) {
appG.Response(http.StatusBadRequest, e.ERROR_UPLOAD_CHECK_IMAGE_FORMAT, nil)
return
}
err = upload.CheckImage(fullPath)
if err != nil {
logging.Warn(err)
appG.Response(http.StatusInternalServerError, e.ERROR_UPLOAD_CHECK_IMAGE_FAIL, nil)
return
}
if err := c.SaveUploadedFile(image, src); err != nil {
logging.Warn(err)
appG.Response(http.StatusInternalServerError, e.ERROR_UPLOAD_SAVE_IMAGE_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, map[string]string{
"image_url": upload.GetImageFullUrl(imageName),
"image_save_url": savePath + imageName,
})
}
================================================
FILE: routers/api/v1/article.go
================================================
package v1
import (
"net/http"
"github.com/unknwon/com"
"github.com/astaxie/beego/validation"
"github.com/boombuler/barcode/qr"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/app"
"github.com/EDDYCJY/go-gin-example/pkg/e"
"github.com/EDDYCJY/go-gin-example/pkg/qrcode"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/pkg/util"
"github.com/EDDYCJY/go-gin-example/service/article_service"
"github.com/EDDYCJY/go-gin-example/service/tag_service"
)
// @Summary Get a single article
// @Produce json
// @Param id path int true "ID"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/articles/{id} [get]
func GetArticle(c *gin.Context) {
appG := app.Gin{C: c}
id := com.StrTo(c.Param("id")).MustInt()
valid := validation.Validation{}
valid.Min(id, 1, "id")
if valid.HasErrors() {
app.MarkErrors(valid.Errors)
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
return
}
articleService := article_service.Article{ID: id}
exists, err := articleService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_CHECK_EXIST_ARTICLE_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_ARTICLE, nil)
return
}
article, err := articleService.Get()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_GET_ARTICLE_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, article)
}
// @Summary Get multiple articles
// @Produce json
// @Param tag_id body int false "TagID"
// @Param state body int false "State"
// @Param created_by body int false "CreatedBy"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/articles [get]
func GetArticles(c *gin.Context) {
appG := app.Gin{C: c}
valid := validation.Validation{}
state := -1
if arg := c.PostForm("state"); arg != "" {
state = com.StrTo(arg).MustInt()
valid.Range(state, 0, 1, "state")
}
tagId := -1
if arg := c.PostForm("tag_id"); arg != "" {
tagId = com.StrTo(arg).MustInt()
valid.Min(tagId, 1, "tag_id")
}
if valid.HasErrors() {
app.MarkErrors(valid.Errors)
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
return
}
articleService := article_service.Article{
TagID: tagId,
State: state,
PageNum: util.GetPage(c),
PageSize: setting.AppSetting.PageSize,
}
total, err := articleService.Count()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_COUNT_ARTICLE_FAIL, nil)
return
}
articles, err := articleService.GetAll()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_GET_ARTICLES_FAIL, nil)
return
}
data := make(map[string]interface{})
data["lists"] = articles
data["total"] = total
appG.Response(http.StatusOK, e.SUCCESS, data)
}
type AddArticleForm struct {
TagID int `form:"tag_id" valid:"Required;Min(1)"`
Title string `form:"title" valid:"Required;MaxSize(100)"`
Desc string `form:"desc" valid:"Required;MaxSize(255)"`
Content string `form:"content" valid:"Required;MaxSize(65535)"`
CreatedBy string `form:"created_by" valid:"Required;MaxSize(100)"`
CoverImageUrl string `form:"cover_image_url" valid:"Required;MaxSize(255)"`
State int `form:"state" valid:"Range(0,1)"`
}
// @Summary Add article
// @Produce json
// @Param tag_id body int true "TagID"
// @Param title body string true "Title"
// @Param desc body string true "Desc"
// @Param content body string true "Content"
// @Param created_by body string true "CreatedBy"
// @Param state body int true "State"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/articles [post]
func AddArticle(c *gin.Context) {
var (
appG = app.Gin{C: c}
form AddArticleForm
)
httpCode, errCode := app.BindAndValid(c, &form)
if errCode != e.SUCCESS {
appG.Response(httpCode, errCode, nil)
return
}
tagService := tag_service.Tag{ID: form.TagID}
exists, err := tagService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXIST_TAG_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_TAG, nil)
return
}
articleService := article_service.Article{
TagID: form.TagID,
Title: form.Title,
Desc: form.Desc,
Content: form.Content,
CoverImageUrl: form.CoverImageUrl,
State: form.State,
CreatedBy: form.CreatedBy,
}
if err := articleService.Add(); err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_ADD_ARTICLE_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
type EditArticleForm struct {
ID int `form:"id" valid:"Required;Min(1)"`
TagID int `form:"tag_id" valid:"Required;Min(1)"`
Title string `form:"title" valid:"Required;MaxSize(100)"`
Desc string `form:"desc" valid:"Required;MaxSize(255)"`
Content string `form:"content" valid:"Required;MaxSize(65535)"`
ModifiedBy string `form:"modified_by" valid:"Required;MaxSize(100)"`
CoverImageUrl string `form:"cover_image_url" valid:"Required;MaxSize(255)"`
State int `form:"state" valid:"Range(0,1)"`
}
// @Summary Update article
// @Produce json
// @Param id path int true "ID"
// @Param tag_id body string false "TagID"
// @Param title body string false "Title"
// @Param desc body string false "Desc"
// @Param content body string false "Content"
// @Param modified_by body string true "ModifiedBy"
// @Param state body int false "State"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/articles/{id} [put]
func EditArticle(c *gin.Context) {
var (
appG = app.Gin{C: c}
form = EditArticleForm{ID: com.StrTo(c.Param("id")).MustInt()}
)
httpCode, errCode := app.BindAndValid(c, &form)
if errCode != e.SUCCESS {
appG.Response(httpCode, errCode, nil)
return
}
articleService := article_service.Article{
ID: form.ID,
TagID: form.TagID,
Title: form.Title,
Desc: form.Desc,
Content: form.Content,
CoverImageUrl: form.CoverImageUrl,
ModifiedBy: form.ModifiedBy,
State: form.State,
}
exists, err := articleService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_CHECK_EXIST_ARTICLE_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_ARTICLE, nil)
return
}
tagService := tag_service.Tag{ID: form.TagID}
exists, err = tagService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXIST_TAG_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_TAG, nil)
return
}
err = articleService.Edit()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EDIT_ARTICLE_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
// @Summary Delete article
// @Produce json
// @Param id path int true "ID"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/articles/{id} [delete]
func DeleteArticle(c *gin.Context) {
appG := app.Gin{C: c}
valid := validation.Validation{}
id := com.StrTo(c.Param("id")).MustInt()
valid.Min(id, 1, "id").Message("ID必须大于0")
if valid.HasErrors() {
app.MarkErrors(valid.Errors)
appG.Response(http.StatusOK, e.INVALID_PARAMS, nil)
return
}
articleService := article_service.Article{ID: id}
exists, err := articleService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_CHECK_EXIST_ARTICLE_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_ARTICLE, nil)
return
}
err = articleService.Delete()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_DELETE_ARTICLE_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
const (
QRCODE_URL = "https://github.com/EDDYCJY/blog#gin%E7%B3%BB%E5%88%97%E7%9B%AE%E5%BD%95"
)
func GenerateArticlePoster(c *gin.Context) {
appG := app.Gin{C: c}
article := &article_service.Article{}
qr := qrcode.NewQrCode(QRCODE_URL, 300, 300, qr.M, qr.Auto)
posterName := article_service.GetPosterFlag() + "-" + qrcode.GetQrCodeFileName(qr.URL) + qr.GetQrCodeExt()
articlePoster := article_service.NewArticlePoster(posterName, article, qr)
articlePosterBgService := article_service.NewArticlePosterBg(
"bg.jpg",
articlePoster,
&article_service.Rect{
X0: 0,
Y0: 0,
X1: 550,
Y1: 700,
},
&article_service.Pt{
X: 125,
Y: 298,
},
)
_, filePath, err := articlePosterBgService.Generate()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_GEN_ARTICLE_POSTER_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, map[string]string{
"poster_url": qrcode.GetQrCodeFullUrl(posterName),
"poster_save_url": filePath + posterName,
})
}
================================================
FILE: routers/api/v1/tag.go
================================================
package v1
import (
"net/http"
"github.com/unknwon/com"
"github.com/astaxie/beego/validation"
"github.com/gin-gonic/gin"
"github.com/EDDYCJY/go-gin-example/pkg/app"
"github.com/EDDYCJY/go-gin-example/pkg/e"
"github.com/EDDYCJY/go-gin-example/pkg/export"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
"github.com/EDDYCJY/go-gin-example/pkg/util"
"github.com/EDDYCJY/go-gin-example/service/tag_service"
)
// @Summary Get multiple article tags
// @Produce json
// @Param name query string false "Name"
// @Param state query int false "State"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags [get]
func GetTags(c *gin.Context) {
appG := app.Gin{C: c}
name := c.Query("name")
state := -1
if arg := c.Query("state"); arg != "" {
state = com.StrTo(arg).MustInt()
}
tagService := tag_service.Tag{
Name: name,
State: state,
PageNum: util.GetPage(c),
PageSize: setting.AppSetting.PageSize,
}
tags, err := tagService.GetAll()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_GET_TAGS_FAIL, nil)
return
}
count, err := tagService.Count()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_COUNT_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, map[string]interface{}{
"lists": tags,
"total": count,
})
}
type AddTagForm struct {
Name string `form:"name" valid:"Required;MaxSize(100)"`
CreatedBy string `form:"created_by" valid:"Required;MaxSize(100)"`
State int `form:"state" valid:"Range(0,1)"`
}
// @Summary Add article tag
// @Produce json
// @Param name body string true "Name"
// @Param state body int false "State"
// @Param created_by body int false "CreatedBy"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags [post]
func AddTag(c *gin.Context) {
var (
appG = app.Gin{C: c}
form AddTagForm
)
httpCode, errCode := app.BindAndValid(c, &form)
if errCode != e.SUCCESS {
appG.Response(httpCode, errCode, nil)
return
}
tagService := tag_service.Tag{
Name: form.Name,
CreatedBy: form.CreatedBy,
State: form.State,
}
exists, err := tagService.ExistByName()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXIST_TAG_FAIL, nil)
return
}
if exists {
appG.Response(http.StatusOK, e.ERROR_EXIST_TAG, nil)
return
}
err = tagService.Add()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_ADD_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
type EditTagForm struct {
ID int `form:"id" valid:"Required;Min(1)"`
Name string `form:"name" valid:"Required;MaxSize(100)"`
ModifiedBy string `form:"modified_by" valid:"Required;MaxSize(100)"`
State int `form:"state" valid:"Range(0,1)"`
}
// @Summary Update article tag
// @Produce json
// @Param id path int true "ID"
// @Param name body string true "Name"
// @Param state body int false "State"
// @Param modified_by body string true "ModifiedBy"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags/{id} [put]
func EditTag(c *gin.Context) {
var (
appG = app.Gin{C: c}
form = EditTagForm{ID: com.StrTo(c.Param("id")).MustInt()}
)
httpCode, errCode := app.BindAndValid(c, &form)
if errCode != e.SUCCESS {
appG.Response(httpCode, errCode, nil)
return
}
tagService := tag_service.Tag{
ID: form.ID,
Name: form.Name,
ModifiedBy: form.ModifiedBy,
State: form.State,
}
exists, err := tagService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXIST_TAG_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_TAG, nil)
return
}
err = tagService.Edit()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EDIT_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
// @Summary Delete article tag
// @Produce json
// @Param id path int true "ID"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags/{id} [delete]
func DeleteTag(c *gin.Context) {
appG := app.Gin{C: c}
valid := validation.Validation{}
id := com.StrTo(c.Param("id")).MustInt()
valid.Min(id, 1, "id").Message("ID必须大于0")
if valid.HasErrors() {
app.MarkErrors(valid.Errors)
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
}
tagService := tag_service.Tag{ID: id}
exists, err := tagService.ExistByID()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXIST_TAG_FAIL, nil)
return
}
if !exists {
appG.Response(http.StatusOK, e.ERROR_NOT_EXIST_TAG, nil)
return
}
if err := tagService.Delete(); err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_DELETE_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
// @Summary Export article tag
// @Produce json
// @Param name body string false "Name"
// @Param state body int false "State"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags/export [post]
func ExportTag(c *gin.Context) {
appG := app.Gin{C: c}
name := c.PostForm("name")
state := -1
if arg := c.PostForm("state"); arg != "" {
state = com.StrTo(arg).MustInt()
}
tagService := tag_service.Tag{
Name: name,
State: state,
}
filename, err := tagService.Export()
if err != nil {
appG.Response(http.StatusInternalServerError, e.ERROR_EXPORT_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, map[string]string{
"export_url": export.GetExcelFullUrl(filename),
"export_save_url": export.GetExcelPath() + filename,
})
}
// @Summary Import article tag
// @Produce json
// @Param file body file true "Excel File"
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /api/v1/tags/import [post]
func ImportTag(c *gin.Context) {
appG := app.Gin{C: c}
file, _, err := c.Request.FormFile("file")
if err != nil {
logging.Warn(err)
appG.Response(http.StatusInternalServerError, e.ERROR, nil)
return
}
tagService := tag_service.Tag{}
err = tagService.Import(file)
if err != nil {
logging.Warn(err)
appG.Response(http.StatusInternalServerError, e.ERROR_IMPORT_TAG_FAIL, nil)
return
}
appG.Response(http.StatusOK, e.SUCCESS, nil)
}
================================================
FILE: routers/router.go
================================================
package routers
import (
"net/http"
"github.com/gin-gonic/gin"
_ "github.com/EDDYCJY/go-gin-example/docs"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
"github.com/EDDYCJY/go-gin-example/middleware/jwt"
"github.com/EDDYCJY/go-gin-example/pkg/export"
"github.com/EDDYCJY/go-gin-example/pkg/qrcode"
"github.com/EDDYCJY/go-gin-example/pkg/upload"
"github.com/EDDYCJY/go-gin-example/routers/api"
"github.com/EDDYCJY/go-gin-example/routers/api/v1"
)
// InitRouter initialize routing information
func InitRouter() *gin.Engine {
r := gin.New()
r.Use(gin.Logger())
r.Use(gin.Recovery())
r.StaticFS("/export", http.Dir(export.GetExcelFullPath()))
r.StaticFS("/upload/images", http.Dir(upload.GetImageFullPath()))
r.StaticFS("/qrcode", http.Dir(qrcode.GetQrCodeFullPath()))
r.POST("/auth", api.GetAuth)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
r.POST("/upload", api.UploadImage)
apiv1 := r.Group("/api/v1")
apiv1.Use(jwt.JWT())
{
//获取标签列表
apiv1.GET("/tags", v1.GetTags)
//新建标签
apiv1.POST("/tags", v1.AddTag)
//更新指定标签
apiv1.PUT("/tags/:id", v1.EditTag)
//删除指定标签
apiv1.DELETE("/tags/:id", v1.DeleteTag)
//导出标签
r.POST("/tags/export", v1.ExportTag)
//导入标签
r.POST("/tags/import", v1.ImportTag)
//获取文章列表
apiv1.GET("/articles", v1.GetArticles)
//获取指定文章
apiv1.GET("/articles/:id", v1.GetArticle)
//新建文章
apiv1.POST("/articles", v1.AddArticle)
//更新指定文章
apiv1.PUT("/articles/:id", v1.EditArticle)
//删除指定文章
apiv1.DELETE("/articles/:id", v1.DeleteArticle)
//生成文章海报
apiv1.POST("/articles/poster/generate", v1.GenerateArticlePoster)
}
return r
}
================================================
FILE: runtime/fonts/msyhbd.ttc
================================================
[File too large to display: 16.0 MB]
================================================
FILE: service/article_service/article.go
================================================
package article_service
import (
"encoding/json"
"github.com/EDDYCJY/go-gin-example/models"
"github.com/EDDYCJY/go-gin-example/pkg/gredis"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/service/cache_service"
)
type Article struct {
ID int
TagID int
Title string
Desc string
Content string
CoverImageUrl string
State int
CreatedBy string
ModifiedBy string
PageNum int
PageSize int
}
func (a *Article) Add() error {
article := map[string]interface{}{
"tag_id": a.TagID,
"title": a.Title,
"desc": a.Desc,
"content": a.Content,
"created_by": a.CreatedBy,
"cover_image_url": a.CoverImageUrl,
"state": a.State,
}
if err := models.AddArticle(article); err != nil {
return err
}
return nil
}
func (a *Article) Edit() error {
return models.EditArticle(a.ID, map[string]interface{}{
"tag_id": a.TagID,
"title": a.Title,
"desc": a.Desc,
"content": a.Content,
"cover_image_url": a.CoverImageUrl,
"state": a.State,
"modified_by": a.ModifiedBy,
})
}
func (a *Article) Get() (*models.Article, error) {
var cacheArticle *models.Article
cache := cache_service.Article{ID: a.ID}
key := cache.GetArticleKey()
if gredis.Exists(key) {
data, err := gredis.Get(key)
if err != nil {
logging.Info(err)
} else {
json.Unmarshal(data, &cacheArticle)
return cacheArticle, nil
}
}
article, err := models.GetArticle(a.ID)
if err != nil {
return nil, err
}
gredis.Set(key, article, 3600)
return article, nil
}
func (a *Article) GetAll() ([]*models.Article, error) {
var (
articles, cacheArticles []*models.Article
)
cache := cache_service.Article{
TagID: a.TagID,
State: a.State,
PageNum: a.PageNum,
PageSize: a.PageSize,
}
key := cache.GetArticlesKey()
if gredis.Exists(key) {
data, err := gredis.Get(key)
if err != nil {
logging.Info(err)
} else {
json.Unmarshal(data, &cacheArticles)
return cacheArticles, nil
}
}
articles, err := models.GetArticles(a.PageNum, a.PageSize, a.getMaps())
if err != nil {
return nil, err
}
gredis.Set(key, articles, 3600)
return articles, nil
}
func (a *Article) Delete() error {
return models.DeleteArticle(a.ID)
}
func (a *Article) ExistByID() (bool, error) {
return models.ExistArticleByID(a.ID)
}
func (a *Article) Count() (int, error) {
return models.GetArticleTotal(a.getMaps())
}
func (a *Article) getMaps() map[string]interface{} {
maps := make(map[string]interface{})
maps["deleted_on"] = 0
if a.State != -1 {
maps["state"] = a.State
}
if a.TagID != -1 {
maps["tag_id"] = a.TagID
}
return maps
}
================================================
FILE: service/article_service/article_poster.go
================================================
package article_service
import (
"image"
"image/draw"
"image/jpeg"
"io/ioutil"
"os"
"github.com/golang/freetype"
"github.com/EDDYCJY/go-gin-example/pkg/file"
"github.com/EDDYCJY/go-gin-example/pkg/qrcode"
"github.com/EDDYCJY/go-gin-example/pkg/setting"
)
type ArticlePoster struct {
PosterName string
*Article
Qr *qrcode.QrCode
}
func NewArticlePoster(posterName string, article *Article, qr *qrcode.QrCode) *ArticlePoster {
return &ArticlePoster{
PosterName: posterName,
Article: article,
Qr: qr,
}
}
func GetPosterFlag() string {
return "poster"
}
func (a *ArticlePoster) CheckMergedImage(path string) bool {
if file.CheckNotExist(path+a.PosterName) == true {
return false
}
return true
}
func (a *ArticlePoster) OpenMergedImage(path string) (*os.File, error) {
f, err := file.MustOpen(a.PosterName, path)
if err != nil {
return nil, err
}
return f, nil
}
type ArticlePosterBg struct {
Name string
*ArticlePoster
*Rect
*Pt
}
type Rect struct {
Name string
X0 int
Y0 int
X1 int
Y1 int
}
type Pt struct {
X int
Y int
}
func NewArticlePosterBg(name string, ap *ArticlePoster, rect *Rect, pt *Pt) *ArticlePosterBg {
return &ArticlePosterBg{
Name: name,
ArticlePoster: ap,
Rect: rect,
Pt: pt,
}
}
type DrawText struct {
JPG draw.Image
Merged *os.File
Title string
X0 int
Y0 int
Size0 float64
SubTitle string
X1 int
Y1 int
Size1 float64
}
func (a *ArticlePosterBg) DrawPoster(d *DrawText, fontName string) error {
fontSource := setting.AppSetting.RuntimeRootPath + setting.AppSetting.FontSavePath + fontName
fontSourceBytes, err := ioutil.ReadFile(fontSource)
if err != nil {
return err
}
trueTypeFont, err := freetype.ParseFont(fontSourceBytes)
if err != nil {
return err
}
fc := freetype.NewContext()
fc.SetDPI(72)
fc.SetFont(trueTypeFont)
fc.SetFontSize(d.Size0)
fc.SetClip(d.JPG.Bounds())
fc.SetDst(d.JPG)
fc.SetSrc(image.Black)
pt := freetype.Pt(d.X0, d.Y0)
_, err = fc.DrawString(d.Title, pt)
if err != nil {
return err
}
fc.SetFontSize(d.Size1)
_, err = fc.DrawString(d.SubTitle, freetype.Pt(d.X1, d.Y1))
if err != nil {
return err
}
err = jpeg.Encode(d.Merged, d.JPG, nil)
if err != nil {
return err
}
return nil
}
func (a *ArticlePosterBg) Generate() (string, string, error) {
fullPath := qrcode.GetQrCodeFullPath()
fileName, path, err := a.Qr.Encode(fullPath)
if err != nil {
return "", "", err
}
if !a.CheckMergedImage(path) {
mergedF, err := a.OpenMergedImage(path)
if err != nil {
return "", "", err
}
defer mergedF.Close()
bgF, err := file.MustOpen(a.Name, path)
if err != nil {
return "", "", err
}
defer bgF.Close()
qrF, err := file.MustOpen(fileName, path)
if err != nil {
return "", "", err
}
defer qrF.Close()
bgImage, err := jpeg.Decode(bgF)
if err != nil {
return "", "", err
}
qrImage, err := jpeg.Decode(qrF)
if err != nil {
return "", "", err
}
jpg := image.NewRGBA(image.Rect(a.Rect.X0, a.Rect.Y0, a.Rect.X1, a.Rect.Y1))
draw.Draw(jpg, jpg.Bounds(), bgImage, bgImage.Bounds().Min, draw.Over)
draw.Draw(jpg, jpg.Bounds(), qrImage, qrImage.Bounds().Min.Sub(image.Pt(a.Pt.X, a.Pt.Y)), draw.Over)
err = a.DrawPoster(&DrawText{
JPG: jpg,
Merged: mergedF,
Title: "Golang Gin 系列文章",
X0: 80,
Y0: 160,
Size0: 42,
SubTitle: "---煎鱼",
X1: 320,
Y1: 220,
Size1: 36,
}, "msyhbd.ttc")
if err != nil {
return "", "", err
}
}
return fileName, path, nil
}
================================================
FILE: service/auth_service/auth.go
================================================
package auth_service
import "github.com/EDDYCJY/go-gin-example/models"
type Auth struct {
Username string
Password string
}
func (a *Auth) Check() (bool, error) {
return models.CheckAuth(a.Username, a.Password)
}
================================================
FILE: service/cache_service/article.go
================================================
package cache_service
import (
"strconv"
"strings"
"github.com/EDDYCJY/go-gin-example/pkg/e"
)
type Article struct {
ID int
TagID int
State int
PageNum int
PageSize int
}
func (a *Article) GetArticleKey() string {
return e.CACHE_ARTICLE + "_" + strconv.Itoa(a.ID)
}
func (a *Article) GetArticlesKey() string {
keys := []string{
e.CACHE_ARTICLE,
"LIST",
}
if a.ID > 0 {
keys = append(keys, strconv.Itoa(a.ID))
}
if a.TagID > 0 {
keys = append(keys, strconv.Itoa(a.TagID))
}
if a.State >= 0 {
keys = append(keys, strconv.Itoa(a.State))
}
if a.PageNum > 0 {
keys = append(keys, strconv.Itoa(a.PageNum))
}
if a.PageSize > 0 {
keys = append(keys, strconv.Itoa(a.PageSize))
}
return strings.Join(keys, "_")
}
================================================
FILE: service/cache_service/tag.go
================================================
package cache_service
import (
"strconv"
"strings"
"github.com/EDDYCJY/go-gin-example/pkg/e"
)
type Tag struct {
ID int
Name string
State int
PageNum int
PageSize int
}
func (t *Tag) GetTagsKey() string {
keys := []string{
e.CACHE_TAG,
"LIST",
}
if t.Name != "" {
keys = append(keys, t.Name)
}
if t.State >= 0 {
keys = append(keys, strconv.Itoa(t.State))
}
if t.PageNum > 0 {
keys = append(keys, strconv.Itoa(t.PageNum))
}
if t.PageSize > 0 {
keys = append(keys, strconv.Itoa(t.PageSize))
}
return strings.Join(keys, "_")
}
================================================
FILE: service/tag_service/tag.go
================================================
package tag_service
import (
"encoding/json"
"io"
"strconv"
"time"
"github.com/360EntSecGroup-Skylar/excelize"
"github.com/tealeg/xlsx"
"github.com/EDDYCJY/go-gin-example/models"
"github.com/EDDYCJY/go-gin-example/pkg/export"
"github.com/EDDYCJY/go-gin-example/pkg/file"
"github.com/EDDYCJY/go-gin-example/pkg/gredis"
"github.com/EDDYCJY/go-gin-example/pkg/logging"
"github.com/EDDYCJY/go-gin-example/service/cache_service"
)
type Tag struct {
ID int
Name string
CreatedBy string
ModifiedBy string
State int
PageNum int
PageSize int
}
func (t *Tag) ExistByName() (bool, error) {
return models.ExistTagByName(t.Name)
}
func (t *Tag) ExistByID() (bool, error) {
return models.ExistTagByID(t.ID)
}
func (t *Tag) Add() error {
return models.AddTag(t.Name, t.State, t.CreatedBy)
}
func (t *Tag) Edit() error {
data := make(map[string]interface{})
data["modified_by"] = t.ModifiedBy
data["name"] = t.Name
if t.State >= 0 {
data["state"] = t.State
}
return models.EditTag(t.ID, data)
}
func (t *Tag) Delete() error {
return models.DeleteTag(t.ID)
}
func (t *Tag) Count() (int, error) {
return models.GetTagTotal(t.getMaps())
}
func (t *Tag) GetAll() ([]models.Tag, error) {
var (
tags, cacheTags []models.Tag
)
cache := cache_service.Tag{
State: t.State,
PageNum: t.PageNum,
PageSize: t.PageSize,
}
key := cache.GetTagsKey()
if gredis.Exists(key) {
data, err := gredis.Get(key)
if err != nil {
logging.Info(err)
} else {
json.Unmarshal(data, &cacheTags)
return cacheTags, nil
}
}
tags, err := models.GetTags(t.PageNum, t.PageSize, t.getMaps())
if err != nil {
return nil, err
}
gredis.Set(key, tags, 3600)
return tags, nil
}
func (t *Tag) Export() (string, error) {
tags, err := t.GetAll()
if err != nil {
return "", err
}
xlsFile := xlsx.NewFile()
sheet, err := xlsFile.AddSheet("标签信息")
if err != nil {
return "", err
}
titles := []string{"ID", "名称", "创建人", "创建时间", "修改人", "修改时间"}
row := sheet.AddRow()
var cell *xlsx.Cell
for _, title := range titles {
cell = row.AddCell()
cell.Value = title
}
for _, v := range tags {
values := []string{
strconv.Itoa(v.ID),
v.Name,
v.CreatedBy,
strconv.Itoa(v.CreatedOn),
v.ModifiedBy,
strconv.Itoa(v.ModifiedOn),
}
row = sheet.AddRow()
for _, value := range values {
cell = row.AddCell()
cell.Value = value
}
}
time := strconv.Itoa(int(time.Now().Unix()))
filename := "tags-" + time + export.EXT
dirFullPath := export.GetExcelFullPath()
err = file.IsNotExistMkDir(dirFullPath)
if err != nil {
return "", err
}
err = xlsFile.Save(dirFullPath + filename)
if err != nil {
return "", err
}
return filename, nil
}
func (t *Tag) Import(r io.Reader) error {
xlsx, err := excelize.OpenReader(r)
if err != nil {
return err
}
rows := xlsx.GetRows("标签信息")
for irow, row := range rows {
if irow > 0 {
var data []string
for _, cell := range row {
data = append(data, cell)
}
models.AddTag(data[1], 1, data[2])
}
}
return nil
}
func (t *Tag) getMaps() map[string]interface{} {
maps := make(map[string]interface{})
maps["deleted_on"] = 0
if t.Name != "" {
maps["name"] = t.Name
}
if t.State >= 0 {
maps["state"] = t.State
}
return maps
}
================================================
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/.travis.yml
================================================
language: go
install:
- go get -d -t -v ./... && go build -v ./...
go:
- 1.8.x
- 1.9.x
script:
- go vet ./...
- go test ./... -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)
================================================
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [xuri.me](https://xuri.me). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/CONTRIBUTING.md
================================================
# Contributing to excelize
Want to hack on excelize? Awesome! This page contains information about reporting issues as well as some tips and
guidelines useful to experienced open source contributors. Finally, make sure
you read our [community guidelines](#community-guidelines) before you
start participating.
## Topics
* [Reporting Security Issues](#reporting-security-issues)
* [Design and Cleanup Proposals](#design-and-cleanup-proposals)
* [Reporting Issues](#reporting-other-issues)
* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)
* [Community Guidelines](#community-guidelines)
## Reporting security issues
The excelize maintainers take security seriously. If you discover a security
issue, please bring it to their attention right away!
Please **DO NOT** file a public issue, instead send your report privately to
[xuri.me](https://
gitextract_tmwv_ouc/
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── README_ZH.md
├── conf/
│ └── app.ini
├── docs/
│ ├── docs.go
│ ├── sql/
│ │ └── blog.sql
│ ├── swagger/
│ │ ├── swagger.json
│ │ └── swagger.yaml
│ ├── swagger.json
│ └── swagger.yaml
├── go.mod
├── go.sum
├── main.go
├── middleware/
│ └── jwt/
│ └── jwt.go
├── models/
│ ├── article.go
│ ├── auth.go
│ ├── models.go
│ └── tag.go
├── pkg/
│ ├── app/
│ │ ├── form.go
│ │ ├── request.go
│ │ └── response.go
│ ├── e/
│ │ ├── cache.go
│ │ ├── code.go
│ │ └── msg.go
│ ├── export/
│ │ └── excel.go
│ ├── file/
│ │ └── file.go
│ ├── gredis/
│ │ └── redis.go
│ ├── logging/
│ │ ├── file.go
│ │ └── log.go
│ ├── qrcode/
│ │ └── qrcode.go
│ ├── setting/
│ │ └── setting.go
│ ├── upload/
│ │ └── image.go
│ └── util/
│ ├── jwt.go
│ ├── md5.go
│ ├── pagination.go
│ └── util.go
├── routers/
│ ├── api/
│ │ ├── auth.go
│ │ ├── upload.go
│ │ └── v1/
│ │ ├── article.go
│ │ └── tag.go
│ └── router.go
├── runtime/
│ └── fonts/
│ └── msyhbd.ttc
├── service/
│ ├── article_service/
│ │ ├── article.go
│ │ └── article_poster.go
│ ├── auth_service/
│ │ └── auth.go
│ ├── cache_service/
│ │ ├── article.go
│ │ └── tag.go
│ └── tag_service/
│ └── tag.go
└── vendor/
├── github.com/
│ ├── 360EntSecGroup-Skylar/
│ │ └── excelize/
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── README_zh.md
│ │ ├── cell.go
│ │ ├── chart.go
│ │ ├── col.go
│ │ ├── comment.go
│ │ ├── date.go
│ │ ├── excelize.go
│ │ ├── file.go
│ │ ├── lib.go
│ │ ├── picture.go
│ │ ├── rows.go
│ │ ├── shape.go
│ │ ├── sheet.go
│ │ ├── sheetpr.go
│ │ ├── sheetview.go
│ │ ├── styles.go
│ │ ├── table.go
│ │ ├── templates.go
│ │ ├── vmlDrawing.go
│ │ ├── xmlChart.go
│ │ ├── xmlComments.go
│ │ ├── xmlContentTypes.go
│ │ ├── xmlDecodeDrawing.go
│ │ ├── xmlDrawing.go
│ │ ├── xmlSharedStrings.go
│ │ ├── xmlStyles.go
│ │ ├── xmlTable.go
│ │ ├── xmlWorkbook.go
│ │ └── xmlWorksheet.go
│ ├── PuerkitoBio/
│ │ ├── purell/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ └── purell.go
│ │ └── urlesc/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── urlesc.go
│ ├── Unknwon/
│ │ └── com/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── cmd.go
│ │ ├── convert.go
│ │ ├── dir.go
│ │ ├── file.go
│ │ ├── html.go
│ │ ├── http.go
│ │ ├── math.go
│ │ ├── path.go
│ │ ├── regex.go
│ │ ├── slice.go
│ │ ├── string.go
│ │ ├── time.go
│ │ └── url.go
│ ├── alecthomas/
│ │ └── template/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── exec.go
│ │ ├── funcs.go
│ │ ├── go.mod
│ │ ├── helper.go
│ │ ├── parse/
│ │ │ ├── lex.go
│ │ │ ├── node.go
│ │ │ └── parse.go
│ │ └── template.go
│ ├── astaxie/
│ │ └── beego/
│ │ ├── LICENSE
│ │ └── validation/
│ │ ├── README.md
│ │ ├── util.go
│ │ ├── validation.go
│ │ └── validators.go
│ ├── boombuler/
│ │ └── barcode/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── barcode.go
│ │ ├── qr/
│ │ │ ├── alphanumeric.go
│ │ │ ├── automatic.go
│ │ │ ├── blocks.go
│ │ │ ├── encoder.go
│ │ │ ├── errorcorrection.go
│ │ │ ├── numeric.go
│ │ │ ├── qrcode.go
│ │ │ ├── unicode.go
│ │ │ └── versioninfo.go
│ │ ├── scaledbarcode.go
│ │ └── utils/
│ │ ├── base1dcode.go
│ │ ├── bitlist.go
│ │ ├── galoisfield.go
│ │ ├── gfpoly.go
│ │ ├── reedsolomon.go
│ │ └── runeint.go
│ ├── dgrijalva/
│ │ └── jwt-go/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── MIGRATION_GUIDE.md
│ │ ├── README.md
│ │ ├── VERSION_HISTORY.md
│ │ ├── claims.go
│ │ ├── doc.go
│ │ ├── ecdsa.go
│ │ ├── ecdsa_utils.go
│ │ ├── errors.go
│ │ ├── hmac.go
│ │ ├── map_claims.go
│ │ ├── none.go
│ │ ├── parser.go
│ │ ├── rsa.go
│ │ ├── rsa_pss.go
│ │ ├── rsa_utils.go
│ │ ├── signing_method.go
│ │ └── token.go
│ ├── gin-contrib/
│ │ └── sse/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── sse-decoder.go
│ │ ├── sse-encoder.go
│ │ └── writer.go
│ ├── gin-gonic/
│ │ └── gin/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS.md
│ │ ├── BENCHMARKS.md
│ │ ├── CHANGELOG.md
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── auth.go
│ │ ├── binding/
│ │ │ ├── binding.go
│ │ │ ├── default_validator.go
│ │ │ ├── form.go
│ │ │ ├── form_mapping.go
│ │ │ ├── json.go
│ │ │ ├── msgpack.go
│ │ │ ├── protobuf.go
│ │ │ ├── query.go
│ │ │ ├── uri.go
│ │ │ ├── xml.go
│ │ │ └── yaml.go
│ │ ├── codecov.yml
│ │ ├── context.go
│ │ ├── context_appengine.go
│ │ ├── debug.go
│ │ ├── deprecated.go
│ │ ├── doc.go
│ │ ├── errors.go
│ │ ├── fs.go
│ │ ├── gin.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── internal/
│ │ │ └── json/
│ │ │ ├── json.go
│ │ │ └── jsoniter.go
│ │ ├── logger.go
│ │ ├── mode.go
│ │ ├── path.go
│ │ ├── recovery.go
│ │ ├── render/
│ │ │ ├── data.go
│ │ │ ├── html.go
│ │ │ ├── json.go
│ │ │ ├── msgpack.go
│ │ │ ├── protobuf.go
│ │ │ ├── reader.go
│ │ │ ├── redirect.go
│ │ │ ├── render.go
│ │ │ ├── text.go
│ │ │ ├── xml.go
│ │ │ └── yaml.go
│ │ ├── response_writer.go
│ │ ├── routergroup.go
│ │ ├── test_helpers.go
│ │ ├── tree.go
│ │ ├── utils.go
│ │ └── version.go
│ ├── go-ini/
│ │ └── ini/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── README_ZH.md
│ │ ├── error.go
│ │ ├── file.go
│ │ ├── ini.go
│ │ ├── key.go
│ │ ├── parser.go
│ │ ├── section.go
│ │ └── struct.go
│ ├── go-openapi/
│ │ ├── jsonpointer/
│ │ │ ├── .editorconfig
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CODE_OF_CONDUCT.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ └── pointer.go
│ │ ├── jsonreference/
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CODE_OF_CONDUCT.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ └── reference.go
│ │ └── spec/
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── .golangci.yml
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── bindata.go
│ │ ├── cache.go
│ │ ├── contact_info.go
│ │ ├── debug.go
│ │ ├── expander.go
│ │ ├── external_docs.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── header.go
│ │ ├── info.go
│ │ ├── items.go
│ │ ├── license.go
│ │ ├── normalizer.go
│ │ ├── operation.go
│ │ ├── parameter.go
│ │ ├── path_item.go
│ │ ├── paths.go
│ │ ├── ref.go
│ │ ├── response.go
│ │ ├── responses.go
│ │ ├── schema.go
│ │ ├── schema_loader.go
│ │ ├── security_scheme.go
│ │ ├── spec.go
│ │ ├── swagger.go
│ │ ├── tag.go
│ │ ├── unused.go
│ │ └── xml_object.go
│ ├── go-sql-driver/
│ │ └── mysql/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS
│ │ ├── CHANGELOG.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appengine.go
│ │ ├── auth.go
│ │ ├── buffer.go
│ │ ├── collations.go
│ │ ├── conncheck.go
│ │ ├── conncheck_dummy.go
│ │ ├── connection.go
│ │ ├── connector.go
│ │ ├── const.go
│ │ ├── driver.go
│ │ ├── driver_go110.go
│ │ ├── dsn.go
│ │ ├── errors.go
│ │ ├── fields.go
│ │ ├── infile.go
│ │ ├── packets.go
│ │ ├── result.go
│ │ ├── rows.go
│ │ ├── statement.go
│ │ ├── transaction.go
│ │ └── utils.go
│ ├── golang/
│ │ ├── freetype/
│ │ │ ├── AUTHORS
│ │ │ ├── CONTRIBUTORS
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── freetype.go
│ │ │ ├── raster/
│ │ │ │ ├── geom.go
│ │ │ │ ├── paint.go
│ │ │ │ ├── raster.go
│ │ │ │ └── stroke.go
│ │ │ └── truetype/
│ │ │ ├── face.go
│ │ │ ├── glyph.go
│ │ │ ├── hint.go
│ │ │ ├── opcodes.go
│ │ │ └── truetype.go
│ │ └── protobuf/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ └── proto/
│ │ ├── clone.go
│ │ ├── decode.go
│ │ ├── deprecated.go
│ │ ├── discard.go
│ │ ├── encode.go
│ │ ├── equal.go
│ │ ├── extensions.go
│ │ ├── lib.go
│ │ ├── message_set.go
│ │ ├── pointer_reflect.go
│ │ ├── pointer_unsafe.go
│ │ ├── properties.go
│ │ ├── table_marshal.go
│ │ ├── table_merge.go
│ │ ├── table_unmarshal.go
│ │ ├── text.go
│ │ └── text_parser.go
│ ├── gomodule/
│ │ └── redigo/
│ │ ├── LICENSE
│ │ ├── internal/
│ │ │ └── commandinfo.go
│ │ └── redis/
│ │ ├── conn.go
│ │ ├── doc.go
│ │ ├── go16.go
│ │ ├── go17.go
│ │ ├── go18.go
│ │ ├── log.go
│ │ ├── pool.go
│ │ ├── pool17.go
│ │ ├── pubsub.go
│ │ ├── redis.go
│ │ ├── reply.go
│ │ ├── scan.go
│ │ └── script.go
│ ├── jinzhu/
│ │ ├── gorm/
│ │ │ ├── .codeclimate.yml
│ │ │ ├── .gitignore
│ │ │ ├── License
│ │ │ ├── README.md
│ │ │ ├── association.go
│ │ │ ├── callback.go
│ │ │ ├── callback_create.go
│ │ │ ├── callback_delete.go
│ │ │ ├── callback_query.go
│ │ │ ├── callback_query_preload.go
│ │ │ ├── callback_row_query.go
│ │ │ ├── callback_save.go
│ │ │ ├── callback_update.go
│ │ │ ├── dialect.go
│ │ │ ├── dialect_common.go
│ │ │ ├── dialect_mysql.go
│ │ │ ├── dialect_postgres.go
│ │ │ ├── dialect_sqlite3.go
│ │ │ ├── dialects/
│ │ │ │ └── mysql/
│ │ │ │ └── mysql.go
│ │ │ ├── docker-compose.yml
│ │ │ ├── errors.go
│ │ │ ├── field.go
│ │ │ ├── interface.go
│ │ │ ├── join_table_handler.go
│ │ │ ├── logger.go
│ │ │ ├── main.go
│ │ │ ├── model.go
│ │ │ ├── model_struct.go
│ │ │ ├── scope.go
│ │ │ ├── search.go
│ │ │ ├── test_all.sh
│ │ │ ├── utils.go
│ │ │ └── wercker.yml
│ │ └── inflection/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── inflections.go
│ ├── mailru/
│ │ └── easyjson/
│ │ ├── LICENSE
│ │ ├── buffer/
│ │ │ └── pool.go
│ │ ├── jlexer/
│ │ │ ├── bytestostr.go
│ │ │ ├── bytestostr_nounsafe.go
│ │ │ ├── error.go
│ │ │ └── lexer.go
│ │ └── jwriter/
│ │ └── writer.go
│ ├── mattn/
│ │ └── go-isatty/
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── isatty_android.go
│ │ ├── isatty_bsd.go
│ │ ├── isatty_others.go
│ │ ├── isatty_solaris.go
│ │ ├── isatty_tcgets.go
│ │ └── isatty_windows.go
│ ├── modern-go/
│ │ └── concurrent/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── executor.go
│ │ ├── go_above_19.go
│ │ ├── go_below_19.go
│ │ ├── log.go
│ │ ├── test.sh
│ │ └── unbounded_executor.go
│ ├── pkg/
│ │ └── errors/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── appveyor.yml
│ │ ├── errors.go
│ │ └── stack.go
│ ├── swaggo/
│ │ └── swag/
│ │ ├── .gitignore
│ │ ├── .goreleaser.yml
│ │ ├── .travis.yml
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── Makefile
│ │ ├── PULL_REQUEST_TEMPLATE.md
│ │ ├── README.md
│ │ ├── debug.go
│ │ ├── doc.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── license
│ │ ├── operation.go
│ │ ├── parser.go
│ │ ├── property.go
│ │ ├── schema.go
│ │ ├── swagger.go
│ │ └── version.go
│ ├── tealeg/
│ │ └── xlsx/
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── AUTHORS.txt
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── LICENSE
│ │ ├── README.org
│ │ ├── cell.go
│ │ ├── col.go
│ │ ├── date.go
│ │ ├── doc.go
│ │ ├── file.go
│ │ ├── format_code.go
│ │ ├── hsl.go
│ │ ├── lib.go
│ │ ├── read.go
│ │ ├── reftable.go
│ │ ├── row.go
│ │ ├── sheet.go
│ │ ├── stream_file.go
│ │ ├── stream_file_builder.go
│ │ ├── style.go
│ │ ├── templates.go
│ │ ├── theme.go
│ │ ├── write.go
│ │ ├── xmlContentTypes.go
│ │ ├── xmlSharedStrings.go
│ │ ├── xmlStyle.go
│ │ ├── xmlTheme.go
│ │ ├── xmlWorkbook.go
│ │ └── xmlWorksheet.go
│ ├── ugorji/
│ │ └── go/
│ │ └── codec/
│ │ ├── 0_importpath.go
│ │ ├── LICENSE
│ │ ├── binc.go
│ │ ├── build.sh
│ │ ├── cbor.go
│ │ ├── codecgen.go
│ │ ├── decode.go
│ │ ├── doc.go
│ │ ├── encode.go
│ │ ├── fast-path.generated.go
│ │ ├── fast-path.go.tmpl
│ │ ├── fast-path.not.go
│ │ ├── gen-dec-array.go.tmpl
│ │ ├── gen-dec-map.go.tmpl
│ │ ├── gen-enc-chan.go.tmpl
│ │ ├── gen-helper.generated.go
│ │ ├── gen-helper.go.tmpl
│ │ ├── gen.generated.go
│ │ ├── gen.go
│ │ ├── go.mod
│ │ ├── goversion_arrayof_gte_go15.go
│ │ ├── goversion_arrayof_lt_go15.go
│ │ ├── goversion_makemap_gte_go19.go
│ │ ├── goversion_makemap_lt_go19.go
│ │ ├── goversion_unexportedembeddedptr_gte_go110.go
│ │ ├── goversion_unexportedembeddedptr_lt_go110.go
│ │ ├── goversion_unsupported_lt_go14.go
│ │ ├── goversion_vendor_eq_go15.go
│ │ ├── goversion_vendor_eq_go16.go
│ │ ├── goversion_vendor_gte_go17.go
│ │ ├── goversion_vendor_lt_go15.go
│ │ ├── helper.go
│ │ ├── helper_internal.go
│ │ ├── helper_not_unsafe.go
│ │ ├── helper_unsafe.go
│ │ ├── json.go
│ │ ├── mammoth-test.go.tmpl
│ │ ├── mammoth2-test.go.tmpl
│ │ ├── msgpack.go
│ │ ├── prebuild.go
│ │ ├── rpc.go
│ │ ├── simple.go
│ │ ├── sort-slice.generated.go
│ │ ├── sort-slice.go.tmpl
│ │ ├── test-cbor-goldens.json
│ │ └── test.py
│ └── unknwon/
│ └── com/
│ ├── go.mod
│ └── go.sum
├── golang.org/
│ └── x/
│ ├── image/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── font/
│ │ │ └── font.go
│ │ └── math/
│ │ └── fixed/
│ │ └── fixed.go
│ ├── net/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── context/
│ │ │ ├── context.go
│ │ │ ├── go17.go
│ │ │ ├── go19.go
│ │ │ ├── pre_go17.go
│ │ │ └── pre_go19.go
│ │ ├── idna/
│ │ │ ├── idna10.0.0.go
│ │ │ ├── idna9.0.0.go
│ │ │ ├── punycode.go
│ │ │ ├── tables10.0.0.go
│ │ │ ├── tables11.0.0.go
│ │ │ ├── tables9.0.0.go
│ │ │ ├── trie.go
│ │ │ └── trieval.go
│ │ └── webdav/
│ │ ├── file.go
│ │ ├── if.go
│ │ ├── internal/
│ │ │ └── xml/
│ │ │ ├── README
│ │ │ ├── marshal.go
│ │ │ ├── read.go
│ │ │ ├── typeinfo.go
│ │ │ └── xml.go
│ │ ├── lock.go
│ │ ├── prop.go
│ │ ├── webdav.go
│ │ └── xml.go
│ ├── sys/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ └── unix/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── affinity_linux.go
│ │ ├── aliases.go
│ │ ├── asm_aix_ppc64.s
│ │ ├── asm_darwin_386.s
│ │ ├── asm_darwin_amd64.s
│ │ ├── asm_darwin_arm.s
│ │ ├── asm_darwin_arm64.s
│ │ ├── asm_dragonfly_amd64.s
│ │ ├── asm_freebsd_386.s
│ │ ├── asm_freebsd_amd64.s
│ │ ├── asm_freebsd_arm.s
│ │ ├── asm_freebsd_arm64.s
│ │ ├── asm_linux_386.s
│ │ ├── asm_linux_amd64.s
│ │ ├── asm_linux_arm.s
│ │ ├── asm_linux_arm64.s
│ │ ├── asm_linux_mips64x.s
│ │ ├── asm_linux_mipsx.s
│ │ ├── asm_linux_ppc64x.s
│ │ ├── asm_linux_riscv64.s
│ │ ├── asm_linux_s390x.s
│ │ ├── asm_netbsd_386.s
│ │ ├── asm_netbsd_amd64.s
│ │ ├── asm_netbsd_arm.s
│ │ ├── asm_netbsd_arm64.s
│ │ ├── asm_openbsd_386.s
│ │ ├── asm_openbsd_amd64.s
│ │ ├── asm_openbsd_arm.s
│ │ ├── asm_openbsd_arm64.s
│ │ ├── asm_solaris_amd64.s
│ │ ├── bluetooth_linux.go
│ │ ├── cap_freebsd.go
│ │ ├── constants.go
│ │ ├── dev_aix_ppc.go
│ │ ├── dev_aix_ppc64.go
│ │ ├── dev_darwin.go
│ │ ├── dev_dragonfly.go
│ │ ├── dev_freebsd.go
│ │ ├── dev_linux.go
│ │ ├── dev_netbsd.go
│ │ ├── dev_openbsd.go
│ │ ├── dirent.go
│ │ ├── endian_big.go
│ │ ├── endian_little.go
│ │ ├── env_unix.go
│ │ ├── errors_freebsd_386.go
│ │ ├── errors_freebsd_amd64.go
│ │ ├── errors_freebsd_arm.go
│ │ ├── fcntl.go
│ │ ├── fcntl_darwin.go
│ │ ├── fcntl_linux_32bit.go
│ │ ├── gccgo.go
│ │ ├── gccgo_c.c
│ │ ├── gccgo_linux_amd64.go
│ │ ├── ioctl.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── pagesize_unix.go
│ │ ├── pledge_openbsd.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── readdirent_getdents.go
│ │ ├── readdirent_getdirentries.go
│ │ ├── sockcmsg_linux.go
│ │ ├── sockcmsg_unix.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_aix.go
│ │ ├── syscall_aix_ppc.go
│ │ ├── syscall_aix_ppc64.go
│ │ ├── syscall_bsd.go
│ │ ├── syscall_darwin.go
│ │ ├── syscall_darwin_386.go
│ │ ├── syscall_darwin_amd64.go
│ │ ├── syscall_darwin_arm.go
│ │ ├── syscall_darwin_arm64.go
│ │ ├── syscall_darwin_libSystem.go
│ │ ├── syscall_dragonfly.go
│ │ ├── syscall_dragonfly_amd64.go
│ │ ├── syscall_freebsd.go
│ │ ├── syscall_freebsd_386.go
│ │ ├── syscall_freebsd_amd64.go
│ │ ├── syscall_freebsd_arm.go
│ │ ├── syscall_freebsd_arm64.go
│ │ ├── syscall_linux.go
│ │ ├── syscall_linux_386.go
│ │ ├── syscall_linux_amd64.go
│ │ ├── syscall_linux_amd64_gc.go
│ │ ├── syscall_linux_arm.go
│ │ ├── syscall_linux_arm64.go
│ │ ├── syscall_linux_gc.go
│ │ ├── syscall_linux_gc_386.go
│ │ ├── syscall_linux_gccgo_386.go
│ │ ├── syscall_linux_gccgo_arm.go
│ │ ├── syscall_linux_mips64x.go
│ │ ├── syscall_linux_mipsx.go
│ │ ├── syscall_linux_ppc64x.go
│ │ ├── syscall_linux_riscv64.go
│ │ ├── syscall_linux_s390x.go
│ │ ├── syscall_linux_sparc64.go
│ │ ├── syscall_netbsd.go
│ │ ├── syscall_netbsd_386.go
│ │ ├── syscall_netbsd_amd64.go
│ │ ├── syscall_netbsd_arm.go
│ │ ├── syscall_netbsd_arm64.go
│ │ ├── syscall_openbsd.go
│ │ ├── syscall_openbsd_386.go
│ │ ├── syscall_openbsd_amd64.go
│ │ ├── syscall_openbsd_arm.go
│ │ ├── syscall_openbsd_arm64.go
│ │ ├── syscall_solaris.go
│ │ ├── syscall_solaris_amd64.go
│ │ ├── syscall_unix.go
│ │ ├── syscall_unix_gc.go
│ │ ├── syscall_unix_gc_ppc64x.go
│ │ ├── timestruct.go
│ │ ├── unveil_openbsd.go
│ │ ├── xattr_bsd.go
│ │ ├── zerrors_aix_ppc.go
│ │ ├── zerrors_aix_ppc64.go
│ │ ├── zerrors_darwin_386.go
│ │ ├── zerrors_darwin_amd64.go
│ │ ├── zerrors_darwin_arm.go
│ │ ├── zerrors_darwin_arm64.go
│ │ ├── zerrors_dragonfly_amd64.go
│ │ ├── zerrors_freebsd_386.go
│ │ ├── zerrors_freebsd_amd64.go
│ │ ├── zerrors_freebsd_arm.go
│ │ ├── zerrors_freebsd_arm64.go
│ │ ├── zerrors_linux_386.go
│ │ ├── zerrors_linux_amd64.go
│ │ ├── zerrors_linux_arm.go
│ │ ├── zerrors_linux_arm64.go
│ │ ├── zerrors_linux_mips.go
│ │ ├── zerrors_linux_mips64.go
│ │ ├── zerrors_linux_mips64le.go
│ │ ├── zerrors_linux_mipsle.go
│ │ ├── zerrors_linux_ppc64.go
│ │ ├── zerrors_linux_ppc64le.go
│ │ ├── zerrors_linux_riscv64.go
│ │ ├── zerrors_linux_s390x.go
│ │ ├── zerrors_linux_sparc64.go
│ │ ├── zerrors_netbsd_386.go
│ │ ├── zerrors_netbsd_amd64.go
│ │ ├── zerrors_netbsd_arm.go
│ │ ├── zerrors_netbsd_arm64.go
│ │ ├── zerrors_openbsd_386.go
│ │ ├── zerrors_openbsd_amd64.go
│ │ ├── zerrors_openbsd_arm.go
│ │ ├── zerrors_openbsd_arm64.go
│ │ ├── zerrors_solaris_amd64.go
│ │ ├── zptrace386_linux.go
│ │ ├── zptracearm_linux.go
│ │ ├── zptracemips_linux.go
│ │ ├── zptracemipsle_linux.go
│ │ ├── zsyscall_aix_ppc.go
│ │ ├── zsyscall_aix_ppc64.go
│ │ ├── zsyscall_aix_ppc64_gc.go
│ │ ├── zsyscall_aix_ppc64_gccgo.go
│ │ ├── zsyscall_darwin_386.1_11.go
│ │ ├── zsyscall_darwin_386.go
│ │ ├── zsyscall_darwin_386.s
│ │ ├── zsyscall_darwin_amd64.1_11.go
│ │ ├── zsyscall_darwin_amd64.go
│ │ ├── zsyscall_darwin_amd64.s
│ │ ├── zsyscall_darwin_arm.1_11.go
│ │ ├── zsyscall_darwin_arm.go
│ │ ├── zsyscall_darwin_arm.s
│ │ ├── zsyscall_darwin_arm64.1_11.go
│ │ ├── zsyscall_darwin_arm64.go
│ │ ├── zsyscall_darwin_arm64.s
│ │ ├── zsyscall_dragonfly_amd64.go
│ │ ├── zsyscall_freebsd_386.go
│ │ ├── zsyscall_freebsd_amd64.go
│ │ ├── zsyscall_freebsd_arm.go
│ │ ├── zsyscall_freebsd_arm64.go
│ │ ├── zsyscall_linux_386.go
│ │ ├── zsyscall_linux_amd64.go
│ │ ├── zsyscall_linux_arm.go
│ │ ├── zsyscall_linux_arm64.go
│ │ ├── zsyscall_linux_mips.go
│ │ ├── zsyscall_linux_mips64.go
│ │ ├── zsyscall_linux_mips64le.go
│ │ ├── zsyscall_linux_mipsle.go
│ │ ├── zsyscall_linux_ppc64.go
│ │ ├── zsyscall_linux_ppc64le.go
│ │ ├── zsyscall_linux_riscv64.go
│ │ ├── zsyscall_linux_s390x.go
│ │ ├── zsyscall_linux_sparc64.go
│ │ ├── zsyscall_netbsd_386.go
│ │ ├── zsyscall_netbsd_amd64.go
│ │ ├── zsyscall_netbsd_arm.go
│ │ ├── zsyscall_netbsd_arm64.go
│ │ ├── zsyscall_openbsd_386.go
│ │ ├── zsyscall_openbsd_amd64.go
│ │ ├── zsyscall_openbsd_arm.go
│ │ ├── zsyscall_openbsd_arm64.go
│ │ ├── zsyscall_solaris_amd64.go
│ │ ├── zsysctl_openbsd_386.go
│ │ ├── zsysctl_openbsd_amd64.go
│ │ ├── zsysctl_openbsd_arm.go
│ │ ├── zsysctl_openbsd_arm64.go
│ │ ├── zsysnum_darwin_386.go
│ │ ├── zsysnum_darwin_amd64.go
│ │ ├── zsysnum_darwin_arm.go
│ │ ├── zsysnum_darwin_arm64.go
│ │ ├── zsysnum_dragonfly_amd64.go
│ │ ├── zsysnum_freebsd_386.go
│ │ ├── zsysnum_freebsd_amd64.go
│ │ ├── zsysnum_freebsd_arm.go
│ │ ├── zsysnum_freebsd_arm64.go
│ │ ├── zsysnum_linux_386.go
│ │ ├── zsysnum_linux_amd64.go
│ │ ├── zsysnum_linux_arm.go
│ │ ├── zsysnum_linux_arm64.go
│ │ ├── zsysnum_linux_mips.go
│ │ ├── zsysnum_linux_mips64.go
│ │ ├── zsysnum_linux_mips64le.go
│ │ ├── zsysnum_linux_mipsle.go
│ │ ├── zsysnum_linux_ppc64.go
│ │ ├── zsysnum_linux_ppc64le.go
│ │ ├── zsysnum_linux_riscv64.go
│ │ ├── zsysnum_linux_s390x.go
│ │ ├── zsysnum_linux_sparc64.go
│ │ ├── zsysnum_netbsd_386.go
│ │ ├── zsysnum_netbsd_amd64.go
│ │ ├── zsysnum_netbsd_arm.go
│ │ ├── zsysnum_netbsd_arm64.go
│ │ ├── zsysnum_openbsd_386.go
│ │ ├── zsysnum_openbsd_amd64.go
│ │ ├── zsysnum_openbsd_arm.go
│ │ ├── zsysnum_openbsd_arm64.go
│ │ ├── ztypes_aix_ppc.go
│ │ ├── ztypes_aix_ppc64.go
│ │ ├── ztypes_darwin_386.go
│ │ ├── ztypes_darwin_amd64.go
│ │ ├── ztypes_darwin_arm.go
│ │ ├── ztypes_darwin_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_freebsd_arm64.go
│ │ ├── ztypes_linux_386.go
│ │ ├── ztypes_linux_amd64.go
│ │ ├── ztypes_linux_arm.go
│ │ ├── ztypes_linux_arm64.go
│ │ ├── ztypes_linux_mips.go
│ │ ├── ztypes_linux_mips64.go
│ │ ├── ztypes_linux_mips64le.go
│ │ ├── ztypes_linux_mipsle.go
│ │ ├── ztypes_linux_ppc64.go
│ │ ├── ztypes_linux_ppc64le.go
│ │ ├── ztypes_linux_riscv64.go
│ │ ├── ztypes_linux_s390x.go
│ │ ├── ztypes_linux_sparc64.go
│ │ ├── ztypes_netbsd_386.go
│ │ ├── ztypes_netbsd_amd64.go
│ │ ├── ztypes_netbsd_arm.go
│ │ ├── ztypes_netbsd_arm64.go
│ │ ├── ztypes_openbsd_386.go
│ │ ├── ztypes_openbsd_amd64.go
│ │ ├── ztypes_openbsd_arm.go
│ │ ├── ztypes_openbsd_arm64.go
│ │ └── ztypes_solaris_amd64.go
│ ├── text/
│ │ ├── AUTHORS
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ ├── secure/
│ │ │ └── bidirule/
│ │ │ ├── bidirule.go
│ │ │ ├── bidirule10.0.0.go
│ │ │ └── bidirule9.0.0.go
│ │ ├── transform/
│ │ │ └── transform.go
│ │ ├── unicode/
│ │ │ ├── bidi/
│ │ │ │ ├── bidi.go
│ │ │ │ ├── bracket.go
│ │ │ │ ├── core.go
│ │ │ │ ├── prop.go
│ │ │ │ ├── tables10.0.0.go
│ │ │ │ ├── tables11.0.0.go
│ │ │ │ ├── tables9.0.0.go
│ │ │ │ └── trieval.go
│ │ │ └── norm/
│ │ │ ├── composition.go
│ │ │ ├── forminfo.go
│ │ │ ├── input.go
│ │ │ ├── iter.go
│ │ │ ├── normalize.go
│ │ │ ├── readwriter.go
│ │ │ ├── tables10.0.0.go
│ │ │ ├── tables11.0.0.go
│ │ │ ├── tables9.0.0.go
│ │ │ ├── transform.go
│ │ │ └── trie.go
│ │ └── width/
│ │ ├── kind_string.go
│ │ ├── tables10.0.0.go
│ │ ├── tables11.0.0.go
│ │ ├── tables9.0.0.go
│ │ ├── transform.go
│ │ ├── trieval.go
│ │ └── width.go
│ └── tools/
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ └── go/
│ ├── ast/
│ │ └── astutil/
│ │ ├── enclosing.go
│ │ ├── imports.go
│ │ ├── rewrite.go
│ │ └── util.go
│ ├── buildutil/
│ │ ├── allpackages.go
│ │ ├── fakecontext.go
│ │ ├── overlay.go
│ │ ├── tags.go
│ │ └── util.go
│ ├── internal/
│ │ └── cgo/
│ │ ├── cgo.go
│ │ └── cgo_pkgconfig.go
│ └── loader/
│ ├── doc.go
│ ├── loader.go
│ └── util.go
├── google.golang.org/
│ └── appengine/
│ ├── LICENSE
│ └── cloudsql/
│ ├── cloudsql.go
│ ├── cloudsql_classic.go
│ └── cloudsql_vm.go
├── gopkg.in/
│ ├── go-playground/
│ │ └── validator.v8/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── baked_in.go
│ │ ├── cache.go
│ │ ├── doc.go
│ │ ├── regexes.go
│ │ ├── util.go
│ │ └── validator.go
│ └── yaml.v2/
│ ├── .travis.yml
│ ├── LICENSE
│ ├── LICENSE.libyaml
│ ├── NOTICE
│ ├── README.md
│ ├── apic.go
│ ├── decode.go
│ ├── emitterc.go
│ ├── encode.go
│ ├── go.mod
│ ├── parserc.go
│ ├── readerc.go
│ ├── resolve.go
│ ├── scannerc.go
│ ├── sorter.go
│ ├── writerc.go
│ ├── yaml.go
│ ├── yamlh.go
│ └── yamlprivateh.go
└── modules.txt
Showing preview only (9,218K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (115893 symbols across 679 files)
FILE: docs/docs.go
type swaggerInfo (line 592) | type swaggerInfo struct
type s (line 611) | type s struct
method ReadDoc (line 613) | func (s *s) ReadDoc() string {
function init (line 635) | func init() {
FILE: docs/sql/blog.sql
type `blog_article` (line 19) | CREATE TABLE `blog_article` (
type `blog_auth` (line 39) | CREATE TABLE `blog_auth` (
type `blog_tag` (line 52) | CREATE TABLE `blog_tag` (
FILE: main.go
function init (line 18) | func init() {
function main (line 32) | func main() {
FILE: middleware/jwt/jwt.go
function JWT (line 14) | func JWT() gin.HandlerFunc {
FILE: models/article.go
type Article (line 7) | type Article struct
function ExistArticleByID (line 23) | func ExistArticleByID(id int) (bool, error) {
function GetArticleTotal (line 38) | func GetArticleTotal(maps interface{}) (int, error) {
function GetArticles (line 48) | func GetArticles(pageNum int, pageSize int, maps interface{}) ([]*Articl...
function GetArticle (line 59) | func GetArticle(id int) (*Article, error) {
function EditArticle (line 75) | func EditArticle(id int, data interface{}) error {
function AddArticle (line 84) | func AddArticle(data map[string]interface{}) error {
function DeleteArticle (line 102) | func DeleteArticle(id int) error {
function CleanAllArticle (line 111) | func CleanAllArticle() error {
FILE: models/auth.go
type Auth (line 5) | type Auth struct
function CheckAuth (line 12) | func CheckAuth(username, password string) (bool, error) {
FILE: models/models.go
type Model (line 16) | type Model struct
function Setup (line 24) | func Setup() {
function CloseDB (line 49) | func CloseDB() {
function updateTimeStampForCreateCallback (line 54) | func updateTimeStampForCreateCallback(scope *gorm.Scope) {
function updateTimeStampForUpdateCallback (line 72) | func updateTimeStampForUpdateCallback(scope *gorm.Scope) {
function deleteCallback (line 79) | func deleteCallback(scope *gorm.Scope) {
function addExtraSpaceIfExist (line 109) | func addExtraSpaceIfExist(str string) string {
FILE: models/tag.go
type Tag (line 7) | type Tag struct
function ExistTagByName (line 17) | func ExistTagByName(name string) (bool, error) {
function AddTag (line 32) | func AddTag(name string, state int, createdBy string) error {
function GetTags (line 46) | func GetTags(pageNum int, pageSize int, maps interface{}) ([]Tag, error) {
function GetTagTotal (line 66) | func GetTagTotal(maps interface{}) (int, error) {
function ExistTagByID (line 76) | func ExistTagByID(id int) (bool, error) {
function DeleteTag (line 90) | func DeleteTag(id int) error {
function EditTag (line 99) | func EditTag(id int, data interface{}) error {
function CleanAllTag (line 108) | func CleanAllTag() (bool, error) {
FILE: pkg/app/form.go
function BindAndValid (line 12) | func BindAndValid(c *gin.Context, form interface{}) (int, int) {
FILE: pkg/app/request.go
function MarkErrors (line 10) | func MarkErrors(errors []*validation.Error) {
FILE: pkg/app/response.go
type Gin (line 9) | type Gin struct
method Response (line 20) | func (g *Gin) Response(httpCode, errCode int, data interface{}) {
type Response (line 13) | type Response struct
FILE: pkg/e/cache.go
constant CACHE_ARTICLE (line 4) | CACHE_ARTICLE = "ARTICLE"
constant CACHE_TAG (line 5) | CACHE_TAG = "TAG"
FILE: pkg/e/code.go
constant SUCCESS (line 4) | SUCCESS = 200
constant ERROR (line 5) | ERROR = 500
constant INVALID_PARAMS (line 6) | INVALID_PARAMS = 400
constant ERROR_EXIST_TAG (line 8) | ERROR_EXIST_TAG = 10001
constant ERROR_EXIST_TAG_FAIL (line 9) | ERROR_EXIST_TAG_FAIL = 10002
constant ERROR_NOT_EXIST_TAG (line 10) | ERROR_NOT_EXIST_TAG = 10003
constant ERROR_GET_TAGS_FAIL (line 11) | ERROR_GET_TAGS_FAIL = 10004
constant ERROR_COUNT_TAG_FAIL (line 12) | ERROR_COUNT_TAG_FAIL = 10005
constant ERROR_ADD_TAG_FAIL (line 13) | ERROR_ADD_TAG_FAIL = 10006
constant ERROR_EDIT_TAG_FAIL (line 14) | ERROR_EDIT_TAG_FAIL = 10007
constant ERROR_DELETE_TAG_FAIL (line 15) | ERROR_DELETE_TAG_FAIL = 10008
constant ERROR_EXPORT_TAG_FAIL (line 16) | ERROR_EXPORT_TAG_FAIL = 10009
constant ERROR_IMPORT_TAG_FAIL (line 17) | ERROR_IMPORT_TAG_FAIL = 10010
constant ERROR_NOT_EXIST_ARTICLE (line 19) | ERROR_NOT_EXIST_ARTICLE = 10011
constant ERROR_CHECK_EXIST_ARTICLE_FAIL (line 20) | ERROR_CHECK_EXIST_ARTICLE_FAIL = 10012
constant ERROR_ADD_ARTICLE_FAIL (line 21) | ERROR_ADD_ARTICLE_FAIL = 10013
constant ERROR_DELETE_ARTICLE_FAIL (line 22) | ERROR_DELETE_ARTICLE_FAIL = 10014
constant ERROR_EDIT_ARTICLE_FAIL (line 23) | ERROR_EDIT_ARTICLE_FAIL = 10015
constant ERROR_COUNT_ARTICLE_FAIL (line 24) | ERROR_COUNT_ARTICLE_FAIL = 10016
constant ERROR_GET_ARTICLES_FAIL (line 25) | ERROR_GET_ARTICLES_FAIL = 10017
constant ERROR_GET_ARTICLE_FAIL (line 26) | ERROR_GET_ARTICLE_FAIL = 10018
constant ERROR_GEN_ARTICLE_POSTER_FAIL (line 27) | ERROR_GEN_ARTICLE_POSTER_FAIL = 10019
constant ERROR_AUTH_CHECK_TOKEN_FAIL (line 29) | ERROR_AUTH_CHECK_TOKEN_FAIL = 20001
constant ERROR_AUTH_CHECK_TOKEN_TIMEOUT (line 30) | ERROR_AUTH_CHECK_TOKEN_TIMEOUT = 20002
constant ERROR_AUTH_TOKEN (line 31) | ERROR_AUTH_TOKEN = 20003
constant ERROR_AUTH (line 32) | ERROR_AUTH = 20004
constant ERROR_UPLOAD_SAVE_IMAGE_FAIL (line 34) | ERROR_UPLOAD_SAVE_IMAGE_FAIL = 30001
constant ERROR_UPLOAD_CHECK_IMAGE_FAIL (line 35) | ERROR_UPLOAD_CHECK_IMAGE_FAIL = 30002
constant ERROR_UPLOAD_CHECK_IMAGE_FORMAT (line 36) | ERROR_UPLOAD_CHECK_IMAGE_FORMAT = 30003
FILE: pkg/e/msg.go
function GetMsg (line 36) | func GetMsg(code int) string {
FILE: pkg/export/excel.go
constant EXT (line 5) | EXT = ".xlsx"
function GetExcelFullUrl (line 8) | func GetExcelFullUrl(name string) string {
function GetExcelPath (line 13) | func GetExcelPath() string {
function GetExcelFullPath (line 18) | func GetExcelFullPath() string {
FILE: pkg/file/file.go
function GetSize (line 12) | func GetSize(f multipart.File) (int, error) {
function GetExt (line 19) | func GetExt(fileName string) string {
function CheckNotExist (line 24) | func CheckNotExist(src string) bool {
function CheckPermission (line 31) | func CheckPermission(src string) bool {
function IsNotExistMkDir (line 38) | func IsNotExistMkDir(src string) error {
function MkDir (line 49) | func MkDir(src string) error {
function Open (line 59) | func Open(name string, flag int, perm os.FileMode) (*os.File, error) {
function MustOpen (line 69) | func MustOpen(fileName, filePath string) (*os.File, error) {
FILE: pkg/gredis/redis.go
function Setup (line 15) | func Setup() error {
function Set (line 43) | func Set(key string, data interface{}, time int) error {
function Exists (line 66) | func Exists(key string) bool {
function Get (line 79) | func Get(key string) ([]byte, error) {
function Delete (line 92) | func Delete(key string) (bool, error) {
function LikeDeletes (line 100) | func LikeDeletes(key string) error {
FILE: pkg/logging/file.go
function getLogFilePath (line 11) | func getLogFilePath() string {
function getLogFileName (line 16) | func getLogFileName() string {
FILE: pkg/logging/log.go
type Level (line 12) | type Level
constant DEBUG (line 26) | DEBUG Level = iota
constant INFO (line 27) | INFO
constant WARNING (line 28) | WARNING
constant ERROR (line 29) | ERROR
constant FATAL (line 30) | FATAL
function Setup (line 34) | func Setup() {
function Debug (line 47) | func Debug(v ...interface{}) {
function Info (line 53) | func Info(v ...interface{}) {
function Warn (line 59) | func Warn(v ...interface{}) {
function Error (line 65) | func Error(v ...interface{}) {
function Fatal (line 71) | func Fatal(v ...interface{}) {
function setPrefix (line 77) | func setPrefix(level Level) {
FILE: pkg/qrcode/qrcode.go
type QrCode (line 14) | type QrCode struct
method GetQrCodeExt (line 60) | func (q *QrCode) GetQrCodeExt() string {
method Encode (line 65) | func (q *QrCode) Encode(path string) (string, string, error) {
constant EXT_JPG (line 24) | EXT_JPG = ".jpg"
function NewQrCode (line 28) | func NewQrCode(url string, width, height int, level qr.ErrorCorrectionLe...
function GetQrCodePath (line 40) | func GetQrCodePath() string {
function GetQrCodeFullPath (line 45) | func GetQrCodeFullPath() string {
function GetQrCodeFullUrl (line 50) | func GetQrCodeFullUrl(name string) string {
function GetQrCodeFileName (line 55) | func GetQrCodeFileName(value string) string {
FILE: pkg/setting/setting.go
type App (line 10) | type App struct
type Server (line 33) | type Server struct
type Database (line 42) | type Database struct
type Redis (line 53) | type Redis struct
function Setup (line 66) | func Setup() {
function mapTo (line 85) | func mapTo(section string, v interface{}) {
FILE: pkg/upload/image.go
function GetImageFullUrl (line 18) | func GetImageFullUrl(name string) string {
function GetImageName (line 23) | func GetImageName(name string) string {
function GetImagePath (line 32) | func GetImagePath() string {
function GetImageFullPath (line 37) | func GetImageFullPath() string {
function CheckImageExt (line 42) | func CheckImageExt(fileName string) bool {
function CheckImageSize (line 54) | func CheckImageSize(f multipart.File) bool {
function CheckImage (line 66) | func CheckImage(src string) error {
FILE: pkg/util/jwt.go
type Claims (line 11) | type Claims struct
function GenerateToken (line 18) | func GenerateToken(username, password string) (string, error) {
function ParseToken (line 38) | func ParseToken(token string) (*Claims, error) {
FILE: pkg/util/md5.go
function EncodeMD5 (line 9) | func EncodeMD5(value string) string {
FILE: pkg/util/pagination.go
function GetPage (line 11) | func GetPage(c *gin.Context) int {
FILE: pkg/util/util.go
function Setup (line 6) | func Setup() {
FILE: routers/api/auth.go
type auth (line 15) | type auth struct
function GetAuth (line 27) | func GetAuth(c *gin.Context) {
FILE: routers/api/upload.go
function UploadImage (line 20) | func UploadImage(c *gin.Context) {
FILE: routers/api/v1/article.go
function GetArticle (line 26) | func GetArticle(c *gin.Context) {
function GetArticles (line 66) | func GetArticles(c *gin.Context) {
type AddArticleForm (line 114) | type AddArticleForm struct
function AddArticle (line 135) | func AddArticle(c *gin.Context) {
type EditArticleForm (line 176) | type EditArticleForm struct
function EditArticle (line 199) | func EditArticle(c *gin.Context) {
function DeleteArticle (line 258) | func DeleteArticle(c *gin.Context) {
constant QRCODE_URL (line 291) | QRCODE_URL = "https://github.com/EDDYCJY/blog#gin%E7%B3%BB%E5%88%97%E7%9...
function GenerateArticlePoster (line 294) | func GenerateArticlePoster(c *gin.Context) {
FILE: routers/api/v1/tag.go
function GetTags (line 26) | func GetTags(c *gin.Context) {
type AddTagForm (line 58) | type AddTagForm struct
function AddTag (line 72) | func AddTag(c *gin.Context) {
type EditTagForm (line 108) | type EditTagForm struct
function EditTag (line 124) | func EditTag(c *gin.Context) {
function DeleteTag (line 169) | func DeleteTag(c *gin.Context) {
function ExportTag (line 207) | func ExportTag(c *gin.Context) {
function ImportTag (line 238) | func ImportTag(c *gin.Context) {
FILE: routers/router.go
function InitRouter (line 21) | func InitRouter() *gin.Engine {
FILE: service/article_service/article.go
type Article (line 12) | type Article struct
method Add (line 27) | func (a *Article) Add() error {
method Edit (line 45) | func (a *Article) Edit() error {
method Get (line 57) | func (a *Article) Get() (*models.Article, error) {
method GetAll (line 81) | func (a *Article) GetAll() ([]*models.Article, error) {
method Delete (line 113) | func (a *Article) Delete() error {
method ExistByID (line 117) | func (a *Article) ExistByID() (bool, error) {
method Count (line 121) | func (a *Article) Count() (int, error) {
method getMaps (line 125) | func (a *Article) getMaps() map[string]interface{} {
FILE: service/article_service/article_poster.go
type ArticlePoster (line 17) | type ArticlePoster struct
method CheckMergedImage (line 35) | func (a *ArticlePoster) CheckMergedImage(path string) bool {
method OpenMergedImage (line 43) | func (a *ArticlePoster) OpenMergedImage(path string) (*os.File, error) {
function NewArticlePoster (line 23) | func NewArticlePoster(posterName string, article *Article, qr *qrcode.Qr...
function GetPosterFlag (line 31) | func GetPosterFlag() string {
type ArticlePosterBg (line 52) | type ArticlePosterBg struct
method DrawPoster (line 96) | func (a *ArticlePosterBg) DrawPoster(d *DrawText, fontName string) err...
method Generate (line 136) | func (a *ArticlePosterBg) Generate() (string, string, error) {
type Rect (line 59) | type Rect struct
type Pt (line 67) | type Pt struct
function NewArticlePosterBg (line 72) | func NewArticlePosterBg(name string, ap *ArticlePoster, rect *Rect, pt *...
type DrawText (line 81) | type DrawText struct
FILE: service/auth_service/auth.go
type Auth (line 5) | type Auth struct
method Check (line 10) | func (a *Auth) Check() (bool, error) {
FILE: service/cache_service/article.go
type Article (line 10) | type Article struct
method GetArticleKey (line 19) | func (a *Article) GetArticleKey() string {
method GetArticlesKey (line 23) | func (a *Article) GetArticlesKey() string {
FILE: service/cache_service/tag.go
type Tag (line 10) | type Tag struct
method GetTagsKey (line 19) | func (t *Tag) GetTagsKey() string {
FILE: service/tag_service/tag.go
type Tag (line 20) | type Tag struct
method ExistByName (line 31) | func (t *Tag) ExistByName() (bool, error) {
method ExistByID (line 35) | func (t *Tag) ExistByID() (bool, error) {
method Add (line 39) | func (t *Tag) Add() error {
method Edit (line 43) | func (t *Tag) Edit() error {
method Delete (line 54) | func (t *Tag) Delete() error {
method Count (line 58) | func (t *Tag) Count() (int, error) {
method GetAll (line 62) | func (t *Tag) GetAll() ([]models.Tag, error) {
method Export (line 93) | func (t *Tag) Export() (string, error) {
method Import (line 148) | func (t *Tag) Import(r io.Reader) error {
method getMaps (line 169) | func (t *Tag) getMaps() map[string]interface{} {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/cell.go
constant STCellFormulaTypeArray (line 14) | STCellFormulaTypeArray = "array"
constant STCellFormulaTypeDataTable (line 16) | STCellFormulaTypeDataTable = "dataTable"
constant STCellFormulaTypeNormal (line 18) | STCellFormulaTypeNormal = "normal"
constant STCellFormulaTypeShared (line 20) | STCellFormulaTypeShared = "shared"
method mergeCellsParser (line 25) | func (f *File) mergeCellsParser(xlsx *xlsxWorksheet, axis string) string {
method SetCellValue (line 61) | func (f *File) SetCellValue(sheet, axis string, value interface{}) {
method setCellIntValue (line 87) | func (f *File) setCellIntValue(sheet, axis string, value interface{}) {
method SetCellBool (line 116) | func (f *File) SetCellBool(sheet, axis string, value bool) {
method GetCellValue (line 146) | func (f *File) GetCellValue(sheet, axis string) string {
method formattedValue (line 180) | func (f *File) formattedValue(s int, v string) string {
method GetCellStyle (line 194) | func (f *File) GetCellStyle(sheet, axis string) int {
method GetCellFormula (line 216) | func (f *File) GetCellFormula(sheet, axis string) string {
function getSharedForumula (line 259) | func getSharedForumula(xlsx *xlsxWorksheet, si string) string {
method SetCellFormula (line 281) | func (f *File) SetCellFormula(sheet, axis, formula string) {
method SetCellHyperLink (line 322) | func (f *File) SetCellHyperLink(sheet, axis, link, linkType string) {
method GetCellHyperLink (line 352) | func (f *File) GetCellHyperLink(sheet, axis string) (bool, string) {
method MergeCell (line 379) | func (f *File) MergeCell(sheet, hcell, vcell string) {
method SetCellInt (line 434) | func (f *File) SetCellInt(sheet, axis string, value int) {
method prepareCellStyle (line 458) | func (f *File) prepareCellStyle(xlsx *xlsxWorksheet, col, style int) int {
method SetCellStr (line 471) | func (f *File) SetCellStr(sheet, axis, value string) {
method SetCellDefault (line 507) | func (f *File) SetCellDefault(sheet, axis, value string) {
method SetSheetRow (line 535) | func (f *File) SetSheetRow(sheet, axis string, slice interface{}) {
function checkCellInArea (line 572) | func checkCellInArea(cell, area string) bool {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/chart.go
constant Bar (line 12) | Bar = "bar"
constant BarStacked (line 13) | BarStacked = "barStacked"
constant BarPercentStacked (line 14) | BarPercentStacked = "barPercentStacked"
constant Bar3DClustered (line 15) | Bar3DClustered = "bar3DClustered"
constant Bar3DStacked (line 16) | Bar3DStacked = "bar3DStacked"
constant Bar3DPercentStacked (line 17) | Bar3DPercentStacked = "bar3DPercentStacked"
constant Col (line 18) | Col = "col"
constant ColStacked (line 19) | ColStacked = "colStacked"
constant ColPercentStacked (line 20) | ColPercentStacked = "colPercentStacked"
constant Col3DClustered (line 21) | Col3DClustered = "col3DClustered"
constant Col3D (line 22) | Col3D = "col3D"
constant Col3DStacked (line 23) | Col3DStacked = "col3DStacked"
constant Col3DPercentStacked (line 24) | Col3DPercentStacked = "col3DPercentStacked"
constant Doughnut (line 25) | Doughnut = "doughnut"
constant Line (line 26) | Line = "line"
constant Pie (line 27) | Pie = "pie"
constant Pie3D (line 28) | Pie3D = "pie3D"
constant Radar (line 29) | Radar = "radar"
constant Scatter (line 30) | Scatter = "scatter"
function parseFormatChartSet (line 195) | func parseFormatChartSet(formatSet string) (*formatChart, error) {
method AddChart (line 360) | func (f *File) AddChart(sheet, cell, format string) error {
method countCharts (line 382) | func (f *File) countCharts() int {
method prepareDrawing (line 394) | func (f *File) prepareDrawing(xlsx *xlsxWorksheet, drawingID int, sheet,...
method addChart (line 411) | func (f *File) addChart(formatSet *formatChart) {
method drawBaseChart (line 567) | func (f *File) drawBaseChart(formatSet *formatChart) *cPlotArea {
method drawDoughnutChart (line 664) | func (f *File) drawDoughnutChart(formatSet *formatChart) *cPlotArea {
method drawLineChart (line 678) | func (f *File) drawLineChart(formatSet *formatChart) *cPlotArea {
method drawPieChart (line 704) | func (f *File) drawPieChart(formatSet *formatChart) *cPlotArea {
method drawPie3DChart (line 717) | func (f *File) drawPie3DChart(formatSet *formatChart) *cPlotArea {
method drawRadarChart (line 730) | func (f *File) drawRadarChart(formatSet *formatChart) *cPlotArea {
method drawScatterChart (line 753) | func (f *File) drawScatterChart(formatSet *formatChart) *cPlotArea {
method drawChartSeries (line 776) | func (f *File) drawChartSeries(formatSet *formatChart) *[]cSer {
method drawChartSeriesSpPr (line 802) | func (f *File) drawChartSeriesSpPr(i int, formatSet *formatChart) *cSpPr {
method drawChartSeriesDPt (line 824) | func (f *File) drawChartSeriesDPt(i int, formatSet *formatChart) []*cDPt {
method drawChartSeriesCat (line 853) | func (f *File) drawChartSeriesCat(v formatChartSeries, formatSet *format...
method drawChartSeriesVal (line 865) | func (f *File) drawChartSeriesVal(v formatChartSeries, formatSet *format...
method drawChartSeriesMarker (line 877) | func (f *File) drawChartSeriesMarker(i int, formatSet *formatChart) *cMa...
method drawChartSeriesXVal (line 903) | func (f *File) drawChartSeriesXVal(v formatChartSeries, formatSet *forma...
method drawChartSeriesYVal (line 915) | func (f *File) drawChartSeriesYVal(v formatChartSeries, formatSet *forma...
method drawChartDLbls (line 927) | func (f *File) drawChartDLbls(formatSet *formatChart) *cDLbls {
method drawChartSeriesDLbls (line 941) | func (f *File) drawChartSeriesDLbls(formatSet *formatChart) *cDLbls {
method drawPlotAreaCatAx (line 948) | func (f *File) drawPlotAreaCatAx(formatSet *formatChart) []*cAxs {
method drawPlotAreaValAx (line 987) | func (f *File) drawPlotAreaValAx(formatSet *formatChart) []*cAxs {
method drawPlotAreaSpPr (line 1023) | func (f *File) drawPlotAreaSpPr() *cSpPr {
method drawPlotAreaTxPr (line 1042) | func (f *File) drawPlotAreaTxPr() *cTxPr {
method drawingParser (line 1084) | func (f *File) drawingParser(drawingXML string, content *xlsxWsDr) int {
method addDrawingChart (line 1110) | func (f *File) addDrawingChart(sheet, drawingXML, cell string, width, he...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/col.go
constant defaultColWidthPixels (line 12) | defaultColWidthPixels float64 = 64
constant defaultRowHeightPixels (line 13) | defaultRowHeightPixels float64 = 20
constant EMU (line 14) | EMU int = 9525
method GetColVisible (line 23) | func (f *File) GetColVisible(sheet, column string) bool {
method SetColVisible (line 43) | func (f *File) SetColVisible(sheet, column string, visible bool) {
method GetColOutlineLevel (line 76) | func (f *File) GetColOutlineLevel(sheet, column string) uint8 {
method SetColOutlineLevel (line 97) | func (f *File) SetColOutlineLevel(sheet, column string, level uint8) {
method SetColWidth (line 134) | func (f *File) SetColWidth(sheet, startcol, endcol string, width float64) {
method positionObjectPixels (line 208) | func (f *File) positionObjectPixels(sheet string, colStart, rowStart, x1...
method getColWidth (line 264) | func (f *File) getColWidth(sheet string, col int) int {
method GetColWidth (line 283) | func (f *File) GetColWidth(sheet, column string) float64 {
method InsertCol (line 306) | func (f *File) InsertCol(sheet, column string) {
method RemoveCol (line 316) | func (f *File) RemoveCol(sheet, column string) {
function completeCol (line 332) | func completeCol(xlsx *xlsxWorksheet, row, cell int) {
function convertColWidthToPixels (line 353) | func convertColWidthToPixels(width float64) float64 {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/comment.go
function parseFormatCommentsSet (line 12) | func parseFormatCommentsSet(formatSet string) (*formatComment, error) {
method AddComment (line 28) | func (f *File) AddComment(sheet, cell, format string) error {
method addDrawingVML (line 59) | func (f *File) addDrawingVML(commentID int, drawingVML, cell string) {
method addComment (line 154) | func (f *File) addComment(commentsXML, cell string, formatSet *formatCom...
method countComments (line 214) | func (f *File) countComments() int {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/date.go
function timeToUTCTime (line 12) | func timeToUTCTime(t time.Time) time.Time {
function timeToExcelTime (line 17) | func timeToExcelTime(t time.Time) float64 {
function shiftJulianToNoon (line 22) | func shiftJulianToNoon(julianDays, julianFraction float64) (float64, flo...
function fractionOfADay (line 39) | func fractionOfADay(fraction float64) (hours, minutes, seconds, nanoseco...
function julianDateToGregorianTime (line 59) | func julianDateToGregorianTime(part1, part2 float64) time.Time {
function doTheFliegelAndVanFlandernAlgorithm (line 76) | func doTheFliegelAndVanFlandernAlgorithm(jd int) (day, month, year int) {
function timeFromExcelTime (line 92) | func timeFromExcelTime(excelTime float64, date1904 bool) time.Time {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/excelize.go
type File (line 15) | type File struct
method setDefaultTimeStyle (line 75) | func (f *File) setDefaultTimeStyle(sheet, axis string, format int) {
method workSheetReader (line 84) | func (f *File) workSheetReader(sheet string) *xlsxWorksheet {
method UpdateLinkedValue (line 169) | func (f *File) UpdateLinkedValue() {
method adjustHelper (line 194) | func (f *File) adjustHelper(sheet string, column, row, offset int) {
method adjustColDimensions (line 207) | func (f *File) adjustColDimensions(xlsx *xlsxWorksheet, column, offset...
method adjustRowDimensions (line 223) | func (f *File) adjustRowDimensions(xlsx *xlsxWorksheet, rowIndex, offs...
method adjustHyperlinks (line 243) | func (f *File) adjustHyperlinks(sheet string, column, rowIndex, offset...
method adjustMergeCellsHelper (line 283) | func (f *File) adjustMergeCellsHelper(xlsx *xlsxWorksheet, column, row...
method adjustMergeCells (line 324) | func (f *File) adjustMergeCells(xlsx *xlsxWorksheet, column, rowIndex,...
method adjustAutoFilter (line 345) | func (f *File) adjustAutoFilter(xlsx *xlsxWorksheet, column, rowIndex,...
method adjustAutoFilterHelper (line 379) | func (f *File) adjustAutoFilterHelper(xlsx *xlsxWorksheet, column, row...
function OpenFile (line 31) | func OpenFile(filename string) (*File, error) {
function OpenReader (line 46) | func OpenReader(r io.Reader) (*File, error) {
function checkSheet (line 108) | func checkSheet(xlsx *xlsxWorksheet) {
function replaceWorkSheetsRelationshipsNameSpaceBytes (line 137) | func replaceWorkSheetsRelationshipsNameSpaceBytes(workbookMarshal []byte...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/file.go
function NewFile (line 16) | func NewFile() *File {
method Save (line 43) | func (f *File) Save() error {
method SaveAs (line 52) | func (f *File) SaveAs(name string) error {
method Write (line 62) | func (f *File) Write(w io.Writer) error {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/lib.go
function ReadZipReader (line 15) | func ReadZipReader(r *zip.Reader) (map[string][]byte, int, error) {
method readXML (line 30) | func (f *File) readXML(name string) []byte {
method saveFileList (line 39) | func (f *File) saveFileList(name string, content []byte) {
function readFile (line 47) | func readFile(file *zip.File) []byte {
function ToAlphaString (line 63) | func ToAlphaString(value int) string {
function TitleToNumber (line 83) | func TitleToNumber(s string) int {
function letterOnlyMapF (line 99) | func letterOnlyMapF(rune rune) rune {
function intOnlyMapF (line 111) | func intOnlyMapF(rune rune) rune {
function deepCopy (line 121) | func deepCopy(dst, src interface{}) error {
function boolPtr (line 130) | func boolPtr(b bool) *bool { return &b }
function defaultTrue (line 133) | func defaultTrue(b *bool) bool {
function axisLowerOrEqualThan (line 152) | func axisLowerOrEqualThan(axis1, axis2 string) bool {
function getCellColRow (line 169) | func getCellColRow(cell string) (col, row string) {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/picture.go
function parseFormatPictureSet (line 19) | func parseFormatPictureSet(formatSet string) (*formatPicture, error) {
method AddPicture (line 79) | func (f *File) AddPicture(sheet, cell, picture, format string) error {
method addSheetRelationships (line 122) | func (f *File) addSheetRelationships(sheet, relType, target, targetMode ...
method deleteSheetRelationships (line 155) | func (f *File) deleteSheetRelationships(sheet, rID string) {
method addSheetLegacyDrawing (line 174) | func (f *File) addSheetLegacyDrawing(sheet string, rID int) {
method addSheetDrawing (line 183) | func (f *File) addSheetDrawing(sheet string, rID int) {
method addSheetPicture (line 192) | func (f *File) addSheetPicture(sheet string, rID int) {
method countDrawings (line 201) | func (f *File) countDrawings() int {
method addDrawingPicture (line 214) | func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, w...
method addDrawingRelationships (line 269) | func (f *File) addDrawingRelationships(index int, relType, target, targe...
method countMedia (line 297) | func (f *File) countMedia() int {
method addMedia (line 309) | func (f *File) addMedia(file, ext string) {
method setContentTypePartImageExtensions (line 318) | func (f *File) setContentTypePartImageExtensions() {
method setContentTypePartVMLExtensions (line 339) | func (f *File) setContentTypePartVMLExtensions() {
method addContentTypePart (line 357) | func (f *File) addContentTypePart(index int, contentType string) {
method getSheetRelationshipsTargetByID (line 393) | func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string {
method GetPicture (line 427) | func (f *File) GetPicture(sheet, cell string) (string, []byte) {
method getDrawingRelationships (line 468) | func (f *File) getDrawingRelationships(rels, rID string) *xlsxWorkbookRe...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/rows.go
method GetRows (line 23) | func (f *File) GetRows(sheet string) [][]string {
type Rows (line 73) | type Rows struct
method Next (line 81) | func (rows *Rows) Next() bool {
method Error (line 102) | func (rows *Rows) Error() error {
method Columns (line 107) | func (rows *Rows) Columns() []string {
type ErrSheetNotExist (line 125) | type ErrSheetNotExist struct
method Error (line 129) | func (err ErrSheetNotExist) Error() string {
method Rows (line 143) | func (f *File) Rows(sheet string) (*Rows, error) {
method getTotalRowsCols (line 161) | func (f *File) getTotalRowsCols(name string) (int, int) {
method SetRowHeight (line 196) | func (f *File) SetRowHeight(sheet string, row int, height float64) {
method getRowHeight (line 207) | func (f *File) getRowHeight(sheet string, row int) int {
method GetRowHeight (line 223) | func (f *File) GetRowHeight(sheet string, row int) float64 {
method sharedStringsReader (line 236) | func (f *File) sharedStringsReader() *xlsxSST {
method getValueFrom (line 251) | func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
method SetRowVisible (line 278) | func (f *File) SetRowVisible(sheet string, rowIndex int, visible bool) {
method GetRowVisible (line 296) | func (f *File) GetRowVisible(sheet string, rowIndex int) bool {
method SetRowOutlineLevel (line 310) | func (f *File) SetRowOutlineLevel(sheet string, rowIndex int, level uint...
method GetRowOutlineLevel (line 324) | func (f *File) GetRowOutlineLevel(sheet string, rowIndex int) uint8 {
method RemoveRow (line 337) | func (f *File) RemoveRow(sheet string, row int) {
method InsertRow (line 357) | func (f *File) InsertRow(sheet string, row int) {
function checkRow (line 389) | func checkRow(xlsx *xlsxWorksheet) {
function completeRow (line 422) | func completeRow(xlsx *xlsxWorksheet, row, cell int) {
function convertRowHeightToPixels (line 454) | func convertRowHeightToPixels(height float64) float64 {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/shape.go
function parseFormatShapeSet (line 12) | func parseFormatShapeSet(formatSet string) (*formatShape, error) {
method AddShape (line 248) | func (f *File) AddShape(sheet, cell, format string) error {
method addDrawingShape (line 277) | func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet...
function setShapeRef (line 402) | func setShapeRef(color string, i int) *aRef {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/sheet.go
method NewSheet (line 18) | func (f *File) NewSheet(name string) int {
method contentTypesReader (line 39) | func (f *File) contentTypesReader() *xlsxTypes {
method contentTypesWriter (line 50) | func (f *File) contentTypesWriter() {
method workbookReader (line 59) | func (f *File) workbookReader() *xlsxWorkbook {
method workbookWriter (line 70) | func (f *File) workbookWriter() {
method worksheetWriter (line 79) | func (f *File) worksheetWriter() {
function trimCell (line 96) | func trimCell(column []xlsxC) []xlsxC {
method setContentTypes (line 109) | func (f *File) setContentTypes(index int) {
method setSheet (line 118) | func (f *File) setSheet(index int, name string) {
method setWorkbook (line 131) | func (f *File) setWorkbook(name string, rid int) {
method workbookRelsReader (line 142) | func (f *File) workbookRelsReader() *xlsxWorkbookRels {
method workbookRelsWriter (line 153) | func (f *File) workbookRelsWriter() {
method addXlsxWorkbookRels (line 161) | func (f *File) addXlsxWorkbookRels(sheet int) int {
method setAppXML (line 187) | func (f *File) setAppXML() {
function replaceRelationshipsNameSpaceBytes (line 198) | func replaceRelationshipsNameSpaceBytes(workbookMarshal []byte) []byte {
method SetActiveSheet (line 208) | func (f *File) SetActiveSheet(index int) {
method GetActiveSheetIndex (line 242) | func (f *File) GetActiveSheetIndex() int {
method SetSheetName (line 267) | func (f *File) SetSheetName(oldName, newName string) {
method GetSheetName (line 283) | func (f *File) GetSheetName(index int) string {
method GetSheetIndex (line 302) | func (f *File) GetSheetIndex(name string) int {
method GetSheetMap (line 329) | func (f *File) GetSheetMap() map[int]string {
method getSheetMap (line 346) | func (f *File) getSheetMap() map[string]string {
method SetSheetBackground (line 356) | func (f *File) SetSheetBackground(sheet, picture string) error {
method DeleteSheet (line 379) | func (f *File) DeleteSheet(name string) {
method deleteSheetFromWorkbookRels (line 401) | func (f *File) deleteSheetFromWorkbookRels(rID string) string {
method deleteSheetFromContentTypes (line 414) | func (f *File) deleteSheetFromContentTypes(target string) {
method CopySheet (line 432) | func (f *File) CopySheet(from, to int) error {
method copySheet (line 441) | func (f *File) copySheet(from, to int) error {
method SetSheetVisible (line 478) | func (f *File) SetSheetVisible(name string, visible bool) {
function parseFormatPanesSet (line 508) | func parseFormatPanesSet(formatSet string) (*formatPanes, error) {
method SetPanes (line 599) | func (f *File) SetPanes(sheet, panes string) {
method GetSheetVisible (line 633) | func (f *File) GetSheetVisible(name string) bool {
function trimSheetName (line 648) | func trimSheetName(name string) string {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/sheetpr.go
type SheetPrOption (line 4) | type SheetPrOption interface
type SheetPrOptionPtr (line 9) | type SheetPrOptionPtr interface
type CodeName (line 16) | type CodeName
method setSheetPrOption (line 27) | func (o CodeName) setSheetPrOption(pr *xlsxSheetPr) {
method getSheetPrOption (line 31) | func (o *CodeName) getSheetPrOption(pr *xlsxSheetPr) {
type EnableFormatConditionsCalculation (line 18) | type EnableFormatConditionsCalculation
method setSheetPrOption (line 39) | func (o EnableFormatConditionsCalculation) setSheetPrOption(pr *xlsxSh...
method getSheetPrOption (line 43) | func (o *EnableFormatConditionsCalculation) getSheetPrOption(pr *xlsxS...
type Published (line 20) | type Published
method setSheetPrOption (line 51) | func (o Published) setSheetPrOption(pr *xlsxSheetPr) {
method getSheetPrOption (line 55) | func (o *Published) getSheetPrOption(pr *xlsxSheetPr) {
type FitToPage (line 22) | type FitToPage
method setSheetPrOption (line 63) | func (o FitToPage) setSheetPrOption(pr *xlsxSheetPr) {
method getSheetPrOption (line 73) | func (o *FitToPage) getSheetPrOption(pr *xlsxSheetPr) {
type AutoPageBreaks (line 24) | type AutoPageBreaks
method setSheetPrOption (line 82) | func (o AutoPageBreaks) setSheetPrOption(pr *xlsxSheetPr) {
method getSheetPrOption (line 92) | func (o *AutoPageBreaks) getSheetPrOption(pr *xlsxSheetPr) {
method SetSheetPrOptions (line 109) | func (f *File) SetSheetPrOptions(name string, opts ...SheetPrOption) err...
method GetSheetPrOptions (line 131) | func (f *File) GetSheetPrOptions(name string, opts ...SheetPrOptionPtr) ...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/sheetview.go
type SheetViewOption (line 6) | type SheetViewOption interface
type SheetViewOptionPtr (line 11) | type SheetViewOptionPtr interface
type DefaultGridColor (line 18) | type DefaultGridColor
method setSheetViewOption (line 41) | func (o DefaultGridColor) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 45) | func (o *DefaultGridColor) getSheetViewOption(view *xlsxSheetView) {
type RightToLeft (line 20) | type RightToLeft
method setSheetViewOption (line 49) | func (o RightToLeft) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 53) | func (o *RightToLeft) getSheetViewOption(view *xlsxSheetView) {
type ShowFormulas (line 22) | type ShowFormulas
method setSheetViewOption (line 57) | func (o ShowFormulas) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 61) | func (o *ShowFormulas) getSheetViewOption(view *xlsxSheetView) {
type ShowGridLines (line 24) | type ShowGridLines
method setSheetViewOption (line 65) | func (o ShowGridLines) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 69) | func (o *ShowGridLines) getSheetViewOption(view *xlsxSheetView) {
type ShowRowColHeaders (line 26) | type ShowRowColHeaders
method setSheetViewOption (line 73) | func (o ShowRowColHeaders) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 77) | func (o *ShowRowColHeaders) getSheetViewOption(view *xlsxSheetView) {
type ZoomScale (line 28) | type ZoomScale
method setSheetViewOption (line 81) | func (o ZoomScale) setSheetViewOption(view *xlsxSheetView) {
method getSheetViewOption (line 88) | func (o *ZoomScale) getSheetViewOption(view *xlsxSheetView) {
method getSheetView (line 93) | func (f *File) getSheetView(sheetName string, viewIndex int) (*xlsxSheet...
method SetSheetViewOptions (line 118) | func (f *File) SetSheetViewOptions(name string, viewIndex int, opts ...S...
method GetSheetViewOptions (line 142) | func (f *File) GetSheetViewOptions(name string, viewIndex int, opts ...S...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/styles.go
function formatToString (line 834) | func formatToString(i int, v string) string {
function formatToInt (line 840) | func formatToInt(i int, v string) string {
function formatToFloat (line 850) | func formatToFloat(i int, v string) string {
function formatToA (line 860) | func formatToA(i int, v string) string {
function formatToB (line 875) | func formatToB(i int, v string) string {
function formatToC (line 888) | func formatToC(i int, v string) string {
function formatToD (line 899) | func formatToD(i int, v string) string {
function formatToE (line 910) | func formatToE(i int, v string) string {
function parseTime (line 929) | func parseTime(i int, v string) string {
function is12HourTime (line 982) | func is12HourTime(format string) bool {
method stylesReader (line 988) | func (f *File) stylesReader() *xlsxStyleSheet {
method styleSheetWriter (line 999) | func (f *File) styleSheetWriter() {
function parseFormatStyleSet (line 1008) | func parseFormatStyleSet(style string) (*formatStyle, error) {
method NewStyle (line 1877) | func (f *File) NewStyle(style string) (int, error) {
method NewConditionalStyle (line 1913) | func (f *File) NewConditionalStyle(style string) (int, error) {
function setFont (line 1939) | func setFont(formatStyle *formatStyle) *font {
function setNumFmt (line 1968) | func setNumFmt(style *xlsxStyleSheet, formatStyle *formatStyle) int {
function setCustomNumFmt (line 2015) | func setCustomNumFmt(style *xlsxStyleSheet, formatStyle *formatStyle) int {
function setLangNumFmt (line 2033) | func setLangNumFmt(style *xlsxStyleSheet, formatStyle *formatStyle) int {
function setFills (line 2061) | func setFills(formatStyle *formatStyle, fg bool) *xlsxFill {
function setAlignment (line 2143) | func setAlignment(formatStyle *formatStyle) *xlsxAlignment {
function setProtection (line 2161) | func setProtection(formatStyle *formatStyle) *xlsxProtection {
function setBorders (line 2172) | func setBorders(formatStyle *formatStyle) *xlsxBorder {
function setCellXfs (line 2224) | func setCellXfs(style *xlsxStyleSheet, fontID, numFmtID, fillID, borderI...
method SetCellStyle (line 2313) | func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) {
method SetConditionalFormat (line 2565) | func (f *File) SetConditionalFormat(sheet, area, formatSet string) error {
function drawCondFmtCellIs (line 2612) | func drawCondFmtCellIs(p int, ct string, format *formatConditional) *xls...
function drawCondFmtTop10 (line 2635) | func drawCondFmtTop10(p int, ct string, format *formatConditional) *xlsx...
function drawCondFmtAboveAverage (line 2653) | func drawCondFmtAboveAverage(p int, ct string, format *formatConditional...
function drawCondFmtDuplicateUniqueValues (line 2665) | func drawCondFmtDuplicateUniqueValues(p int, ct string, format *formatCo...
function drawCondFmtColorScale (line 2676) | func drawCondFmtColorScale(p int, ct string, format *formatConditional) ...
function drawCondFmtDataBar (line 2700) | func drawCondFmtDataBar(p int, ct string, format *formatConditional) *xl...
function drawConfFmtExp (line 2713) | func drawConfFmtExp(p int, ct string, format *formatConditional) *xlsxCf...
function getPaletteColor (line 2723) | func getPaletteColor(color string) string {
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/table.go
function parseFormatTableSet (line 14) | func parseFormatTableSet(formatSet string) (*formatTable, error) {
method AddTable (line 44) | func (f *File) AddTable(sheet, hcell, vcell, format string) error {
method countTables (line 80) | func (f *File) countTables() int {
method addSheetTable (line 92) | func (f *File) addSheetTable(sheet string, rID int) {
method addTable (line 106) | func (f *File) addTable(sheet, tableXML string, hxAxis, hyAxis, vxAxis, ...
function parseAutoFilterSet (line 162) | func parseAutoFilterSet(formatSet string) (*formatAutoFilter, error) {
method AutoFilter (line 238) | func (f *File) AutoFilter(sheet, hcell, vcell, format string) error {
method autoFilter (line 269) | func (f *File) autoFilter(sheet, ref string, refRange, hxAxis int, forma...
method writeAutoFilter (line 306) | func (f *File) writeAutoFilter(filter *xlsxAutoFilter, exp []int, tokens...
method writeCustomFilter (line 333) | func (f *File) writeCustomFilter(filter *xlsxAutoFilter, operator int, v...
method parseFilterExpression (line 364) | func (f *File) parseFilterExpression(expression string, tokens []string)...
method parseFilterTokens (line 399) | func (f *File) parseFilterTokens(expression string, tokens []string) ([]...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/templates.go
constant XMLHeader (line 7) | XMLHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"...
constant templateDocpropsApp (line 15) | templateDocpropsApp = `<Properties xmlns="http://schemas.openxmlformats....
constant templateContentTypes (line 17) | templateContentTypes = `<Types xmlns="http://schemas.openxmlformats.org/...
constant templateWorkbook (line 19) | templateWorkbook = `<workbook xmlns="http://schemas.openxmlformats.org/s...
constant templateStyles (line 21) | templateStyles = `<styleSheet xmlns="http://schemas.openxmlformats.org/s...
constant templateSheet (line 23) | templateSheet = `<worksheet xmlns="http://schemas.openxmlformats.org/spr...
constant templateWorkbookRels (line 25) | templateWorkbookRels = `<Relationships xmlns="http://schemas.openxmlform...
constant templateDocpropsCore (line 27) | templateDocpropsCore = `<cp:coreProperties xmlns:cp="http://schemas.open...
constant templateRels (line 29) | templateRels = `<Relationships xmlns="http://schemas.openxmlformats.org/...
constant templateTheme (line 31) | templateTheme = `<a:theme xmlns:a="http://schemas.openxmlformats.org/dra...
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/vmlDrawing.go
type vmlDrawing (line 7) | type vmlDrawing struct
type xlsxShapelayout (line 21) | type xlsxShapelayout struct
type xlsxIDmap (line 27) | type xlsxIDmap struct
type xlsxShape (line 33) | type xlsxShape struct
type xlsxShapetype (line 45) | type xlsxShapetype struct
type xlsxStroke (line 55) | type xlsxStroke struct
type vPath (line 60) | type vPath struct
type vFill (line 67) | type vFill struct
type oFill (line 75) | type oFill struct
type vShadow (line 82) | type vShadow struct
type vTextbox (line 90) | type vTextbox struct
type xlsxDiv (line 96) | type xlsxDiv struct
type xClientData (line 107) | type xClientData struct
type decodeVmlDrawing (line 119) | type decodeVmlDrawing struct
type decodeShape (line 124) | type decodeShape struct
type encodeShape (line 129) | type encodeShape struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlChart.go
type xlsxChartSpace (line 8) | type xlsxChartSpace struct
type cThicknessSpPr (line 26) | type cThicknessSpPr struct
type cChart (line 33) | type cChart struct
type cTitle (line 49) | type cTitle struct
type cTx (line 59) | type cTx struct
type cRich (line 66) | type cRich struct
type aBodyPr (line 74) | type aBodyPr struct
type aP (line 98) | type aP struct
type aPPr (line 110) | type aPPr struct
type aSolidFill (line 117) | type aSolidFill struct
type aSchemeClr (line 126) | type aSchemeClr struct
type attrValInt (line 134) | type attrValInt struct
type attrValFloat (line 140) | type attrValFloat struct
type attrValBool (line 146) | type attrValBool struct
type attrValString (line 152) | type attrValString struct
type aCs (line 157) | type aCs struct
type aEa (line 162) | type aEa struct
type aLatin (line 170) | type aLatin struct
type aR (line 175) | type aR struct
type aRPr (line 185) | type aRPr struct
type cSpPr (line 215) | type cSpPr struct
type aSp3D (line 227) | type aSp3D struct
type aContourClr (line 235) | type aContourClr struct
type aLn (line 243) | type aLn struct
type cTxPr (line 255) | type cTxPr struct
type aEndParaRPr (line 269) | type aEndParaRPr struct
type cAutoTitleDeleted (line 278) | type cAutoTitleDeleted struct
type cView3D (line 284) | type cView3D struct
type cPlotArea (line 293) | type cPlotArea struct
type cCharts (line 309) | type cCharts struct
type cAxs (line 324) | type cAxs struct
type cScaling (line 346) | type cScaling struct
type cNumFmt (line 354) | type cNumFmt struct
type cSer (line 361) | type cSer struct
type cMarker (line 379) | type cMarker struct
type cDPt (line 387) | type cDPt struct
type cCat (line 395) | type cCat struct
type cStrRef (line 402) | type cStrRef struct
type cStrCache (line 409) | type cStrCache struct
type cPt (line 416) | type cPt struct
type cVal (line 423) | type cVal struct
type cNumRef (line 429) | type cNumRef struct
type cNumCache (line 436) | type cNumCache struct
type cDLbls (line 446) | type cDLbls struct
type cLegend (line 458) | type cLegend struct
type cPrintSettings (line 468) | type cPrintSettings struct
type cPageMargins (line 476) | type cPageMargins struct
type formatChartAxis (line 486) | type formatChartAxis struct
type formatChartDimension (line 509) | type formatChartDimension struct
type formatChart (line 515) | type formatChart struct
type formatChartLegend (line 564) | type formatChartLegend struct
type formatChartSeries (line 575) | type formatChartSeries struct
type formatChartTitle (line 599) | type formatChartTitle struct
type formatLayout (line 607) | type formatLayout struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlComments.go
type xlsxComments (line 14) | type xlsxComments struct
type xlsxAuthor (line 24) | type xlsxAuthor struct
type xlsxCommentList (line 30) | type xlsxCommentList struct
type xlsxComment (line 37) | type xlsxComment struct
type xlsxText (line 47) | type xlsxText struct
type formatComment (line 52) | type formatComment struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlContentTypes.go
type xlsxTypes (line 8) | type xlsxTypes struct
type xlsxOverride (line 16) | type xlsxOverride struct
type xlsxDefault (line 23) | type xlsxDefault struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlDecodeDrawing.go
type decodeCellAnchor (line 9) | type decodeCellAnchor struct
type decodeWsDr (line 18) | type decodeWsDr struct
type decodeTwoCellAnchor (line 31) | type decodeTwoCellAnchor struct
type decodeCNvPr (line 41) | type decodeCNvPr struct
type decodePicLocks (line 52) | type decodePicLocks struct
type decodeBlip (line 70) | type decodeBlip struct
type decodeStretch (line 79) | type decodeStretch struct
type decodeOff (line 85) | type decodeOff struct
type decodeExt (line 91) | type decodeExt struct
type decodePrstGeom (line 100) | type decodePrstGeom struct
type decodeXfrm (line 108) | type decodeXfrm struct
type decodeCNvPicPr (line 118) | type decodeCNvPicPr struct
type decodeNvPicPr (line 128) | type decodeNvPicPr struct
type decodeBlipFill (line 137) | type decodeBlipFill struct
type decodeSpPr (line 147) | type decodeSpPr struct
type decodePic (line 156) | type decodePic struct
type decodeFrom (line 163) | type decodeFrom struct
type decodeTo (line 171) | type decodeTo struct
type decodeClientData (line 184) | type decodeClientData struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlDrawing.go
constant SourceRelationship (line 7) | SourceRelationship = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipChart (line 8) | SourceRelationshipChart = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipComments (line 9) | SourceRelationshipComments = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipImage (line 10) | SourceRelationshipImage = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipTable (line 11) | SourceRelationshipTable = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipDrawingML (line 12) | SourceRelationshipDrawingML = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipDrawingVML (line 13) | SourceRelationshipDrawingVML = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipHyperLink (line 14) | SourceRelationshipHyperLink = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipWorkSheet (line 15) | SourceRelationshipWorkSheet = "http://schemas.openxmlformats.org/off...
constant SourceRelationshipChart201506 (line 16) | SourceRelationshipChart201506 = "http://schemas.microsoft.com/office/d...
constant SourceRelationshipChart20070802 (line 17) | SourceRelationshipChart20070802 = "http://schemas.microsoft.com/office/d...
constant SourceRelationshipChart2014 (line 18) | SourceRelationshipChart2014 = "http://schemas.microsoft.com/office/d...
constant SourceRelationshipCompatibility (line 19) | SourceRelationshipCompatibility = "http://schemas.openxmlformats.org/mar...
constant NameSpaceDrawingML (line 20) | NameSpaceDrawingML = "http://schemas.openxmlformats.org/dra...
constant NameSpaceDrawingMLChart (line 21) | NameSpaceDrawingMLChart = "http://schemas.openxmlformats.org/dra...
constant NameSpaceDrawingMLSpreadSheet (line 22) | NameSpaceDrawingMLSpreadSheet = "http://schemas.openxmlformats.org/dra...
constant NameSpaceSpreadSheet (line 23) | NameSpaceSpreadSheet = "http://schemas.openxmlformats.org/spr...
constant NameSpaceXML (line 24) | NameSpaceXML = "http://www.w3.org/XML/1998/namespace"
type xlsxCNvPr (line 32) | type xlsxCNvPr struct
type xlsxHlinkClick (line 43) | type xlsxHlinkClick struct
type xlsxPicLocks (line 59) | type xlsxPicLocks struct
type xlsxBlip (line 77) | type xlsxBlip struct
type xlsxStretch (line 86) | type xlsxStretch struct
type xlsxOff (line 92) | type xlsxOff struct
type xlsxExt (line 98) | type xlsxExt struct
type xlsxPrstGeom (line 107) | type xlsxPrstGeom struct
type xlsxXfrm (line 115) | type xlsxXfrm struct
type xlsxCNvPicPr (line 125) | type xlsxCNvPicPr struct
type xlsxNvPicPr (line 135) | type xlsxNvPicPr struct
type xlsxBlipFill (line 144) | type xlsxBlipFill struct
type xlsxSpPr (line 154) | type xlsxSpPr struct
type xlsxPic (line 163) | type xlsxPic struct
type xlsxFrom (line 170) | type xlsxFrom struct
type xlsxTo (line 178) | type xlsxTo struct
type xdrClientData (line 191) | type xdrClientData struct
type xdrCellAnchor (line 200) | type xdrCellAnchor struct
type xlsxWsDr (line 213) | type xlsxWsDr struct
type xlsxGraphicFrame (line 226) | type xlsxGraphicFrame struct
type xlsxNvGraphicFramePr (line 241) | type xlsxNvGraphicFramePr struct
type xlsxGraphic (line 251) | type xlsxGraphic struct
type xlsxGraphicData (line 259) | type xlsxGraphicData struct
type xlsxChart (line 265) | type xlsxChart struct
type xdrSp (line 278) | type xdrSp struct
type xdrNvSpPr (line 293) | type xdrNvSpPr struct
type xdrCNvSpPr (line 302) | type xdrCNvSpPr struct
type xdrStyle (line 309) | type xdrStyle struct
type aRef (line 317) | type aRef struct
type aScrgbClr (line 328) | type aScrgbClr struct
type aFontRef (line 337) | type aFontRef struct
type xdrTxBody (line 347) | type xdrTxBody struct
type formatPicture (line 353) | type formatPicture struct
type formatShape (line 367) | type formatShape struct
type formatShapeParagraph (line 378) | type formatShapeParagraph struct
type formatShapeColor (line 384) | type formatShapeColor struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlSharedStrings.go
type xlsxSST (line 12) | type xlsxSST struct
type xlsxSI (line 22) | type xlsxSI struct
type xlsxR (line 30) | type xlsxR struct
type xlsxRPr (line 40) | type xlsxRPr struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlStyles.go
type xlsxStyleSheet (line 8) | type xlsxStyleSheet struct
type xlsxAlignment (line 26) | type xlsxAlignment struct
type xlsxProtection (line 42) | type xlsxProtection struct
type xlsxLine (line 50) | type xlsxLine struct
type xlsxColor (line 61) | type xlsxColor struct
type xlsxFonts (line 71) | type xlsxFonts struct
type font (line 77) | type font struct
type xlsxFont (line 96) | type xlsxFont struct
type xlsxFills (line 104) | type xlsxFills struct
type xlsxFill (line 111) | type xlsxFill struct
type xlsxPatternFill (line 123) | type xlsxPatternFill struct
type xlsxGradientFill (line 131) | type xlsxGradientFill struct
type xlsxGradientFillStop (line 142) | type xlsxGradientFillStop struct
type xlsxBorders (line 150) | type xlsxBorders struct
type xlsxBorder (line 158) | type xlsxBorder struct
type xlsxCellStyles (line 174) | type xlsxCellStyles struct
type xlsxCellStyle (line 183) | type xlsxCellStyle struct
type xlsxCellStyleXfs (line 200) | type xlsxCellStyleXfs struct
type xlsxXf (line 207) | type xlsxXf struct
type xlsxCellXfs (line 230) | type xlsxCellXfs struct
type xlsxDxfs (line 243) | type xlsxDxfs struct
type xlsxDxf (line 250) | type xlsxDxf struct
type dxf (line 255) | type dxf struct
type xlsxTableStyles (line 269) | type xlsxTableStyles struct
type xlsxTableStyle (line 279) | type xlsxTableStyle struct
type xlsxNumFmts (line 291) | type xlsxNumFmts struct
type xlsxNumFmt (line 299) | type xlsxNumFmt struct
type xlsxStyleColors (line 308) | type xlsxStyleColors struct
type formatFont (line 313) | type formatFont struct
type formatStyle (line 323) | type formatStyle struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlTable.go
type xlsxTable (line 10) | type xlsxTable struct
type xlsxAutoFilter (line 37) | type xlsxAutoFilter struct
type xlsxFilterColumn (line 47) | type xlsxFilterColumn struct
type xlsxCustomFilters (line 62) | type xlsxCustomFilters struct
type xlsxCustomFilter (line 73) | type xlsxCustomFilter struct
type xlsxFilters (line 81) | type xlsxFilters struct
type xlsxFilter (line 90) | type xlsxFilter struct
type xlsxColorFilter (line 99) | type xlsxColorFilter struct
type xlsxDynamicFilter (line 110) | type xlsxDynamicFilter struct
type xlsxIconFilter (line 121) | type xlsxIconFilter struct
type xlsxTop10 (line 128) | type xlsxTop10 struct
type xlsxDateGroupItem (line 142) | type xlsxDateGroupItem struct
type xlsxTableColumns (line 154) | type xlsxTableColumns struct
type xlsxTableColumn (line 161) | type xlsxTableColumn struct
type xlsxTableStyleInfo (line 179) | type xlsxTableStyleInfo struct
type formatTable (line 188) | type formatTable struct
type formatAutoFilter (line 198) | type formatAutoFilter struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlWorkbook.go
type xlsxWorkbookRels (line 6) | type xlsxWorkbookRels struct
type xlsxWorkbookRelation (line 12) | type xlsxWorkbookRelation struct
type xlsxWorkbook (line 22) | type xlsxWorkbook struct
type xlsxFileRecoveryPr (line 42) | type xlsxFileRecoveryPr struct
type xlsxWorkbookProtection (line 58) | type xlsxWorkbookProtection struct
type xlsxFileVersion (line 75) | type xlsxFileVersion struct
type xlsxWorkbookPr (line 86) | type xlsxWorkbookPr struct
type xlsxBookViews (line 111) | type xlsxBookViews struct
type xlsxWorkBookView (line 118) | type xlsxWorkBookView struct
type xlsxSheets (line 136) | type xlsxSheets struct
type xlsxSheet (line 143) | type xlsxSheet struct
type xlsxExternalReferences (line 152) | type xlsxExternalReferences struct
type xlsxExternalReference (line 158) | type xlsxExternalReference struct
type xlsxPivotCaches (line 164) | type xlsxPivotCaches struct
type xlsxPivotCache (line 169) | type xlsxPivotCache struct
type xlsxExtLst (line 182) | type xlsxExtLst struct
type xlsxDefinedNames (line 190) | type xlsxDefinedNames struct
type xlsxDefinedName (line 199) | type xlsxDefinedName struct
type xlsxCalcPr (line 222) | type xlsxCalcPr struct
type xlsxCustomWorkbookViews (line 243) | type xlsxCustomWorkbookViews struct
type xlsxCustomWorkbookView (line 257) | type xlsxCustomWorkbookView struct
FILE: vendor/github.com/360EntSecGroup-Skylar/excelize/xmlWorksheet.go
type xlsxWorksheet (line 8) | type xlsxWorksheet struct
type xlsxDrawing (line 35) | type xlsxDrawing struct
type xlsxHeaderFooter (line 46) | type xlsxHeaderFooter struct
type xlsxOddHeader (line 56) | type xlsxOddHeader struct
type xlsxOddFooter (line 63) | type xlsxOddFooter struct
type xlsxPageSetUp (line 70) | type xlsxPageSetUp struct
type xlsxPrintOptions (line 96) | type xlsxPrintOptions struct
type xlsxPageMargins (line 107) | type xlsxPageMargins struct
type xlsxSheetFormatPr (line 119) | type xlsxSheetFormatPr struct
type xlsxSheetViews (line 134) | type xlsxSheetViews struct
type xlsxSheetView (line 149) | type xlsxSheetView struct
type xlsxSelection (line 175) | type xlsxSelection struct
type xlsxPane (line 183) | type xlsxPane struct
type xlsxSheetPr (line 194) | type xlsxSheetPr struct
type xlsxPageSetUpPr (line 210) | type xlsxPageSetUpPr struct
type xlsxTabColor (line 217) | type xlsxTabColor struct
type xlsxCols (line 225) | type xlsxCols struct
type xlsxCol (line 231) | type xlsxCol struct
type xlsxDimension (line 251) | type xlsxDimension struct
type xlsxSheetData (line 258) | type xlsxSheetData struct
type xlsxRow (line 266) | type xlsxRow struct
type xlsxMergeCell (line 283) | type xlsxMergeCell struct
type xlsxMergeCells (line 289) | type xlsxMergeCells struct
type xlsxDataValidations (line 296) | type xlsxDataValidations struct
type xlsxC (line 320) | type xlsxC struct
type xlsxIS (line 335) | type xlsxIS struct
type xlsxF (line 342) | type xlsxF struct
type xlsxSheetProtection (line 351) | type xlsxSheetProtection struct
type xlsxPhoneticPr (line 381) | type xlsxPhoneticPr struct
type xlsxConditionalFormatting (line 391) | type xlsxConditionalFormatting struct
type xlsxCfRule (line 398) | type xlsxCfRule struct
type xlsxColorScale (line 421) | type xlsxColorScale struct
type xlsxDataBar (line 427) | type xlsxDataBar struct
type xlsxIconSet (line 436) | type xlsxIconSet struct
type xlsxCfvo (line 446) | type xlsxCfvo struct
type xlsxHyperlinks (line 457) | type xlsxHyperlinks struct
type xlsxHyperlink (line 463) | type xlsxHyperlink struct
type xlsxTableParts (line 501) | type xlsxTableParts struct
type xlsxTablePart (line 508) | type xlsxTablePart struct
type xlsxPicture (line 518) | type xlsxPicture struct
type xlsxLegacyDrawing (line 531) | type xlsxLegacyDrawing struct
type formatPanes (line 536) | type formatPanes struct
type formatConditional (line 551) | type formatConditional struct
FILE: vendor/github.com/PuerkitoBio/purell/purell.go
type NormalizationFlags (line 24) | type NormalizationFlags
constant FlagLowercaseScheme (line 28) | FlagLowercaseScheme NormalizationFlags = 1 << iota
constant FlagLowercaseHost (line 29) | FlagLowercaseHost
constant FlagUppercaseEscapes (line 30) | FlagUppercaseEscapes
constant FlagDecodeUnnecessaryEscapes (line 31) | FlagDecodeUnnecessaryEscapes
constant FlagEncodeNecessaryEscapes (line 32) | FlagEncodeNecessaryEscapes
constant FlagRemoveDefaultPort (line 33) | FlagRemoveDefaultPort
constant FlagRemoveEmptyQuerySeparator (line 34) | FlagRemoveEmptyQuerySeparator
constant FlagRemoveTrailingSlash (line 37) | FlagRemoveTrailingSlash
constant FlagAddTrailingSlash (line 38) | FlagAddTrailingSlash
constant FlagRemoveDotSegments (line 39) | FlagRemoveDotSegments
constant FlagRemoveDirectoryIndex (line 42) | FlagRemoveDirectoryIndex
constant FlagRemoveFragment (line 43) | FlagRemoveFragment
constant FlagForceHTTP (line 44) | FlagForceHTTP
constant FlagRemoveDuplicateSlashes (line 45) | FlagRemoveDuplicateSlashes
constant FlagRemoveWWW (line 46) | FlagRemoveWWW
constant FlagAddWWW (line 47) | FlagAddWWW
constant FlagSortQuery (line 48) | FlagSortQuery
constant FlagDecodeDWORDHost (line 52) | FlagDecodeDWORDHost
constant FlagDecodeOctalHost (line 53) | FlagDecodeOctalHost
constant FlagDecodeHexHost (line 54) | FlagDecodeHexHost
constant FlagRemoveUnnecessaryHostDots (line 55) | FlagRemoveUnnecessaryHostDots
constant FlagRemoveEmptyPortSeparator (line 56) | FlagRemoveEmptyPortSeparator
constant FlagsSafe (line 59) | FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme |...
constant FlagsUsuallySafeGreedy (line 65) | FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTra...
constant FlagsUsuallySafeNonGreedy (line 66) | FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTraili...
constant FlagsUnsafeGreedy (line 69) | FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagR...
constant FlagsUnsafeNonGreedy (line 70) | FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | Fl...
constant FlagsAllGreedy (line 73) | FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecode...
constant FlagsAllNonGreedy (line 74) | FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDec...
constant defaultHttpPort (line 78) | defaultHttpPort = ":80"
constant defaultHttpsPort (line 79) | defaultHttpsPort = ":443"
function MustNormalizeURLString (line 142) | func MustNormalizeURLString(u string, f NormalizationFlags) string {
function NormalizeURLString (line 152) | func NormalizeURLString(u string, f NormalizationFlags) (string, error) {
function NormalizeURL (line 177) | func NormalizeURL(u *url.URL, f NormalizationFlags) string {
function lowercaseScheme (line 186) | func lowercaseScheme(u *url.URL) {
function lowercaseHost (line 192) | func lowercaseHost(u *url.URL) {
function removeDefaultPort (line 198) | func removeDefaultPort(u *url.URL) {
function removeTrailingSlash (line 210) | func removeTrailingSlash(u *url.URL) {
function addTrailingSlash (line 222) | func addTrailingSlash(u *url.URL) {
function removeDotSegments (line 234) | func removeDotSegments(u *url.URL) {
function removeDirectoryIndex (line 262) | func removeDirectoryIndex(u *url.URL) {
function removeFragment (line 268) | func removeFragment(u *url.URL) {
function forceHTTP (line 272) | func forceHTTP(u *url.URL) {
function removeDuplicateSlashes (line 278) | func removeDuplicateSlashes(u *url.URL) {
function removeWWW (line 284) | func removeWWW(u *url.URL) {
function addWWW (line 290) | func addWWW(u *url.URL) {
function sortQuery (line 296) | func sortQuery(u *url.URL) {
function decodeDWORDHost (line 323) | func decodeDWORDHost(u *url.URL) {
function decodeOctalHost (line 337) | func decodeOctalHost(u *url.URL) {
function decodeHexHost (line 350) | func decodeHexHost(u *url.URL) {
function removeUnncessaryHostDots (line 363) | func removeUnncessaryHostDots(u *url.URL) {
function removeEmptyPortSeparator (line 375) | func removeEmptyPortSeparator(u *url.URL) {
FILE: vendor/github.com/PuerkitoBio/urlesc/urlesc.go
type encoding (line 17) | type encoding
constant encodePath (line 20) | encodePath encoding = 1 + iota
constant encodeUserPassword (line 21) | encodeUserPassword
constant encodeQueryComponent (line 22) | encodeQueryComponent
constant encodeFragment (line 23) | encodeFragment
function shouldEscape (line 28) | func shouldEscape(c byte, mode encoding) bool {
function QueryEscape (line 74) | func QueryEscape(s string) string {
function escape (line 78) | func escape(s string, mode encoding) string {
function unescapeUserinfo (line 124) | func unescapeUserinfo(s string) string {
function Escape (line 147) | func Escape(u *url.URL) string {
FILE: vendor/github.com/Unknwon/com/cmd.go
function ExecCmdDirBytes (line 30) | func ExecCmdDirBytes(dir, cmdName string, args ...string) ([]byte, []byt...
function ExecCmdBytes (line 45) | func ExecCmdBytes(cmdName string, args ...string) ([]byte, []byte, error) {
function ExecCmdDir (line 51) | func ExecCmdDir(dir, cmdName string, args ...string) (string, string, er...
function ExecCmd (line 58) | func ExecCmd(cmdName string, args ...string) (string, string, error) {
constant Gray (line 71) | Gray = uint8(iota + 90)
constant Red (line 72) | Red
constant Green (line 73) | Green
constant Yellow (line 74) | Yellow
constant Blue (line 75) | Blue
constant Magenta (line 76) | Magenta
constant EndColor (line 78) | EndColor = "\033[0m"
function getColorLevel (line 82) | func getColorLevel(level string) string {
function ColorLogS (line 107) | func ColorLogS(format string, a ...interface{}) string {
function ColorLog (line 159) | func ColorLog(format string, a ...interface{}) {
FILE: vendor/github.com/Unknwon/com/convert.go
type StrTo (line 23) | type StrTo
method Exist (line 25) | func (f StrTo) Exist() bool {
method Uint8 (line 29) | func (f StrTo) Uint8() (uint8, error) {
method Int (line 34) | func (f StrTo) Int() (int, error) {
method Int64 (line 39) | func (f StrTo) Int64() (int64, error) {
method Float64 (line 44) | func (f StrTo) Float64() (float64, error) {
method MustUint8 (line 49) | func (f StrTo) MustUint8() uint8 {
method MustInt (line 54) | func (f StrTo) MustInt() int {
method MustInt64 (line 59) | func (f StrTo) MustInt64() int64 {
method MustFloat64 (line 64) | func (f StrTo) MustFloat64() float64 {
method String (line 69) | func (f StrTo) String() string {
function ToStr (line 77) | func ToStr(value interface{}, args ...int) (s string) {
type argInt (line 115) | type argInt
method Get (line 117) | func (a argInt) Get(i int, args ...int) (r int) {
function HexStr2int (line 127) | func HexStr2int(hexStr string) (int, error) {
function Int2HexStr (line 149) | func Int2HexStr(num int) (hex string) {
FILE: vendor/github.com/Unknwon/com/dir.go
function IsDir (line 27) | func IsDir(dir string) bool {
function statDir (line 35) | func statDir(dirPath, recPath string, includeDir, isDirOnly, followSymli...
function StatDir (line 94) | func StatDir(rootPath string, includeDir ...bool) ([]string, error) {
function LstatDir (line 113) | func LstatDir(rootPath string, includeDir ...bool) ([]string, error) {
function GetAllSubDirs (line 127) | func GetAllSubDirs(rootPath string) ([]string, error) {
function LgetAllSubDirs (line 137) | func LgetAllSubDirs(rootPath string) ([]string, error) {
function GetFileListBySuffix (line 146) | func GetFileListBySuffix(dirPath, suffix string) ([]string, error) {
function CopyDir (line 180) | func CopyDir(srcPath, destPath string, filters ...func(filePath string) ...
FILE: vendor/github.com/Unknwon/com/file.go
constant Byte (line 28) | Byte = 1
constant KByte (line 29) | KByte = Byte * 1024
constant MByte (line 30) | MByte = KByte * 1024
constant GByte (line 31) | GByte = MByte * 1024
constant TByte (line 32) | TByte = GByte * 1024
constant PByte (line 33) | PByte = TByte * 1024
constant EByte (line 34) | EByte = PByte * 1024
function logn (line 37) | func logn(n, b float64) float64 {
function humanateBytes (line 41) | func humanateBytes(s uint64, base float64, sizes []string) string {
function HumaneFileSize (line 57) | func HumaneFileSize(s uint64) string {
function FileMTime (line 63) | func FileMTime(file string) (int64, error) {
function FileSize (line 72) | func FileSize(file string) (int64, error) {
function Copy (line 81) | func Copy(src, dest string) error {
function WriteFile (line 125) | func WriteFile(filename string, data []byte) error {
function IsFile (line 132) | func IsFile(filePath string) bool {
function IsExist (line 142) | func IsExist(path string) bool {
FILE: vendor/github.com/Unknwon/com/html.go
function Html2JS (line 24) | func Html2JS(data []byte) []byte {
function HtmlEncode (line 35) | func HtmlEncode(str string) string {
function HtmlDecode (line 40) | func HtmlDecode(str string) string {
function StripTags (line 45) | func StripTags(src string) string {
function Nl2br (line 58) | func Nl2br(str string) string {
FILE: vendor/github.com/Unknwon/com/http.go
type NotFoundError (line 28) | type NotFoundError struct
method Error (line 32) | func (e NotFoundError) Error() string {
type RemoteError (line 36) | type RemoteError struct
method Error (line 41) | func (e *RemoteError) Error() string {
function HttpCall (line 48) | func HttpCall(client *http.Client, method, url string, header http.Heade...
function HttpGet (line 75) | func HttpGet(client *http.Client, url string, header http.Header) (io.Re...
function HttpPost (line 81) | func HttpPost(client *http.Client, url string, header http.Header, body ...
function HttpGetToFile (line 87) | func HttpGetToFile(client *http.Client, url string, header http.Header, ...
function HttpGetBytes (line 106) | func HttpGetBytes(client *http.Client, url string, header http.Header) (...
function HttpGetJSON (line 117) | func HttpGetJSON(client *http.Client, url string, v interface{}) error {
function HttpPostJSON (line 133) | func HttpPostJSON(client *http.Client, url string, body, v interface{}) ...
type RawFile (line 151) | type RawFile interface
function FetchFiles (line 159) | func FetchFiles(client *http.Client, files []RawFile, header http.Header...
function FetchFilesCurl (line 181) | func FetchFilesCurl(files []RawFile, curlOptions ...string) error {
FILE: vendor/github.com/Unknwon/com/math.go
function PowInt (line 18) | func PowInt(x int, y int) int {
FILE: vendor/github.com/Unknwon/com/path.go
function GetGOPATHs (line 26) | func GetGOPATHs() []string {
function GetSrcPath (line 41) | func GetSrcPath(importPath string) (appPath string, err error) {
function HomeDir (line 65) | func HomeDir() (home string, err error) {
FILE: vendor/github.com/Unknwon/com/regex.go
constant regex_email_pattern (line 20) | regex_email_pattern = `(?i)[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{...
constant regex_strict_email_pattern (line 21) | regex_strict_email_pattern = `(?i)[A-Z0-9!#$%&'*+/=?^_{|}~-]+` +
constant regex_url_pattern (line 25) | regex_url_pattern = `(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)...
function init (line 34) | func init() {
function IsEmail (line 42) | func IsEmail(email string) bool {
function IsEmailRFC (line 48) | func IsEmailRFC(email string) bool {
function IsUrl (line 54) | func IsUrl(url string) bool {
FILE: vendor/github.com/Unknwon/com/slice.go
function AppendStr (line 22) | func AppendStr(strs []string, str string) []string {
function CompareSliceStr (line 33) | func CompareSliceStr(s1, s2 []string) bool {
function CompareSliceStrU (line 49) | func CompareSliceStrU(s1, s2 []string) bool {
function IsSliceContainsStr (line 69) | func IsSliceContainsStr(sl []string, str string) bool {
function IsSliceContainsInt64 (line 80) | func IsSliceContainsInt64(sl []int64, i int64) bool {
FILE: vendor/github.com/Unknwon/com/string.go
function AESGCMEncrypt (line 32) | func AESGCMEncrypt(key, plaintext []byte) ([]byte, error) {
function AESGCMDecrypt (line 53) | func AESGCMDecrypt(key, ciphertext []byte) ([]byte, error) {
function IsLetter (line 81) | func IsLetter(l uint8) bool {
function Expand (line 90) | func Expand(template string, match map[string]string, subs ...string) st...
function Reverse (line 118) | func Reverse(s string) string {
function RandomCreateBytes (line 129) | func RandomCreateBytes(n int, alphabets ...byte) []byte {
function ToSnakeCase (line 167) | func ToSnakeCase(str string) string {
FILE: vendor/github.com/Unknwon/com/time.go
function Date (line 25) | func Date(ti int64, format string) string {
function DateS (line 31) | func DateS(ts string, format string) string {
function DateT (line 51) | func DateT(t time.Time, format string) string {
function DateParse (line 111) | func DateParse(dateString, format string) (time.Time, error) {
FILE: vendor/github.com/Unknwon/com/url.go
function UrlEncode (line 23) | func UrlEncode(str string) string {
function UrlDecode (line 28) | func UrlDecode(str string) (string, error) {
function Base64Encode (line 33) | func Base64Encode(str string) string {
function Base64Decode (line 38) | func Base64Decode(str string) (string, error) {
FILE: vendor/github.com/alecthomas/template/exec.go
type state (line 22) | type state struct
method push (line 36) | func (s *state) push(name string, value reflect.Value) {
method mark (line 41) | func (s *state) mark() int {
method pop (line 46) | func (s *state) pop(mark int) {
method setVar (line 51) | func (s *state) setVar(n int, value reflect.Value) {
method varValue (line 56) | func (s *state) varValue(name string) reflect.Value {
method at (line 69) | func (s *state) at(node parse.Node) {
method errorf (line 83) | func (s *state) errorf(format string, args ...interface{}) {
method walk (line 162) | func (s *state) walk(dot reflect.Value, node parse.Node) {
method walkIfOrWith (line 195) | func (s *state) walkIfOrWith(typ parse.NodeType, dot reflect.Value, pi...
method walkRange (line 243) | func (s *state) walkRange(dot reflect.Value, r *parse.RangeNode) {
method walkTemplate (line 304) | func (s *state) walkTemplate(dot reflect.Value, t *parse.TemplateNode) {
method evalPipeline (line 327) | func (s *state) evalPipeline(dot reflect.Value, pipe *parse.PipeNode) ...
method notAFunction (line 345) | func (s *state) notAFunction(args []parse.Node, final reflect.Value) {
method evalCommand (line 351) | func (s *state) evalCommand(dot reflect.Value, cmd *parse.CommandNode,...
method idealConstant (line 389) | func (s *state) idealConstant(constant *parse.NumberNode) reflect.Value {
method evalFieldNode (line 415) | func (s *state) evalFieldNode(dot reflect.Value, field *parse.FieldNod...
method evalChainNode (line 420) | func (s *state) evalChainNode(dot reflect.Value, chain *parse.ChainNod...
method evalVariableNode (line 430) | func (s *state) evalVariableNode(dot reflect.Value, variable *parse.Va...
method evalFieldChain (line 444) | func (s *state) evalFieldChain(dot, receiver reflect.Value, node parse...
method evalFunction (line 453) | func (s *state) evalFunction(dot reflect.Value, node *parse.Identifier...
method evalField (line 466) | func (s *state) evalField(dot reflect.Value, fieldName string, node pa...
method evalCall (line 524) | func (s *state) evalCall(dot, fun reflect.Value, node parse.Node, name...
method validateType (line 587) | func (s *state) validateType(value reflect.Value, typ reflect.Type) re...
method evalArg (line 622) | func (s *state) evalArg(dot reflect.Value, typ reflect.Type, n parse.N...
method evalBool (line 665) | func (s *state) evalBool(typ reflect.Type, n parse.Node) reflect.Value {
method evalString (line 676) | func (s *state) evalString(typ reflect.Type, n parse.Node) reflect.Val...
method evalInteger (line 687) | func (s *state) evalInteger(typ reflect.Type, n parse.Node) reflect.Va...
method evalUnsignedInteger (line 698) | func (s *state) evalUnsignedInteger(typ reflect.Type, n parse.Node) re...
method evalFloat (line 709) | func (s *state) evalFloat(typ reflect.Type, n parse.Node) reflect.Value {
method evalComplex (line 720) | func (s *state) evalComplex(typ reflect.Type, n parse.Node) reflect.Va...
method evalEmptyInterface (line 730) | func (s *state) evalEmptyInterface(dot reflect.Value, n parse.Node) re...
method printValue (line 774) | func (s *state) printValue(n parse.Node, v reflect.Value) {
type variable (line 30) | type variable struct
function doublePercent (line 75) | func doublePercent(str string) string {
function errRecover (line 96) | func errRecover(errp *error) {
method ExecuteTemplate (line 116) | func (t *Template) ExecuteTemplate(wr io.Writer, name string, data inter...
method Execute (line 130) | func (t *Template) Execute(wr io.Writer, data interface{}) (err error) {
function isTrue (line 215) | func isTrue(val reflect.Value) (truth, ok bool) {
function isHexConstant (line 411) | func isHexConstant(s string) bool {
function canBeNil (line 578) | func canBeNil(typ reflect.Type) bool {
function indirect (line 760) | func indirect(v reflect.Value) (rv reflect.Value, isNil bool) {
function printableValue (line 785) | func printableValue(v reflect.Value) (interface{}, bool) {
type rvs (line 808) | type rvs
method Len (line 810) | func (x rvs) Len() int { return len(x) }
method Swap (line 811) | func (x rvs) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
type rvInts (line 813) | type rvInts struct
method Less (line 815) | func (x rvInts) Less(i, j int) bool { return x.rvs[i].Int() < x.rvs[j]...
type rvUints (line 817) | type rvUints struct
method Less (line 819) | func (x rvUints) Less(i, j int) bool { return x.rvs[i].Uint() < x.rvs[...
type rvFloats (line 821) | type rvFloats struct
method Less (line 823) | func (x rvFloats) Less(i, j int) bool { return x.rvs[i].Float() < x.rv...
type rvStrings (line 825) | type rvStrings struct
method Less (line 827) | func (x rvStrings) Less(i, j int) bool { return x.rvs[i].String() < x....
function sortKeys (line 830) | func sortKeys(v []reflect.Value) []reflect.Value {
FILE: vendor/github.com/alecthomas/template/funcs.go
type FuncMap (line 24) | type FuncMap
function createValueFuncs (line 52) | func createValueFuncs(funcMap FuncMap) map[string]reflect.Value {
function addValueFuncs (line 59) | func addValueFuncs(out map[string]reflect.Value, in FuncMap) {
function addFuncs (line 74) | func addFuncs(out, in FuncMap) {
function goodFunc (line 81) | func goodFunc(typ reflect.Type) bool {
function findFunction (line 93) | func findFunction(name string, tmpl *Template) (reflect.Value, bool) {
function index (line 110) | func index(item interface{}, indices ...interface{}) (interface{}, error) {
function length (line 155) | func length(item interface{}) (int, error) {
function call (line 171) | func call(fn interface{}, args ...interface{}) (interface{}, error) {
function truth (line 219) | func truth(a interface{}) bool {
function and (line 226) | func and(arg0 interface{}, args ...interface{}) interface{} {
function or (line 241) | func or(arg0 interface{}, args ...interface{}) interface{} {
function not (line 255) | func not(arg interface{}) (truth bool) {
type kind (line 270) | type kind
constant invalidKind (line 273) | invalidKind kind = iota
constant boolKind (line 274) | boolKind
constant complexKind (line 275) | complexKind
constant intKind (line 276) | intKind
constant floatKind (line 277) | floatKind
constant integerKind (line 278) | integerKind
constant stringKind (line 279) | stringKind
constant uintKind (line 280) | uintKind
function basicKind (line 283) | func basicKind(v reflect.Value) (kind, error) {
function eq (line 302) | func eq(arg1 interface{}, arg2 ...interface{}) (bool, error) {
function ne (line 354) | func ne(arg1, arg2 interface{}) (bool, error) {
function lt (line 361) | func lt(arg1, arg2 interface{}) (bool, error) {
function le (line 403) | func le(arg1, arg2 interface{}) (bool, error) {
function gt (line 413) | func gt(arg1, arg2 interface{}) (bool, error) {
function ge (line 423) | func ge(arg1, arg2 interface{}) (bool, error) {
function HTMLEscape (line 443) | func HTMLEscape(w io.Writer, b []byte) {
function HTMLEscapeString (line 469) | func HTMLEscapeString(s string) string {
function HTMLEscaper (line 481) | func HTMLEscaper(args ...interface{}) string {
function JSEscape (line 499) | func JSEscape(w io.Writer, b []byte) {
function JSEscapeString (line 546) | func JSEscapeString(s string) string {
function jsIsSpecial (line 556) | func jsIsSpecial(r rune) bool {
function JSEscaper (line 566) | func JSEscaper(args ...interface{}) string {
function URLQueryEscaper (line 572) | func URLQueryEscaper(args ...interface{}) string {
function evalArgs (line 581) | func evalArgs(args []interface{}) string {
FILE: vendor/github.com/alecthomas/template/helper.go
function Must (line 21) | func Must(t *Template, err error) *Template {
function ParseFiles (line 32) | func ParseFiles(filenames ...string) (*Template, error) {
method ParseFiles (line 39) | func (t *Template) ParseFiles(filenames ...string) (*Template, error) {
function parseFiles (line 45) | func parseFiles(t *Template, filenames ...string) (*Template, error) {
function ParseGlob (line 85) | func ParseGlob(pattern string) (*Template, error) {
method ParseGlob (line 94) | func (t *Template) ParseGlob(pattern string) (*Template, error) {
function parseGlob (line 99) | func parseGlob(t *Template, pattern string) (*Template, error) {
FILE: vendor/github.com/alecthomas/template/parse/lex.go
type item (line 15) | type item struct
method String (line 21) | func (i item) String() string {
type itemType (line 36) | type itemType
constant itemError (line 39) | itemError itemType = iota
constant itemBool (line 40) | itemBool
constant itemChar (line 41) | itemChar
constant itemCharConstant (line 42) | itemCharConstant
constant itemComplex (line 43) | itemComplex
constant itemColonEquals (line 44) | itemColonEquals
constant itemEOF (line 45) | itemEOF
constant itemField (line 46) | itemField
constant itemIdentifier (line 47) | itemIdentifier
constant itemLeftDelim (line 48) | itemLeftDelim
constant itemLeftParen (line 49) | itemLeftParen
constant itemNumber (line 50) | itemNumber
constant itemPipe (line 51) | itemPipe
constant itemRawString (line 52) | itemRawString
constant itemRightDelim (line 53) | itemRightDelim
constant itemElideNewline (line 54) | itemElideNewline
constant itemRightParen (line 55) | itemRightParen
constant itemSpace (line 56) | itemSpace
constant itemString (line 57) | itemString
constant itemText (line 58) | itemText
constant itemVariable (line 59) | itemVariable
constant itemKeyword (line 61) | itemKeyword
constant itemDot (line 62) | itemDot
constant itemDefine (line 63) | itemDefine
constant itemElse (line 64) | itemElse
constant itemEnd (line 65) | itemEnd
constant itemIf (line 66) | itemIf
constant itemNil (line 67) | itemNil
constant itemRange (line 68) | itemRange
constant itemTemplate (line 69) | itemTemplate
constant itemWith (line 70) | itemWith
constant eof (line 85) | eof = -1
type stateFn (line 88) | type stateFn
type lexer (line 91) | type lexer struct
method next (line 106) | func (l *lexer) next() rune {
method peek (line 118) | func (l *lexer) peek() rune {
method backup (line 125) | func (l *lexer) backup() {
method emit (line 130) | func (l *lexer) emit(t itemType) {
method ignore (line 136) | func (l *lexer) ignore() {
method accept (line 141) | func (l *lexer) accept(valid string) bool {
method acceptRun (line 150) | func (l *lexer) acceptRun(valid string) {
method lineNumber (line 159) | func (l *lexer) lineNumber() int {
method errorf (line 165) | func (l *lexer) errorf(format string, args ...interface{}) stateFn {
method nextItem (line 171) | func (l *lexer) nextItem() item {
method run (line 197) | func (l *lexer) run() {
method atTerminator (line 423) | func (l *lexer) atTerminator() bool {
method scanNumber (line 482) | func (l *lexer) scanNumber() bool {
function lex (line 178) | func lex(name, input, left, right string) *lexer {
constant leftDelim (line 206) | leftDelim = "{{"
constant rightDelim (line 207) | rightDelim = "}}"
constant leftComment (line 208) | leftComment = "/*"
constant rightComment (line 209) | rightComment = "*/"
function lexText (line 213) | func lexText(l *lexer) stateFn {
function lexLeftDelim (line 234) | func lexLeftDelim(l *lexer) stateFn {
function lexComment (line 245) | func lexComment(l *lexer) stateFn {
function lexRightDelim (line 262) | func lexRightDelim(l *lexer) stateFn {
function lexInsideAction (line 273) | func lexInsideAction(l *lexer) stateFn {
function lexSpace (line 340) | func lexSpace(l *lexer) stateFn {
function lexIdentifier (line 349) | func lexIdentifier(l *lexer) stateFn {
function lexField (line 379) | func lexField(l *lexer) stateFn {
function lexVariable (line 385) | func lexVariable(l *lexer) stateFn {
function lexFieldOrVariable (line 395) | func lexFieldOrVariable(l *lexer, typ itemType) stateFn {
function lexChar (line 443) | func lexChar(l *lexer) stateFn {
function lexNumber (line 466) | func lexNumber(l *lexer) stateFn {
function lexQuote (line 509) | func lexQuote(l *lexer) stateFn {
function lexRawQuote (line 529) | func lexRawQuote(l *lexer) stateFn {
function isSpace (line 544) | func isSpace(r rune) bool {
function isEndOfLine (line 549) | func isEndOfLine(r rune) bool {
function isAlphaNumeric (line 554) | func isAlphaNumeric(r rune) bool {
FILE: vendor/github.com/alecthomas/template/parse/node.go
type Node (line 21) | type Node interface
type NodeType (line 35) | type NodeType
method Type (line 47) | func (t NodeType) Type() NodeType {
type Pos (line 39) | type Pos
method Position (line 41) | func (p Pos) Position() Pos {
constant NodeText (line 52) | NodeText NodeType = iota
constant NodeAction (line 53) | NodeAction
constant NodeBool (line 54) | NodeBool
constant NodeChain (line 55) | NodeChain
constant NodeCommand (line 56) | NodeCommand
constant NodeDot (line 57) | NodeDot
constant nodeElse (line 58) | nodeElse
constant nodeEnd (line 59) | nodeEnd
constant NodeField (line 60) | NodeField
constant NodeIdentifier (line 61) | NodeIdentifier
constant NodeIf (line 62) | NodeIf
constant NodeList (line 63) | NodeList
constant NodeNil (line 64) | NodeNil
constant NodeNumber (line 65) | NodeNumber
constant NodePipe (line 66) | NodePipe
constant NodeRange (line 67) | NodeRange
constant NodeString (line 68) | NodeString
constant NodeTemplate (line 69) | NodeTemplate
constant NodeVariable (line 70) | NodeVariable
constant NodeWith (line 71) | NodeWith
type ListNode (line 77) | type ListNode struct
method append (line 88) | func (l *ListNode) append(n Node) {
method tree (line 92) | func (l *ListNode) tree() *Tree {
method String (line 96) | func (l *ListNode) String() string {
method CopyList (line 104) | func (l *ListNode) CopyList() *ListNode {
method Copy (line 115) | func (l *ListNode) Copy() Node {
method newList (line 84) | func (t *Tree) newList(pos Pos) *ListNode {
type TextNode (line 120) | type TextNode struct
method String (line 131) | func (t *TextNode) String() string {
method tree (line 135) | func (t *TextNode) tree() *Tree {
method Copy (line 139) | func (t *TextNode) Copy() Node {
method newText (line 127) | func (t *Tree) newText(pos Pos, text string) *TextNode {
type PipeNode (line 144) | type PipeNode struct
method append (line 157) | func (p *PipeNode) append(command *CommandNode) {
method String (line 161) | func (p *PipeNode) String() string {
method tree (line 181) | func (p *PipeNode) tree() *Tree {
method CopyPipe (line 185) | func (p *PipeNode) CopyPipe() *PipeNode {
method Copy (line 200) | func (p *PipeNode) Copy() Node {
method newPipeline (line 153) | func (t *Tree) newPipeline(pos Pos, line int, decl []*VariableNode) *Pip...
type ActionNode (line 207) | type ActionNode struct
method String (line 219) | func (a *ActionNode) String() string {
method tree (line 224) | func (a *ActionNode) tree() *Tree {
method Copy (line 228) | func (a *ActionNode) Copy() Node {
method newAction (line 215) | func (t *Tree) newAction(pos Pos, line int, pipe *PipeNode) *ActionNode {
type CommandNode (line 234) | type CommandNode struct
method append (line 245) | func (c *CommandNode) append(arg Node) {
method String (line 249) | func (c *CommandNode) String() string {
method tree (line 264) | func (c *CommandNode) tree() *Tree {
method Copy (line 268) | func (c *CommandNode) Copy() Node {
method newCommand (line 241) | func (t *Tree) newCommand(pos Pos) *CommandNode {
type IdentifierNode (line 280) | type IdentifierNode struct
method SetPos (line 295) | func (i *IdentifierNode) SetPos(pos Pos) *IdentifierNode {
method SetTree (line 303) | func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode {
method String (line 308) | func (i *IdentifierNode) String() string {
method tree (line 312) | func (i *IdentifierNode) tree() *Tree {
method Copy (line 316) | func (i *IdentifierNode) Copy() Node {
function NewIdentifier (line 288) | func NewIdentifier(ident string) *IdentifierNode {
type VariableNode (line 322) | type VariableNode struct
method String (line 333) | func (v *VariableNode) String() string {
method tree (line 344) | func (v *VariableNode) tree() *Tree {
method Copy (line 348) | func (v *VariableNode) Copy() Node {
method newVariable (line 329) | func (t *Tree) newVariable(pos Pos, ident string) *VariableNode {
type DotNode (line 353) | type DotNode struct
method Type (line 363) | func (d *DotNode) Type() NodeType {
method String (line 370) | func (d *DotNode) String() string {
method tree (line 374) | func (d *DotNode) tree() *Tree {
method Copy (line 378) | func (d *DotNode) Copy() Node {
method newDot (line 359) | func (t *Tree) newDot(pos Pos) *DotNode {
type NilNode (line 383) | type NilNode struct
method Type (line 393) | func (n *NilNode) Type() NodeType {
method String (line 400) | func (n *NilNode) String() string {
method tree (line 404) | func (n *NilNode) tree() *Tree {
method Copy (line 408) | func (n *NilNode) Copy() Node {
method newNil (line 389) | func (t *Tree) newNil(pos Pos) *NilNode {
type FieldNode (line 415) | type FieldNode struct
method String (line 426) | func (f *FieldNode) String() string {
method tree (line 434) | func (f *FieldNode) tree() *Tree {
method Copy (line 438) | func (f *FieldNode) Copy() Node {
method newField (line 422) | func (t *Tree) newField(pos Pos, ident string) *FieldNode {
type ChainNode (line 445) | type ChainNode struct
method Add (line 458) | func (c *ChainNode) Add(field string) {
method String (line 469) | func (c *ChainNode) String() string {
method tree (line 480) | func (c *ChainNode) tree() *Tree {
method Copy (line 484) | func (c *ChainNode) Copy() Node {
method newChain (line 453) | func (t *Tree) newChain(pos Pos, node Node) *ChainNode {
type BoolNode (line 489) | type BoolNode struct
method String (line 500) | func (b *BoolNode) String() string {
method tree (line 507) | func (b *BoolNode) tree() *Tree {
method Copy (line 511) | func (b *BoolNode) Copy() Node {
method newBool (line 496) | func (t *Tree) newBool(pos Pos, true bool) *BoolNode {
type NumberNode (line 518) | type NumberNode struct
method simplifyComplex (line 616) | func (n *NumberNode) simplifyComplex() {
method String (line 631) | func (n *NumberNode) String() string {
method tree (line 635) | func (n *NumberNode) tree() *Tree {
method Copy (line 639) | func (n *NumberNode) Copy() Node {
method newNumber (line 533) | func (t *Tree) newNumber(pos Pos, text string, typ itemType) (*NumberNod...
type StringNode (line 646) | type StringNode struct
method String (line 658) | func (s *StringNode) String() string {
method tree (line 662) | func (s *StringNode) tree() *Tree {
method Copy (line 666) | func (s *StringNode) Copy() Node {
method newString (line 654) | func (t *Tree) newString(pos Pos, orig, text string) *StringNode {
type endNode (line 672) | type endNode struct
method String (line 682) | func (e *endNode) String() string {
method tree (line 686) | func (e *endNode) tree() *Tree {
method Copy (line 690) | func (e *endNode) Copy() Node {
method newEnd (line 678) | func (t *Tree) newEnd(pos Pos) *endNode {
type elseNode (line 695) | type elseNode struct
method Type (line 706) | func (e *elseNode) Type() NodeType {
method String (line 710) | func (e *elseNode) String() string {
method tree (line 714) | func (e *elseNode) tree() *Tree {
method Copy (line 718) | func (e *elseNode) Copy() Node {
method newElse (line 702) | func (t *Tree) newElse(pos Pos, line int) *elseNode {
type BranchNode (line 723) | type BranchNode struct
method String (line 733) | func (b *BranchNode) String() string {
method tree (line 751) | func (b *BranchNode) tree() *Tree {
method Copy (line 755) | func (b *BranchNode) Copy() Node {
type IfNode (line 769) | type IfNode struct
method Copy (line 777) | func (i *IfNode) Copy() Node {
method newIf (line 773) | func (t *Tree) newIf(pos Pos, line int, pipe *PipeNode, list, elseList *...
type RangeNode (line 782) | type RangeNode struct
method Copy (line 790) | func (r *RangeNode) Copy() Node {
method newRange (line 786) | func (t *Tree) newRange(pos Pos, line int, pipe *PipeNode, list, elseLis...
type WithNode (line 795) | type WithNode struct
method Copy (line 803) | func (w *WithNode) Copy() Node {
method newWith (line 799) | func (t *Tree) newWith(pos Pos, line int, pipe *PipeNode, list, elseList...
type TemplateNode (line 808) | type TemplateNode struct
method String (line 821) | func (t *TemplateNode) String() string {
method tree (line 828) | func (t *TemplateNode) tree() *Tree {
method Copy (line 832) | func (t *TemplateNode) Copy() Node {
method newTemplate (line 817) | func (t *Tree) newTemplate(pos Pos, line int, name string, pipe *PipeNod...
FILE: vendor/github.com/alecthomas/template/parse/parse.go
type Tree (line 20) | type Tree struct
method Copy (line 34) | func (t *Tree) Copy() *Tree {
method next (line 59) | func (t *Tree) next() item {
method backup (line 69) | func (t *Tree) backup() {
method backup2 (line 75) | func (t *Tree) backup2(t1 item) {
method backup3 (line 82) | func (t *Tree) backup3(t2, t1 item) { // Reverse order: we're pushing ...
method peek (line 89) | func (t *Tree) peek() item {
method nextNonSpace (line 99) | func (t *Tree) nextNonSpace() (token item) {
method peekNonSpace (line 110) | func (t *Tree) peekNonSpace() (token item) {
method ErrorContext (line 134) | func (t *Tree) ErrorContext(n Node) (location, context string) {
method errorf (line 157) | func (t *Tree) errorf(format string, args ...interface{}) {
method error (line 164) | func (t *Tree) error(err error) {
method expect (line 169) | func (t *Tree) expect(expected itemType, context string) item {
method expectOneOf (line 178) | func (t *Tree) expectOneOf(expected1, expected2 itemType, context stri...
method unexpected (line 187) | func (t *Tree) unexpected(token item, context string) {
method recover (line 192) | func (t *Tree) recover(errp *error) {
method startParse (line 207) | func (t *Tree) startParse(funcs []map[string]interface{}, lex *lexer) {
method stopParse (line 215) | func (t *Tree) stopParse() {
method Parse (line 225) | func (t *Tree) Parse(text, leftDelim, rightDelim string, treeSet map[s...
method add (line 237) | func (t *Tree) add(treeSet map[string]*Tree) {
method parse (line 276) | func (t *Tree) parse(treeSet map[string]*Tree) (next Node) {
method parseDefinition (line 303) | func (t *Tree) parseDefinition(treeSet map[string]*Tree) {
method itemList (line 324) | func (t *Tree) itemList() (list *ListNode, next Node) {
method textOrAction (line 340) | func (t *Tree) textOrAction() Node {
method elideNewline (line 356) | func (t *Tree) elideNewline() Node {
method action (line 380) | func (t *Tree) action() (n Node) {
method pipeline (line 402) | func (t *Tree) pipeline(context string) (pipe *PipeNode) {
method parseControl (line 454) | func (t *Tree) parseControl(allowElseIf bool, context string) (pos Pos...
method ifControl (line 492) | func (t *Tree) ifControl() Node {
method rangeControl (line 500) | func (t *Tree) rangeControl() Node {
method withControl (line 508) | func (t *Tree) withControl() Node {
method endControl (line 515) | func (t *Tree) endControl() Node {
method elseControl (line 522) | func (t *Tree) elseControl() Node {
method templateControl (line 536) | func (t *Tree) templateControl() Node {
method command (line 562) | func (t *Tree) command() *CommandNode {
method operand (line 594) | func (t *Tree) operand() Node {
method term (line 629) | func (t *Tree) term() Node {
method hasFunction (line 672) | func (t *Tree) hasFunction(name string) bool {
method popVars (line 685) | func (t *Tree) popVars(n int) {
method useVar (line 691) | func (t *Tree) useVar(pos Pos, name string) Node {
function Parse (line 50) | func Parse(name, text, leftDelim, rightDelim string, funcs ...map[string...
function New (line 124) | func New(name string, funcs ...map[string]interface{}) *Tree {
function IsEmptyTree (line 249) | func IsEmptyTree(n Node) bool {
FILE: vendor/github.com/alecthomas/template/template.go
type common (line 15) | type common struct
type Template (line 27) | type Template struct
method Name (line 43) | func (t *Template) Name() string {
method New (line 50) | func (t *Template) New(name string) *Template {
method init (line 60) | func (t *Template) init() {
method Clone (line 75) | func (t *Template) Clone() (*Template, error) {
method copy (line 97) | func (t *Template) copy(c *common) *Template {
method AddParseTree (line 108) | func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Templ...
method Templates (line 120) | func (t *Template) Templates() []*Template {
method Delims (line 137) | func (t *Template) Delims(left, right string) *Template {
method Funcs (line 147) | func (t *Template) Funcs(funcMap FuncMap) *Template {
method Lookup (line 156) | func (t *Template) Lookup(name string) *Template {
method Parse (line 170) | func (t *Template) Parse(text string) (*Template, error) {
method associate (line 200) | func (t *Template) associate(new *Template, tree *parse.Tree) (bool, e...
function New (line 36) | func New(name string) *Template {
FILE: vendor/github.com/astaxie/beego/validation/util.go
constant ValidTag (line 27) | ValidTag = "valid"
constant wordsize (line 29) | wordsize = 32 << (^uint(0) >> 32 & 1)
function init (line 52) | func init() {
type CustomFunc (line 64) | type CustomFunc
function AddCustomFunc (line 76) | func AddCustomFunc(name string, f CustomFunc) error {
type ValidFunc (line 86) | type ValidFunc struct
type Funcs (line 92) | type Funcs
method Call (line 95) | func (f Funcs) Call(name string, params ...interface{}) (result []refl...
function isStruct (line 117) | func isStruct(t reflect.Type) bool {
function isStructPtr (line 121) | func isStructPtr(t reflect.Type) bool {
function getValidFuncs (line 125) | func getValidFuncs(f reflect.StructField) (vfs []ValidFunc, err error) {
function getRegFuncs (line 150) | func getRegFuncs(tag, key string) (vfs []ValidFunc, str string, err erro...
function parseFunc (line 171) | func parseFunc(vfunc, key string) (v ValidFunc, err error) {
function numIn (line 221) | func numIn(name string) (num int, err error) {
function trim (line 232) | func trim(name, key string, s []string) (ts []interface{}, err error) {
function parseParam (line 252) | func parseParam(t reflect.Type, s string) (i interface{}, err error) {
function mergeParam (line 293) | func mergeParam(v *Validation, obj interface{}, params []interface{}) []...
FILE: vendor/github.com/astaxie/beego/validation/validation.go
type ValidFormer (line 57) | type ValidFormer interface
type Error (line 62) | type Error struct
method String (line 69) | func (e *Error) String() string {
method Error (line 78) | func (e *Error) Error() string { return e.String() }
type Result (line 82) | type Result struct
method Key (line 88) | func (r *Result) Key(key string) *Result {
method Message (line 96) | func (r *Result) Message(message string, args ...interface{}) *Result {
type Validation (line 108) | type Validation struct
method Clear (line 119) | func (v *Validation) Clear() {
method HasErrors (line 125) | func (v *Validation) HasErrors() bool {
method ErrorMap (line 132) | func (v *Validation) ErrorMap() map[string][]*Error {
method Error (line 137) | func (v *Validation) Error(message string, args ...interface{}) *Result {
method Required (line 147) | func (v *Validation) Required(obj interface{}, key string) *Result {
method Min (line 152) | func (v *Validation) Min(obj interface{}, min int, key string) *Result {
method Max (line 157) | func (v *Validation) Max(obj interface{}, max int, key string) *Result {
method Range (line 162) | func (v *Validation) Range(obj interface{}, min, max int, key string) ...
method MinSize (line 167) | func (v *Validation) MinSize(obj interface{}, min int, key string) *Re...
method MaxSize (line 172) | func (v *Validation) MaxSize(obj interface{}, max int, key string) *Re...
method Length (line 177) | func (v *Validation) Length(obj interface{}, n int, key string) *Result {
method Alpha (line 182) | func (v *Validation) Alpha(obj interface{}, key string) *Result {
method Numeric (line 187) | func (v *Validation) Numeric(obj interface{}, key string) *Result {
method AlphaNumeric (line 192) | func (v *Validation) AlphaNumeric(obj interface{}, key string) *Result {
method Match (line 197) | func (v *Validation) Match(obj interface{}, regex *regexp.Regexp, key ...
method NoMatch (line 202) | func (v *Validation) NoMatch(obj interface{}, regex *regexp.Regexp, ke...
method AlphaDash (line 207) | func (v *Validation) AlphaDash(obj interface{}, key string) *Result {
method Email (line 212) | func (v *Validation) Email(obj interface{}, key string) *Result {
method IP (line 217) | func (v *Validation) IP(obj interface{}, key string) *Result {
method Base64 (line 222) | func (v *Validation) Base64(obj interface{}, key string) *Result {
method Mobile (line 227) | func (v *Validation) Mobile(obj interface{}, key string) *Result {
method Tel (line 232) | func (v *Validation) Tel(obj interface{}, key string) *Result {
method Phone (line 237) | func (v *Validation) Phone(obj interface{}, key string) *Result {
method ZipCode (line 243) | func (v *Validation) ZipCode(obj interface{}, key string) *Result {
method apply (line 247) | func (v *Validation) apply(chk Validator, obj interface{}) *Result {
method AddError (line 282) | func (v *Validation) AddError(key, message string) {
method setError (line 301) | func (v *Validation) setError(err *Error) {
method SetError (line 313) | func (v *Validation) SetError(fieldName string, errMsg string) *Error {
method Check (line 322) | func (v *Validation) Check(obj interface{}, checks ...Validator) *Resu...
method Valid (line 335) | func (v *Validation) Valid(obj interface{}) (b bool, err error) {
method RecursiveValid (line 386) | func (v *Validation) RecursiveValid(objc interface{}) (bool, error) {
FILE: vendor/github.com/astaxie/beego/validation/validators.go
function SetDefaultMessage (line 82) | func SetDefaultMessage(msg map[string]string) {
type Validator (line 93) | type Validator interface
type Required (line 101) | type Required struct
method IsSatisfied (line 106) | func (r Required) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 158) | func (r Required) DefaultMessage() string {
method GetKey (line 163) | func (r Required) GetKey() string {
method GetLimitValue (line 168) | func (r Required) GetLimitValue() interface{} {
type Min (line 173) | type Min struct
method IsSatisfied (line 180) | func (m Min) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 204) | func (m Min) DefaultMessage() string {
method GetKey (line 209) | func (m Min) GetKey() string {
method GetLimitValue (line 214) | func (m Min) GetLimitValue() interface{} {
type Max (line 219) | type Max struct
method IsSatisfied (line 226) | func (m Max) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 250) | func (m Max) DefaultMessage() string {
method GetKey (line 255) | func (m Max) GetKey() string {
method GetLimitValue (line 260) | func (m Max) GetLimitValue() interface{} {
type Range (line 265) | type Range struct
method IsSatisfied (line 273) | func (r Range) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 278) | func (r Range) DefaultMessage() string {
method GetKey (line 283) | func (r Range) GetKey() string {
method GetLimitValue (line 288) | func (r Range) GetLimitValue() interface{} {
type MinSize (line 293) | type MinSize struct
method IsSatisfied (line 299) | func (m MinSize) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 311) | func (m MinSize) DefaultMessage() string {
method GetKey (line 316) | func (m MinSize) GetKey() string {
method GetLimitValue (line 321) | func (m MinSize) GetLimitValue() interface{} {
type MaxSize (line 326) | type MaxSize struct
method IsSatisfied (line 332) | func (m MaxSize) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 344) | func (m MaxSize) DefaultMessage() string {
method GetKey (line 349) | func (m MaxSize) GetKey() string {
method GetLimitValue (line 354) | func (m MaxSize) GetLimitValue() interface{} {
type Length (line 359) | type Length struct
method IsSatisfied (line 365) | func (l Length) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 377) | func (l Length) DefaultMessage() string {
method GetKey (line 382) | func (l Length) GetKey() string {
method GetLimitValue (line 387) | func (l Length) GetLimitValue() interface{} {
type Alpha (line 392) | type Alpha struct
method IsSatisfied (line 397) | func (a Alpha) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 410) | func (a Alpha) DefaultMessage() string {
method GetKey (line 415) | func (a Alpha) GetKey() string {
method GetLimitValue (line 420) | func (a Alpha) GetLimitValue() interface{} {
type Numeric (line 425) | type Numeric struct
method IsSatisfied (line 430) | func (n Numeric) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 443) | func (n Numeric) DefaultMessage() string {
method GetKey (line 448) | func (n Numeric) GetKey() string {
method GetLimitValue (line 453) | func (n Numeric) GetLimitValue() interface{} {
type AlphaNumeric (line 458) | type AlphaNumeric struct
method IsSatisfied (line 463) | func (a AlphaNumeric) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 476) | func (a AlphaNumeric) DefaultMessage() string {
method GetKey (line 481) | func (a AlphaNumeric) GetKey() string {
method GetLimitValue (line 486) | func (a AlphaNumeric) GetLimitValue() interface{} {
type Match (line 491) | type Match struct
method IsSatisfied (line 497) | func (m Match) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 502) | func (m Match) DefaultMessage() string {
method GetKey (line 507) | func (m Match) GetKey() string {
method GetLimitValue (line 512) | func (m Match) GetLimitValue() interface{} {
type NoMatch (line 517) | type NoMatch struct
method IsSatisfied (line 523) | func (n NoMatch) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 528) | func (n NoMatch) DefaultMessage() string {
method GetKey (line 533) | func (n NoMatch) GetKey() string {
method GetLimitValue (line 538) | func (n NoMatch) GetLimitValue() interface{} {
type AlphaDash (line 545) | type AlphaDash struct
method DefaultMessage (line 551) | func (a AlphaDash) DefaultMessage() string {
method GetKey (line 556) | func (a AlphaDash) GetKey() string {
method GetLimitValue (line 561) | func (a AlphaDash) GetLimitValue() interface{} {
type Email (line 568) | type Email struct
method DefaultMessage (line 574) | func (e Email) DefaultMessage() string {
method GetKey (line 579) | func (e Email) GetKey() string {
method GetLimitValue (line 584) | func (e Email) GetLimitValue() interface{} {
type IP (line 591) | type IP struct
method DefaultMessage (line 597) | func (i IP) DefaultMessage() string {
method GetKey (line 602) | func (i IP) GetKey() string {
method GetLimitValue (line 607) | func (i IP) GetLimitValue() interface{} {
type Base64 (line 614) | type Base64 struct
method DefaultMessage (line 620) | func (b Base64) DefaultMessage() string {
method GetKey (line 625) | func (b Base64) GetKey() string {
method GetLimitValue (line 630) | func (b Base64) GetLimitValue() interface{} {
type Mobile (line 638) | type Mobile struct
method DefaultMessage (line 644) | func (m Mobile) DefaultMessage() string {
method GetKey (line 649) | func (m Mobile) GetKey() string {
method GetLimitValue (line 654) | func (m Mobile) GetLimitValue() interface{} {
type Tel (line 662) | type Tel struct
method DefaultMessage (line 668) | func (t Tel) DefaultMessage() string {
method GetKey (line 673) | func (t Tel) GetKey() string {
method GetLimitValue (line 678) | func (t Tel) GetLimitValue() interface{} {
type Phone (line 683) | type Phone struct
method IsSatisfied (line 690) | func (p Phone) IsSatisfied(obj interface{}) bool {
method DefaultMessage (line 695) | func (p Phone) DefaultMessage() string {
method GetKey (line 700) | func (p Phone) GetKey() string {
method GetLimitValue (line 705) | func (p Phone) GetLimitValue() interface{} {
type ZipCode (line 713) | type ZipCode struct
method DefaultMessage (line 719) | func (z ZipCode) DefaultMessage() string {
method GetKey (line 724) | func (z ZipCode) GetKey() string {
method GetLimitValue (line 729) | func (z ZipCode) GetLimitValue() interface{} {
FILE: vendor/github.com/boombuler/barcode/barcode.go
constant TypeAztec (line 6) | TypeAztec = "Aztec"
constant TypeCodabar (line 7) | TypeCodabar = "Codabar"
constant TypeCode128 (line 8) | TypeCode128 = "Code 128"
constant TypeCode39 (line 9) | TypeCode39 = "Code 39"
constant TypeCode93 (line 10) | TypeCode93 = "Code 93"
constant TypeDataMatrix (line 11) | TypeDataMatrix = "DataMatrix"
constant TypeEAN8 (line 12) | TypeEAN8 = "EAN 8"
constant TypeEAN13 (line 13) | TypeEAN13 = "EAN 13"
constant TypePDF (line 14) | TypePDF = "PDF417"
constant TypeQR (line 15) | TypeQR = "QR Code"
constant Type2of5 (line 16) | Type2of5 = "2 of 5"
constant Type2of5Interleaved (line 17) | Type2of5Interleaved = "2 of 5 (interleaved)"
type Metadata (line 21) | type Metadata struct
type Barcode (line 29) | type Barcode interface
type BarcodeIntCS (line 39) | type BarcodeIntCS interface
FILE: vendor/github.com/boombuler/barcode/qr/alphanumeric.go
constant charSet (line 11) | charSet string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"
function stringToAlphaIdx (line 13) | func stringToAlphaIdx(content string) <-chan int {
function encodeAlphaNumeric (line 29) | func encodeAlphaNumeric(content string, ecl ErrorCorrectionLevel) (*util...
FILE: vendor/github.com/boombuler/barcode/qr/automatic.go
function encodeAuto (line 9) | func encodeAuto(content string, ecl ErrorCorrectionLevel) (*utils.BitLis...
FILE: vendor/github.com/boombuler/barcode/qr/blocks.go
type block (line 3) | type block struct
type blockList (line 7) | type blockList
method interleave (line 35) | func (bl blockList) interleave(vi *versionInfo) []byte {
function splitToBlocks (line 9) | func splitToBlocks(data <-chan byte, vi *versionInfo) blockList {
FILE: vendor/github.com/boombuler/barcode/qr/encoder.go
type encodeFn (line 11) | type encodeFn
type Encoding (line 14) | type Encoding
method getEncoder (line 29) | func (e Encoding) getEncoder() encodeFn {
method String (line 43) | func (e Encoding) String() string {
constant Auto (line 18) | Auto Encoding = iota
constant Numeric (line 20) | Numeric
constant AlphaNumeric (line 22) | AlphaNumeric
constant Unicode (line 24) | Unicode
constant unknownEncoding (line 26) | unknownEncoding
function Encode (line 58) | func Encode(content string, level ErrorCorrectionLevel, mode Encoding) (...
function render (line 71) | func render(data []byte, vi *versionInfo) *qrcode {
function setMasked (line 138) | func setMasked(x, y int, val bool, mask int, set func(int, int, bool)) {
function iterateModules (line 167) | func iterateModules(occupied *qrcode) <-chan image.Point {
function drawFinderPatterns (line 222) | func drawFinderPatterns(vi *versionInfo, set func(int, int, bool)) {
function drawAlignmentPatterns (line 240) | func drawAlignmentPatterns(occupied *qrcode, vi *versionInfo, set func(i...
function drawFormatInfo (line 304) | func drawFormatInfo(vi *versionInfo, usedMask int, set func(int, int, bo...
function drawVersionInfo (line 386) | func drawVersionInfo(vi *versionInfo, set func(int, int, bool)) {
function addPaddingAndTerminator (line 400) | func addPaddingAndTerminator(bl *utils.BitList, vi *versionInfo) {
FILE: vendor/github.com/boombuler/barcode/qr/errorcorrection.go
type errorCorrection (line 7) | type errorCorrection struct
method calcECC (line 18) | func (ec *errorCorrection) calcECC(data []byte, eccCount byte) []byte {
function newErrorCorrection (line 13) | func newErrorCorrection() *errorCorrection {
FILE: vendor/github.com/boombuler/barcode/qr/numeric.go
function encodeNumeric (line 11) | func encodeNumeric(content string, ecl ErrorCorrectionLevel) (*utils.Bit...
FILE: vendor/github.com/boombuler/barcode/qr/qrcode.go
type qrcode (line 12) | type qrcode struct
method Content (line 18) | func (qr *qrcode) Content() string {
method Metadata (line 22) | func (qr *qrcode) Metadata() barcode.Metadata {
method ColorModel (line 26) | func (qr *qrcode) ColorModel() color.Model {
method Bounds (line 30) | func (qr *qrcode) Bounds() image.Rectangle {
method At (line 34) | func (qr *qrcode) At(x, y int) color.Color {
method Get (line 41) | func (qr *qrcode) Get(x, y int) bool {
method Set (line 45) | func (qr *qrcode) Set(x, y int, val bool) {
method calcPenalty (line 49) | func (qr *qrcode) calcPenalty() uint {
method calcPenaltyRule1 (line 53) | func (qr *qrcode) calcPenaltyRule1() uint {
method calcPenaltyRule2 (line 94) | func (qr *qrcode) calcPenaltyRule2() uint {
method calcPenaltyRule3 (line 107) | func (qr *qrcode) calcPenaltyRule3() uint {
method calcPenaltyRule4 (line 147) | func (qr *qrcode) calcPenaltyRule4() uint {
function newBarcode (line 161) | func newBarcode(dim int) *qrcode {
FILE: vendor/github.com/boombuler/barcode/qr/unicode.go
function encodeUnicode (line 9) | func encodeUnicode(content string, ecl ErrorCorrectionLevel) (*utils.Bit...
FILE: vendor/github.com/boombuler/barcode/qr/versioninfo.go
type ErrorCorrectionLevel (line 6) | type ErrorCorrectionLevel
method String (line 19) | func (ecl ErrorCorrectionLevel) String() string {
constant L (line 10) | L ErrorCorrectionLevel = iota
constant M (line 12) | M
constant Q (line 14) | Q
constant H (line 16) | H
type encodingMode (line 33) | type encodingMode
constant numericMode (line 36) | numericMode encodingMode = 1
constant alphaNumericMode (line 37) | alphaNumericMode encodingMode = 2
constant byteMode (line 38) | byteMode encodingMode = 4
constant kanjiMode (line 39) | kanjiMode encodingMode = 8
type versionInfo (line 42) | type versionInfo struct
method totalDataBytes (line 215) | func (vi *versionInfo) totalDataBytes() int {
method charCountBits (line 221) | func (vi *versionInfo) charCountBits(m encodingMode) byte {
method modulWidth (line 257) | func (vi *versionInfo) modulWidth() int {
method alignmentPatternPlacements (line 261) | func (vi *versionInfo) alignmentPatternPlacements() []int {
function findSmallestVersionInfo (line 300) | func findSmallestVersionInfo(ecl ErrorCorrectionLevel, mode encodingMode...
FILE: vendor/github.com/boombuler/barcode/scaledbarcode.go
type wrapFunc (line 11) | type wrapFunc
type scaledBarcode (line 13) | type scaledBarcode struct
method Content (line 23) | func (bc *scaledBarcode) Content() string {
method Metadata (line 27) | func (bc *scaledBarcode) Metadata() Metadata {
method ColorModel (line 31) | func (bc *scaledBarcode) ColorModel() color.Model {
method Bounds (line 35) | func (bc *scaledBarcode) Bounds() image.Rectangle {
method At (line 39) | func (bc *scaledBarcode) At(x, y int) color.Color {
type intCSscaledBC (line 19) | type intCSscaledBC struct
method CheckSum (line 43) | func (bc *intCSscaledBC) CheckSum() int {
function Scale (line 51) | func Scale(bc Barcode, width, height int) (Barcode, error) {
function newScaledBC (line 62) | func newScaledBC(wrapped Barcode, wrapperFunc wrapFunc, rect image.Recta...
function scale2DCode (line 75) | func scale2DCode(bc Barcode, width, height int) (Barcode, error) {
function scale1DCode (line 107) | func scale1DCode(bc Barcode, width, height int) (Barcode, error) {
FILE: vendor/github.com/boombuler/barcode/utils/base1dcode.go
type base1DCode (line 11) | type base1DCode struct
method Content (line 22) | func (c *base1DCode) Content() string {
method Metadata (line 26) | func (c *base1DCode) Metadata() barcode.Metadata {
method ColorModel (line 30) | func (c *base1DCode) ColorModel() color.Model {
method Bounds (line 34) | func (c *base1DCode) Bounds() image.Rectangle {
method At (line 38) | func (c *base1DCode) At(x, y int) color.Color {
type base1DCodeIntCS (line 17) | type base1DCodeIntCS struct
method CheckSum (line 45) | func (c *base1DCodeIntCS) CheckSum() int {
function New1DCodeIntCheckSum (line 50) | func New1DCodeIntCheckSum(codeKind, content string, bars *BitList, check...
function New1DCode (line 55) | func New1DCode(codeKind, content string, bars *BitList) barcode.Barcode {
FILE: vendor/github.com/boombuler/barcode/utils/bitlist.go
type BitList (line 4) | type BitList struct
method Len (line 23) | func (bl *BitList) Len() int {
method grow (line 27) | func (bl *BitList) grow() {
method AddBit (line 41) | func (bl *BitList) AddBit(bits ...bool) {
method SetBit (line 53) | func (bl *BitList) SetBit(index int, value bool) {
method GetBit (line 64) | func (bl *BitList) GetBit(index int) bool {
method AddByte (line 71) | func (bl *BitList) AddByte(b byte) {
method AddBits (line 78) | func (bl *BitList) AddBits(b int, count byte) {
method GetBytes (line 85) | func (bl *BitList) GetBytes() []byte {
method IterateBytes (line 99) | func (bl *BitList) IterateBytes() <-chan byte {
function NewBitList (line 11) | func NewBitList(capacity int) *BitList {
FILE: vendor/github.com/boombuler/barcode/utils/galoisfield.go
type GaloisField (line 4) | type GaloisField struct
method Zero (line 36) | func (gf *GaloisField) Zero() *GFPoly {
method AddOrSub (line 41) | func (gf *GaloisField) AddOrSub(a, b int) int {
method Multiply (line 46) | func (gf *GaloisField) Multiply(a, b int) int {
method Divide (line 54) | func (gf *GaloisField) Divide(a, b int) int {
method Invers (line 63) | func (gf *GaloisField) Invers(num int) int {
function NewGaloisField (line 12) | func NewGaloisField(pp, fieldSize, b int) *GaloisField {
FILE: vendor/github.com/boombuler/barcode/utils/gfpoly.go
type GFPoly (line 3) | type GFPoly struct
method Degree (line 8) | func (gp *GFPoly) Degree() int {
method Zero (line 12) | func (gp *GFPoly) Zero() bool {
method GetCoefficient (line 17) | func (gp *GFPoly) GetCoefficient(degree int) int {
method AddOrSubstract (line 21) | func (gp *GFPoly) AddOrSubstract(other *GFPoly) *GFPoly {
method MultByMonominal (line 41) | func (gp *GFPoly) MultByMonominal(degree int, coeff int) *GFPoly {
method Multiply (line 53) | func (gp *GFPoly) Multiply(other *GFPoly) *GFPoly {
method Divide (line 72) | func (gp *GFPoly) Divide(other *GFPoly) (quotient *GFPoly, remainder *...
function NewMonominalPoly (line 89) | func NewMonominalPoly(field *GaloisField, degree int, coeff int) *GFPoly {
function NewGFPoly (line 98) | func NewGFPoly(field *GaloisField, coefficients []int) *GFPoly {
FILE: vendor/github.com/boombuler/barcode/utils/reedsolomon.go
type ReedSolomonEncoder (line 7) | type ReedSolomonEncoder struct
method getPolynomial (line 19) | func (rs *ReedSolomonEncoder) getPolynomial(degree int) *GFPoly {
method Encode (line 34) | func (rs *ReedSolomonEncoder) Encode(data []int, eccCount int) []int {
function NewReedSolomonEncoder (line 13) | func NewReedSolomonEncoder(gf *GaloisField) *ReedSolomonEncoder {
FILE: vendor/github.com/boombuler/barcode/utils/runeint.go
function RuneToInt (line 5) | func RuneToInt(r rune) int {
function IntToRune (line 14) | func IntToRune(i int) rune {
FILE: vendor/github.com/dgrijalva/jwt-go/claims.go
type Claims (line 11) | type Claims interface
type StandardClaims (line 18) | type StandardClaims struct
method Valid (line 32) | func (c StandardClaims) Valid() error {
method VerifyAudience (line 63) | func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
method VerifyExpiresAt (line 69) | func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
method VerifyIssuedAt (line 75) | func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
method VerifyIssuer (line 81) | func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
method VerifyNotBefore (line 87) | func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
function verifyAud (line 93) | func verifyAud(aud string, cmp string, required bool) bool {
function verifyExp (line 104) | func verifyExp(exp int64, now int64, required bool) bool {
function verifyIat (line 111) | func verifyIat(iat int64, now int64, required bool) bool {
function verifyIss (line 118) | func verifyIss(iss string, cmp string, required bool) bool {
function verifyNbf (line 129) | func verifyNbf(nbf int64, now int64, required bool) bool {
FILE: vendor/github.com/dgrijalva/jwt-go/ecdsa.go
type SigningMethodECDSA (line 17) | type SigningMethodECDSA struct
method Alg (line 51) | func (m *SigningMethodECDSA) Alg() string {
method Verify (line 57) | func (m *SigningMethodECDSA) Verify(signingString, signature string, k...
method Sign (line 99) | func (m *SigningMethodECDSA) Sign(signingString string, key interface{...
function init (line 31) | func init() {
FILE: vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go
function ParseECPrivateKeyFromPEM (line 16) | func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) {
function ParseECPublicKeyFromPEM (line 41) | func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) {
FILE: vendor/github.com/dgrijalva/jwt-go/errors.go
constant ValidationErrorMalformed (line 16) | ValidationErrorMalformed uint32 = 1 << iota
constant ValidationErrorUnverifiable (line 17) | ValidationErrorUnverifiable
constant ValidationErrorSignatureInvalid (line 18) | ValidationErrorSignatureInvalid
constant ValidationErrorAudience (line 21) | ValidationErrorAudience
constant ValidationErrorExpired (line 22) | ValidationErrorExpired
constant ValidationErrorIssuedAt (line 23) | ValidationErrorIssuedAt
constant ValidationErrorIssuer (line 24) | ValidationErrorIssuer
constant ValidationErrorNotValidYet (line 25) | ValidationErrorNotValidYet
constant ValidationErrorId (line 26) | ValidationErrorId
constant ValidationErrorClaimsInvalid (line 27) | ValidationErrorClaimsInvalid
function NewValidationError (line 31) | func NewValidationError(errorText string, errorFlags uint32) *Validation...
type ValidationError (line 39) | type ValidationError struct
method Error (line 46) | func (e ValidationError) Error() string {
method valid (line 57) | func (e *ValidationError) valid() bool {
FILE: vendor/github.com/dgrijalva/jwt-go/hmac.go
type SigningMethodHMAC (line 10) | type SigningMethodHMAC struct
method Alg (line 43) | func (m *SigningMethodHMAC) Alg() string {
method Verify (line 48) | func (m *SigningMethodHMAC) Verify(signingString, signature string, ke...
method Sign (line 81) | func (m *SigningMethodHMAC) Sign(signingString string, key interface{}...
function init (line 23) | func init() {
FILE: vendor/github.com/dgrijalva/jwt-go/map_claims.go
type MapClaims (line 11) | type MapClaims
method VerifyAudience (line 15) | func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
method VerifyExpiresAt (line 22) | func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
method VerifyIssuedAt (line 35) | func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
method VerifyIssuer (line 48) | func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
method VerifyNotBefore (line 55) | func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
method Valid (line 70) | func (m MapClaims) Valid() error {
FILE: vendor/github.com/dgrijalva/jwt-go/none.go
constant UnsafeAllowNoneSignatureType (line 7) | UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing met...
type signingMethodNone (line 11) | type signingMethodNone struct
method Alg (line 23) | func (m *signingMethodNone) Alg() string {
method Verify (line 28) | func (m *signingMethodNone) Verify(signingString, signature string, ke...
method Sign (line 47) | func (m *signingMethodNone) Sign(signingString string, key interface{}...
type unsafeNoneMagicConstant (line 12) | type unsafeNoneMagicConstant
function init (line 14) | func init() {
FILE: vendor/github.com/dgrijalva/jwt-go/parser.go
type Parser (line 10) | type Parser struct
method Parse (line 19) | func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, e...
method ParseWithClaims (line 23) | func (p *Parser) ParseWithClaims(tokenString string, claims Claims, ke...
FILE: vendor/github.com/dgrijalva/jwt-go/rsa.go
type SigningMethodRSA (line 10) | type SigningMethodRSA struct
method Alg (line 42) | func (m *SigningMethodRSA) Alg() string {
method Verify (line 48) | func (m *SigningMethodRSA) Verify(signingString, signature string, key...
method Sign (line 77) | func (m *SigningMethodRSA) Sign(signingString string, key interface{})...
function init (line 22) | func init() {
FILE: vendor/github.com/dgrijalva/jwt-go/rsa_pss.go
type SigningMethodRSAPSS (line 12) | type SigningMethodRSAPSS struct
method Verify (line 73) | func (m *SigningMethodRSAPSS) Verify(signingString, signature string, ...
method Sign (line 102) | func (m *SigningMethodRSAPSS) Sign(signingString string, key interface...
function init (line 24) | func init() {
FILE: vendor/github.com/dgrijalva/jwt-go/rsa_utils.go
function ParseRSAPrivateKeyFromPEM (line 17) | func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) {
function ParseRSAPublicKeyFromPEM (line 43) | func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) {
FILE: vendor/github.com/dgrijalva/jwt-go/signing_method.go
type SigningMethod (line 11) | type SigningMethod interface
function RegisterSigningMethod (line 19) | func RegisterSigningMethod(alg string, f func() SigningMethod) {
function GetSigningMethod (line 27) | func GetSigningMethod(alg string) (method SigningMethod) {
FILE: vendor/github.com/dgrijalva/jwt-go/token.go
type Keyfunc (line 19) | type Keyfunc
type Token (line 23) | type Token struct
method SignedString (line 49) | func (t *Token) SignedString(key interface{}) (string, error) {
method SigningString (line 65) | func (t *Token) SigningString() (string, error) {
function New (line 33) | func New(method SigningMethod) *Token {
function NewWithClaims (line 37) | func NewWithClaims(method SigningMethod, claims Claims) *Token {
function Parse (line 88) | func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
function ParseWithClaims (line 92) | func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc)...
function EncodeSegment (line 97) | func EncodeSegment(seg []byte) string {
function DecodeSegment (line 102) | func DecodeSegment(seg string) ([]byte, error) {
FILE: vendor/github.com/gin-contrib/sse/sse-decoder.go
type decoder (line 13) | type decoder struct
method dispatchEvent (line 22) | func (d *decoder) dispatchEvent(event Event, data string) {
method decode (line 39) | func (d *decoder) decode(r io.Reader) ([]Event, error) {
function Decode (line 17) | func Decode(r io.Reader) ([]Event, error) {
FILE: vendor/github.com/gin-contrib/sse/sse-encoder.go
constant ContentType (line 21) | ContentType = "text/event-stream"
type Event (line 34) | type Event struct
method Render (line 89) | func (r Event) Render(w http.ResponseWriter) error {
method WriteContentType (line 94) | func (r Event) WriteContentType(w http.ResponseWriter) {
function Encode (line 41) | func Encode(writer io.Writer, event Event) error {
function writeId (line 49) | func writeId(w stringWriter, id string) {
function writeEvent (line 57) | func writeEvent(w stringWriter, event string) {
function writeRetry (line 65) | func writeRetry(w stringWriter, retry uint) {
function writeData (line 73) | func writeData(w stringWriter, data interface{}) error {
function kindOfData (line 103) | func kindOfData(data interface{}) reflect.Kind {
FILE: vendor/github.com/gin-contrib/sse/writer.go
type stringWriter (line 5) | type stringWriter interface
type stringWrapper (line 10) | type stringWrapper struct
method WriteString (line 14) | func (w stringWrapper) WriteString(str string) (int, error) {
function checkWriter (line 18) | func checkWriter(writer io.Writer) stringWriter {
FILE: vendor/github.com/gin-gonic/gin/auth.go
constant AuthUserKey (line 15) | AuthUserKey = "user"
type Accounts (line 18) | type Accounts
type authPair (line 20) | type authPair struct
type authPairs (line 25) | type authPairs
method searchCredential (line 27) | func (a authPairs) searchCredential(authValue string) (string, bool) {
function BasicAuthForRealm (line 43) | func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc {
function BasicAuth (line 67) | func BasicAuth(accounts Accounts) HandlerFunc {
function processAccounts (line 71) | func processAccounts(accounts Accounts) authPairs {
function authorizationHeader (line 85) | func authorizationHeader(user, password string) string {
function secureCompare (line 90) | func secureCompare(given, actual string) bool {
FILE: vendor/github.com/gin-gonic/gin/binding/binding.go
constant MIMEJSON (line 11) | MIMEJSON = "application/json"
constant MIMEHTML (line 12) | MIMEHTML = "text/html"
constant MIMEXML (line 13) | MIMEXML = "application/xml"
constant MIMEXML2 (line 14) | MIMEXML2 = "text/xml"
constant MIMEPlain (line 15) | MIMEPlain = "text/plain"
constant MIMEPOSTForm (line 16) | MIMEPOSTForm = "application/x-www-form-urlencoded"
constant MIMEMultipartPOSTForm (line 17) | MIMEMultipartPOSTForm = "multipart/form-data"
constant MIMEPROTOBUF (line 18) | MIMEPROTOBUF = "application/x-protobuf"
constant MIMEMSGPACK (line 19) | MIMEMSGPACK = "application/x-msgpack"
constant MIMEMSGPACK2 (line 20) | MIMEMSGPACK2 = "application/msgpack"
constant MIMEYAML (line 21) | MIMEYAML = "application/x-yaml"
type Binding (line 27) | type Binding interface
type BindingBody (line 34) | type BindingBody interface
type BindingUri (line 41) | type BindingUri interface
type StructValidator (line 50) | type StructValidator interface
function Default (line 85) | func Default(method, contentType string) Binding {
function validate (line 108) | func validate(obj interface{}) error {
FILE: vendor/github.com/gin-gonic/gin/binding/default_validator.go
type defaultValidator (line 14) | type defaultValidator struct
method ValidateStruct (line 22) | func (v *defaultValidator) ValidateStruct(obj interface{}) error {
method Engine (line 41) | func (v *defaultValidator) Engine() interface{} {
method lazyinit (line 46) | func (v *defaultValidator) lazyinit() {
FILE: vendor/github.com/gin-gonic/gin/binding/form.go
constant defaultMemory (line 13) | defaultMemory = 32 * 1024 * 1024
type formBinding (line 15) | type formBinding struct
method Name (line 19) | func (formBinding) Name() string {
method Bind (line 23) | func (formBinding) Bind(req *http.Request, obj interface{}) error {
type formPostBinding (line 16) | type formPostBinding struct
method Name (line 38) | func (formPostBinding) Name() string {
method Bind (line 42) | func (formPostBinding) Bind(req *http.Request, obj interface{}) error {
type formMultipartBinding (line 17) | type formMultipartBinding struct
method Name (line 52) | func (formMultipartBinding) Name() string {
method Bind (line 56) | func (formMultipartBinding) Bind(req *http.Request, obj interface{}) e...
type multipartRequest (line 67) | type multipartRequest
method TrySet (line 76) | func (r *multipartRequest) TrySet(value reflect.Value, field reflect.S...
FILE: vendor/github.com/gin-gonic/gin/binding/form_mapping.go
function mapUri (line 20) | func mapUri(ptr interface{}, m map[string][]string) error {
function mapForm (line 24) | func mapForm(ptr interface{}, form map[string][]string) error {
function mapFormByTag (line 30) | func mapFormByTag(ptr interface{}, form map[string][]string, tag string)...
type setter (line 35) | type setter interface
type formSource (line 39) | type formSource
method TrySet (line 44) | func (form formSource) TrySet(value reflect.Value, field reflect.Struc...
function mappingByPtr (line 48) | func mappingByPtr(ptr interface{}, setter setter, tag string) error {
function mapping (line 53) | func mapping(value reflect.Value, field reflect.StructField, setter sett...
type setOptions (line 100) | type setOptions struct
function tryToSetValue (line 105) | func tryToSetValue(value reflect.Value, field reflect.StructField, sette...
function setByForm (line 137) | func setByForm(value reflect.Value, field reflect.StructField, form map[...
function setWithProperType (line 170) | func setWithProperType(val string, value reflect.Value, field reflect.St...
function setIntField (line 218) | func setIntField(val string, bitSize int, field reflect.Value) error {
function setUintField (line 229) | func setUintField(val string, bitSize int, field reflect.Value) error {
function setBoolField (line 240) | func setBoolField(val string, field reflect.Value) error {
function setFloatField (line 251) | func setFloatField(val string, bitSize int, field reflect.Value) error {
function setTimeField (line 262) | func setTimeField(val string, structField reflect.StructField, value ref...
function setArray (line 295) | func setArray(vals []string, value reflect.Value, field reflect.StructFi...
function setSlice (line 305) | func setSlice(vals []string, value reflect.Value, field reflect.StructFi...
function setTimeDuration (line 315) | func setTimeDuration(val string, value reflect.Value, field reflect.Stru...
function head (line 324) | func head(str, sep string) (head string, tail string) {
FILE: vendor/github.com/gin-gonic/gin/binding/json.go
type jsonBinding (line 21) | type jsonBinding struct
method Name (line 23) | func (jsonBinding) Name() string {
method Bind (line 27) | func (jsonBinding) Bind(req *http.Request, obj interface{}) error {
method BindBody (line 34) | func (jsonBinding) BindBody(body []byte, obj interface{}) error {
function decodeJSON (line 38) | func decodeJSON(r io.Reader, obj interface{}) error {
FILE: vendor/github.com/gin-gonic/gin/binding/msgpack.go
type msgpackBinding (line 15) | type msgpackBinding struct
method Name (line 17) | func (msgpackBinding) Name() string {
method Bind (line 21) | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error {
method BindBody (line 25) | func (msgpackBinding) BindBody(body []byte, obj interface{}) error {
function decodeMsgPack (line 29) | func decodeMsgPack(r io.Reader, obj interface{}) error {
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/gin/context.go
constant MIMEJSON (line 28) | MIMEJSON = binding.MIMEJSON
constant MIMEHTML (line 29) | MIMEHTML = binding.MIMEHTML
constant MIMEXML (line 30) | MIMEXML = binding.MIMEXML
constant MIMEXML2 (line 31) | MIMEXML2 = binding.MIMEXML2
constant MIMEPlain (line 32) | MIMEPlain = binding.MIMEPlain
constant MIMEPOSTForm (line 33) | MIMEPOSTForm = binding.MIMEPOSTForm
constant MIMEMultipartPOSTForm (line 34) | MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm
constant MIMEYAML (line 35) | MIMEYAML = binding.MIMEYAML
constant BodyBytesKey (line 36) | BodyBytesKey = "_gin-gonic/gin/bodybyteskey"
constant abortIndex (line 39) | abortIndex int8 = math.MaxInt8 / 2
type Context (line 43) | type Context struct
method reset (line 68) | func (c *Context) reset() {
method Copy (line 80) | func (c *Context) Copy() *Context {
method HandlerName (line 95) | func (c *Context) HandlerName() string {
method HandlerNames (line 101) | func (c *Context) HandlerNames() []string {
method Handler (line 110) | func (c *Context) Handler() HandlerFunc {
method Next (line 121) | func (c *Context) Next() {
method IsAborted (line 130) | func (c *Context) IsAborted() bool {
method Abort (line 138) | func (c *Context) Abort() {
method AbortWithStatus (line 144) | func (c *Context) AbortWithStatus(code int) {
method AbortWithStatusJSON (line 153) | func (c *Context) AbortWithStatusJSON(code int, jsonObj interface{}) {
method AbortWithError (line 161) | func (c *Context) AbortWithError(code int, err error) *Error {
method Error (line 175) | func (c *Context) Error(err error) *Error {
method Set (line 198) | func (c *Context) Set(key string, value interface{}) {
method Get (line 207) | func (c *Context) Get(key string) (value interface{}, exists bool) {
method MustGet (line 213) | func (c *Context) MustGet(key string) interface{} {
method GetString (line 221) | func (c *Context) GetString(key string) (s string) {
method GetBool (line 229) | func (c *Context) GetBool(key string) (b bool) {
method GetInt (line 237) | func (c *Context) GetInt(key string) (i int) {
method GetInt64 (line 245) | func (c *Context) GetInt64(key string) (i64 int64) {
method GetFloat64 (line 253) | func (c *Context) GetFloat64(key string) (f64 float64) {
method GetTime (line 261) | func (c *Context) GetTime(key string) (t time.Time) {
method GetDuration (line 269) | func (c *Context) GetDuration(key string) (d time.Duration) {
method GetStringSlice (line 277) | func (c *Context) GetStringSlice(key string) (ss []string) {
method GetStringMap (line 285) | func (c *Context) GetStringMap(key string) (sm map[string]interface{}) {
method GetStringMapString (line 293) | func (c *Context) GetStringMapString(key string) (sms map[string]strin...
method GetStringMapStringSlice (line 301) | func (c *Context) GetStringMapStringSlice(key string) (smss map[string...
method Param (line 318) | func (c *Context) Param(key string) string {
method Query (line 330) | func (c *Context) Query(key string) string {
method DefaultQuery (line 342) | func (c *Context) DefaultQuery(key, defaultValue string) string {
method GetQuery (line 357) | func (c *Context) GetQuery(key string) (string, bool) {
method QueryArray (line 366) | func (c *Context) QueryArray(key string) []string {
method GetQueryArray (line 373) | func (c *Context) GetQueryArray(key string) ([]string, bool) {
method QueryMap (line 381) | func (c *Context) QueryMap(key string) map[string]string {
method GetQueryMap (line 388) | func (c *Context) GetQueryMap(key string) (map[string]string, bool) {
method PostForm (line 394) | func (c *Context) PostForm(key string) string {
method DefaultPostForm (line 402) | func (c *Context) DefaultPostForm(key, defaultValue string) string {
method GetPostForm (line 416) | func (c *Context) GetPostForm(key string) (string, bool) {
method PostFormArray (line 425) | func (c *Context) PostFormArray(key string) []string {
method GetPostFormArray (line 432) | func (c *Context) GetPostFormArray(key string) ([]string, bool) {
method PostFormMap (line 446) | func (c *Context) PostFormMap(key string) map[string]string {
method GetPostFormMap (line 453) | func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
method get (line 464) | func (c *Context) get(m map[string][]string, key string) (map[string]s...
method FormFile (line 479) | func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
method MultipartForm (line 490) | func (c *Context) MultipartForm() (*multipart.Form, error) {
method SaveUploadedFile (line 496) | func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst str...
method Bind (line 521) | func (c *Context) Bind(obj interface{}) error {
method BindJSON (line 527) | func (c *Context) BindJSON(obj interface{}) error {
method BindXML (line 532) | func (c *Context) BindXML(obj interface{}) error {
method BindQuery (line 537) | func (c *Context) BindQuery(obj interface{}) error {
method BindYAML (line 542) | func (c *Context) BindYAML(obj interface{}) error {
method BindUri (line 548) | func (c *Context) BindUri(obj interface{}) error {
method MustBindWith (line 559) | func (c *Context) MustBindWith(obj interface{}, b binding.Binding) err...
method ShouldBind (line 575) | func (c *Context) ShouldBind(obj interface{}) error {
method ShouldBindJSON (line 581) | func (c *Context) ShouldBindJSON(obj interface{}) error {
method ShouldBindXML (line 586) | func (c *Context) ShouldBindXML(obj interface{}) error {
method ShouldBindQuery (line 591) | func (c *Context) ShouldBindQuery(obj interface{}) error {
method ShouldBindYAML (line 596) | func (c *Context) ShouldBindYAML(obj interface{}) error {
method ShouldBindUri (line 601) | func (c *Context) ShouldBindUri(obj interface{}) error {
method ShouldBindWith (line 611) | func (c *Context) ShouldBindWith(obj interface{}, b binding.Binding) e...
method ShouldBindBodyWith (line 620) | func (c *Context) ShouldBindBodyWith(obj interface{}, bb binding.Bindi...
method ClientIP (line 640) | func (c *Context) ClientIP() string {
method ContentType (line 666) | func (c *Context) ContentType() string {
method IsWebsocket (line 672) | func (c *Context) IsWebsocket() bool {
method requestHeader (line 680) | func (c *Context) requestHeader(key string) string {
method Status (line 702) | func (c *Context) Status(code int) {
method Header (line 709) | func (c *Context) Header(key, value string) {
method GetHeader (line 718) | func (c *Context) GetHeader(key string) string {
method GetRawData (line 723) | func (c *Context) GetRawData() ([]byte, error) {
method SetCookie (line 730) | func (c *Context) SetCookie(name, value string, maxAge int, path, doma...
method Cookie (line 749) | func (c *Context) Cookie(name string) (string, error) {
method Render (line 759) | func (c *Context) Render(code int, r render.Render) {
method HTML (line 776) | func (c *Context) HTML(code int, name string, obj interface{}) {
method IndentedJSON (line 785) | func (c *Context) IndentedJSON(code int, obj interface{}) {
method SecureJSON (line 792) | func (c *Context) SecureJSON(code int, obj interface{}) {
method JSONP (line 799) | func (c *Context) JSONP(code int, obj interface{}) {
method JSON (line 810) | func (c *Context) JSON(code int, obj interface{}) {
method AsciiJSON (line 816) | func (c *Context) AsciiJSON(code int, obj interface{}) {
method PureJSON (line 822) | func (c *Context) PureJSON(code int, obj interface{}) {
method XML (line 828) | func (c *Context) XML(code int, obj interface{}) {
method YAML (line 833) | func (c *Context) YAML(code int, obj interface{}) {
method ProtoBuf (line 838) | func (c *Context) ProtoBuf(code int, obj interface{}) {
method String (line 843) | func (c *Context) String(code int, format string, values ...interface{...
method Redirect (line 848) | func (c *Context) Redirect(code int, location string) {
method Data (line 857) | func (c *Context) Data(code int, contentType string, data []byte) {
method DataFromReader (line 865) | func (c *Context) DataFromReader(code int, contentLength int64, conten...
method File (line 875) | func (c *Context) File(filepath string) {
method FileAttachment (line 881) | func (c *Context) FileAttachment(filepath, filename string) {
method SSEvent (line 887) | func (c *Context) SSEvent(name string, message interface{}) {
method Stream (line 896) | func (c *Context) Stream(step func(w io.Writer) bool) bool {
method Negotiate (line 928) | func (c *Context) Negotiate(code int, config Negotiate) {
method NegotiateFormat (line 948) | func (c *Context) NegotiateFormat(offered ...string) string {
method SetAccepted (line 979) | func (c *Context) SetAccepted(formats ...string) {
method Deadline (line 990) | func (c *Context) Deadline() (deadline time.Time, ok bool) {
method Done (line 997) | func (c *Context) Done() <-chan struct{} {
method Err (line 1007) | func (c *Context) Err() error {
method Value (line 1014) | func (c *Context) Value(key interface{}) interface{} {
function bodyAllowedForStatus (line 689) | func bodyAllowedForStatus(status int) bool {
type Negotiate (line 918) | type Negotiate struct
FILE: vendor/github.com/gin-gonic/gin/context_appengine.go
function init (line 9) | func init() {
FILE: vendor/github.com/gin-gonic/gin/debug.go
constant ginSupportMinGoVer (line 17) | ginSupportMinGoVer = 8
function IsDebugging (line 21) | func IsDebugging() bool {
function debugPrintRoute (line 28) | func debugPrintRoute(httpMethod, absolutePath string, handlers HandlersC...
function debugPrintLoadTemplate (line 40) | func debugPrintLoadTemplate(tmpl *template.Template) {
function debugPrint (line 52) | func debugPrint(format string, values ...interface{}) {
function getMinVer (line 61) | func getMinVer(v string) (uint64, error) {
function debugPrintWARNINGDefault (line 70) | func debugPrintWARNINGDefault() {
function debugPrintWARNINGNew (line 81) | func debugPrintWARNINGNew() {
function debugPrintWARNINGSetHTMLTemplate (line 89) | func debugPrintWARNINGSetHTMLTemplate() {
function debugPrintError (line 99) | func debugPrintError(err error) {
FILE: vendor/github.com/gin-gonic/gin/deprecated.go
method BindWith (line 15) | func (c *Context) BindWith(obj interface{}, b binding.Binding) error {
FILE: vendor/github.com/gin-gonic/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 {
type errorMsgs (line 40) | type errorMsgs
method ByType (line 95) | func (a errorMsgs) ByType(typ ErrorType) errorMsgs {
method Last (line 113) | func (a errorMsgs) Last() *Error {
method Errors (line 126) | func (a errorMsgs) Errors() []string {
method JSON (line 137) | func (a errorMsgs) JSON() interface{} {
method MarshalJSON (line 153) | func (a errorMsgs) MarshalJSON() ([]byte, error) {
method String (line 157) | func (a errorMsgs) String() string {
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/gin/gin.go
constant defaultMultipartMemory (line 19) | defaultMultipartMemory = 32 << 20
type HandlerFunc (line 28) | type HandlerFunc
type HandlersChain (line 31) | type HandlersChain
method Last (line 34) | func (c HandlersChain) Last() HandlerFunc {
type RouteInfo (line 42) | type RouteInfo struct
type RoutesInfo (line 50) | type RoutesInfo
type Engine (line 54) | type Engine struct
method allocateContext (line 158) | func (engine *Engine) allocateContext() *Context {
method Delims (line 163) | func (engine *Engine) Delims(left, right string) *Engine {
method SecureJsonPrefix (line 169) | func (engine *Engine) SecureJsonPrefix(prefix string) *Engine {
method LoadHTMLGlob (line 176) | func (engine *Engine) LoadHTMLGlob(pattern string) {
method LoadHTMLFiles (line 192) | func (engine *Engine) LoadHTMLFiles(files ...string) {
method SetHTMLTemplate (line 203) | func (engine *Engine) SetHTMLTemplate(templ *template.Template) {
method SetFuncMap (line 212) | func (engine *Engine) SetFuncMap(funcMap template.FuncMap) {
method NoRoute (line 217) | func (engine *Engine) NoRoute(handlers ...HandlerFunc) {
method NoMethod (line 223) | func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
method Use (line 231) | func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes {
method rebuild404Handlers (line 238) | func (engine *Engine) rebuild404Handlers() {
method rebuild405Handlers (line 242) | func (engine *Engine) rebuild405Handlers() {
method addRoute (line 246) | func (engine *Engine) addRoute(method, path string, handlers HandlersC...
method Routes (line 262) | func (engine *Engine) Routes() (routes RoutesInfo) {
method Run (line 289) | func (engine *Engine) Run(addr ...string) (err error) {
method RunTLS (line 301) | func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err erro...
method RunUnix (line 312) | func (engine *Engine) RunUnix(file string) (err error) {
method RunFd (line 330) | func (engine *Engine) RunFd(fd int) (err error) {
method ServeHTTP (line 345) | func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Reque...
method HandleContext (line 359) | func (engine *Engine) HandleContext(c *Context) {
method handleHTTPRequest (line 367) | func (engine *Engine) handleHTTPRequest(c *Context) {
function New (line 122) | func New() *Engine {
function Default (line 151) | func Default() *Engine {
function iterate (line 269) | func iterate(path, method string, routes RoutesInfo, root *node) RoutesI...
function serveError (line 423) | func serveError(c *Context, code int, defaultMessage []byte) {
function redirectTrailingSlash (line 441) | func redirectTrailingSlash(c *Context) {
function redirectFixedPath (line 461) | func redirectFixedPath(c *Context, root *node, trailingSlash bool) bool {
FILE: vendor/github.com/gin-gonic/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
type LoggerConfig (line 38) | type LoggerConfig struct
type LogFormatter (line 52) | type LogFormatter
type LogFormatterParams (line 55) | type LogFormatterParams struct
method StatusCodeColor (line 81) | func (p *LogFormatterParams) StatusCodeColor() string {
method MethodColor (line 97) | func (p *LogFormatterParams) MethodColor() string {
method ResetColor (line 121) | func (p *LogFormatterParams) ResetColor() string {
method IsOutputColor (line 126) | func (p *LogFormatterParams) IsOutputColor() bool {
function DisableConsoleColor (line 155) | func DisableConsoleColor() {
function ForceConsoleColor (line 160) | func ForceConsoleColor() {
function ErrorLogger (line 165) | func ErrorLogger() HandlerFunc {
function ErrorLoggerT (line 170) | func ErrorLoggerT(typ ErrorType) HandlerFunc {
function Logger (line 182) | func Logger() HandlerFunc {
function LoggerWithFormatter (line 187) | func LoggerWithFormatter(f LogFormatter) HandlerFunc {
function LoggerWithWriter (line 195) | func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
function LoggerWithConfig (line 203) | func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
FILE: vendor/github.com/gin-gonic/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 26) | debugCode = iota
constant releaseCode (line 27) | releaseCode
constant testCode (line 28) | testCode
function init (line 46) | func init() {
function SetMode (line 52) | func SetMode(value string) {
function DisableBindValidation (line 70) | func DisableBindValidation() {
function EnableJsonDecoderUseNumber (line 76) | func EnableJsonDecoderUseNumber() {
function Mode (line 81) | func Mode() string {
FILE: vendor/github.com/gin-gonic/gin/path.go
function cleanPath (line 21) | func cleanPath(p string) string {
function bufApp (line 113) | func bufApp(buf *[]byte, s string, w int, c byte) {
FILE: vendor/github.com/gin-gonic/gin/recovery.go
function Recovery (line 30) | func Recovery() HandlerFunc {
function RecoveryWithWriter (line 35) | func RecoveryWithWriter(out io.Writer) HandlerFunc {
function stack (line 88) | func stack(skip int) []byte {
function source (line 115) | func source(lines [][]byte, n int) []byte {
function function (line 124) | func function(pc uintptr) []byte {
function timeFormat (line 148) | func timeFormat(t time.Time) string {
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/gin/render/json.go
type JSON (line 17) | type JSON struct
method Render (line 56) | func (r JSON) Render(w http.ResponseWriter) (err error) {
method WriteContentType (line 64) | func (r JSON) WriteContentType(w http.ResponseWriter) {
type IndentedJSON (line 22) | type IndentedJSON struct
method Render (line 80) | func (r IndentedJSON) Render(w http.ResponseWriter) error {
method WriteContentType (line 91) | func (r IndentedJSON) WriteContentType(w http.ResponseWriter) {
type SecureJSON (line 27) | type SecureJSON struct
method Render (line 96) | func (r SecureJSON) Render(w http.ResponseWriter) error {
method WriteContentType (line 114) | func (r SecureJSON) WriteContentType(w http.ResponseWriter) {
type JsonpJSON (line 33) | type JsonpJSON struct
method Render (line 119) | func (r JsonpJSON) Render(w http.ResponseWriter) (err error) {
method WriteContentType (line 153) | func (r JsonpJSON) WriteContentType(w http.ResponseWriter) {
type AsciiJSON (line 39) | type AsciiJSON struct
method Render (line 158) | func (r AsciiJSON) Render(w http.ResponseWriter) (err error) {
method WriteContentType (line 179) | func (r AsciiJSON) WriteContentType(w http.ResponseWriter) {
type SecureJSONPrefix (line 44) | type SecureJSONPrefix
type PureJSON (line 47) | type PureJSON struct
method Render (line 184) | func (r PureJSON) Render(w http.ResponseWriter) error {
method WriteContentType (line 192) | func (r PureJSON) WriteContentType(w http.ResponseWriter) {
function WriteJSON (line 69) | func WriteJSON(w http.ResponseWriter, obj interface{}) error {
FILE: vendor/github.com/gin-gonic/gin/render/msgpack.go
type MsgPack (line 14) | type MsgPack struct
method WriteContentType (line 21) | func (r MsgPack) WriteContentType(w http.ResponseWriter) {
method Render (line 26) | func (r MsgPack) Render(w http.ResponseWriter) error {
function WriteMsgPack (line 31) | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error {
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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 31) | func (r Reader) WriteContentType(w http.ResponseWriter) {
method writeHeaders (line 36) | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string...
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/gin/render/render.go
type Render (line 10) | type Render interface
function writeContentType (line 36) | func writeContentType(w http.ResponseWriter, value []string) {
FILE: vendor/github.com/gin-gonic/gin/render/text.go
type String (line 14) | type String struct
method Render (line 22) | func (r String) Render(w http.ResponseWriter) error {
method WriteContentType (line 27) | func (r String) WriteContentType(w http.ResponseWriter) {
function WriteString (line 32) | func WriteString(w http.ResponseWriter, format string, data []interface{...
FILE: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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: vendor/github.com/gin-gonic/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 208) | func (group *RouterGroup) combineHandlers(handlers HandlersChain) Hand...
method calculateAbsolutePath (line 219) | func (group *RouterGroup) calculateAbsolutePath(relativePath string) s...
method returnObj (line 223) | func (group *RouterGroup) returnObj() IRoutes {
FILE: vendor/github.com/gin-gonic/gin/test_helpers.go
function CreateTestContext (line 10) | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) {
FILE: vendor/github.com/gin-gonic/gin/tree.go
type Param (line 14) | type Param struct
type Params (line 22) | type Params
method Get (line 26) | func (ps Params) Get(name string) (string, bool) {
method ByName (line 37) | func (ps Params) ByName(name string) (va string) {
type methodTree (line 42) | type methodTree struct
type methodTrees (line 47) | type methodTrees
method get (line 49) | func (trees methodTrees) get(method string) *node {
function min (line 58) | func min(a, b int) int {
function countParams (line 65) | func countParams(path string) uint8 {
type nodeType (line 79) | type nodeType
constant static (line 82) | static nodeType = iota
constant root (line 83) | root
constant param (line 84) | param
constant catchAll (line 85) | catchAll
type node (line 88) | type node struct
method incrementChildPrio (line 100) | func (n *node) incrementChildPrio(pos int) int {
method addRoute (line 125) | func (n *node) addRoute(path string, handlers HandlersChain) {
method insertChild (line 254) | func (n *node) insertChild(numParams uint8, path string, fullPath stri...
method getValue (line 372) | func (n *node) getValue(path string, po Params, unescape bool) (handle...
method findCaseInsensitivePath (line 513) | func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash b...
FILE: vendor/github.com/gin-gonic/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 113) | func lastChar(str string) uint8 {
function nameOfFunction (line 120) | func nameOfFunction(f interface{}) string {
function joinPaths (line 124) | func joinPaths(absolutePath, relativePath string) string {
function resolveAddress (line 137) | func resolveAddress(addr []string) string {
FILE: vendor/github.com/gin-gonic/gin/version.go
constant Version (line 8) | Version = "v1.4.0"
FILE: vendor/github.com/go-ini/ini/error.go
type ErrDelimiterNotFound (line 21) | type ErrDelimiterNotFound struct
method Error (line 30) | func (err ErrDelimiterNotFound) Error() string {
function IsErrDelimiterNotFound (line 25) | func IsErrDelimiterNotFound(err error) bool {
FILE: vendor/github.com/go-ini/ini/file.go
type File (line 29) | type File struct
method NewSection (line 65) | func (f *File) NewSection(name string) (*Section, error) {
method NewRawSection (line 87) | func (f *File) NewRawSection(name, body string) (*Section, error) {
method NewSections (line 99) | func (f *File) NewSections(names ...string) (err error) {
method GetSection (line 109) | func (f *File) GetSection(name string) (*Section, error) {
method Section (line 130) | func (f *File) Section(name string) *Section {
method Sections (line 142) | func (f *File) Sections() []*Section {
method ChildSections (line 151) | func (f *File) ChildSections(name string) []*Section {
method SectionStrings (line 156) | func (f *File) SectionStrings() []string {
method DeleteSection (line 163) | func (f *File) DeleteSection(name string) {
method reload (line 182) | func (f *File) reload(s dataSource) error {
method Reload (line 193) | func (f *File) Reload() (err error) {
method Append (line 208) | func (f *File) Append(source interface{}, others ...interface{}) error {
method writeToBuffer (line 224) | func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
method WriteToIndent (line 370) | func (f *File) WriteToIndent(w io.Writer, indent string) (int64, error) {
method WriteTo (line 379) | func (f *File) WriteTo(w io.Writer) (int64, error) {
method SaveToIndent (line 384) | func (f *File) SaveToIndent(filename, indent string) error {
method SaveTo (line 396) | func (f *File) SaveTo(filename string) error {
function newFile (line 47) | func newFile(dataSources []dataSource, opts LoadOptions) *File {
function Empty (line 58) | func Empty() *File {
FILE: vendor/github.com/go-ini/ini/ini.go
constant DEFAULT_SECTION (line 31) | DEFAULT_SECTION = "DEFAULT"
constant _DEPTH_VALUES (line 34) | _DEPTH_VALUES = 99
constant _VERSION (line 35) | _VERSION = "1.32.1"
function Version (line 39) | func Version() string {
function init (line 63) | func init() {
function inSlice (line 69) | func inSlice(str string, s []string) bool {
type dataSource (line 79) | type dataSource interface
type sourceFile (line 84) | type sourceFile struct
method ReadCloser (line 88) | func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) {
type sourceData (line 93) | type sourceData struct
method ReadCloser (line 97) | func (s *sourceData) ReadCloser() (io.ReadCloser, error) {
type sourceReadCloser (line 102) | type sourceReadCloser struct
method ReadCloser (line 106) | func (s *sourceReadCloser) ReadCloser() (io.ReadCloser, error) {
function parseDataSource (line 110) | func parseDataSource(source interface{}) (dataSource, error) {
type LoadOptions (line 123) | type LoadOptions struct
function LoadSources (line 152) | func LoadSources(opts LoadOptions, source interface{}, others ...interfa...
function Load (line 174) | func Load(source interface{}, others ...interface{}) (*File, error) {
function LooseLoad (line 180) | func LooseLoad(source interface{}, others ...interface{}) (*File, error) {
function InsensitiveLoad (line 186) | func InsensitiveLoad(source interface{}, others ...interface{}) (*File, ...
function ShadowLoad (line 192) | func ShadowLoad(source interface{}, others ...interface{}) (*File, error) {
FILE: vendor/github.com/go-ini/ini/key.go
type Key (line 27) | type Key struct
method addShadow (line 50) | func (k *Key) addShadow(val string) error {
method AddShadow (line 64) | func (k *Key) AddShadow(val string) error {
method addNestedValue (line 71) | func (k *Key) addNestedValue(val string) error {
method AddNestedValue (line 80) | func (k *Key) AddNestedValue(val string) error {
method Name (line 91) | func (k *Key) Name() string {
method Value (line 96) | func (k *Key) Value() string {
method ValueWithShadows (line 101) | func (k *Key) ValueWithShadows() []string {
method NestedValues (line 115) | func (k *Key) NestedValues() []string {
method transformValue (line 120) | func (k *Key) transformValue(val string) string {
method String (line 153) | func (k *Key) String() string {
method Validate (line 159) | func (k *Key) Validate(fn func(string) string) string {
method Bool (line 179) | func (k *Key) Bool() (bool, error) {
method Float64 (line 184) | func (k *Key) Float64() (float64, error) {
method Int (line 189) | func (k *Key) Int() (int, error) {
method Int64 (line 194) | func (k *Key) Int64() (int64, error) {
method Uint (line 199) | func (k *Key) Uint() (uint, error) {
method Uint64 (line 205) | func (k *Key) Uint64() (uint64, error) {
method Duration (line 210) | func (k *Key) Duration() (time.Duration, error) {
method TimeFormat (line 215) | func (k *Key) TimeFormat(format string) (time.Time, error) {
method Time (line 220) | func (k *Key) Time() (time.Time, error) {
method MustString (line 225) | func (k *Key) MustString(defaultVal string) string {
method MustBool (line 236) | func (k *Key) MustBool(defaultVal ...bool) bool {
method MustFloat64 (line 247) | func (k *Key) MustFloat64(defaultVal ...float64) float64 {
method MustInt (line 258) | func (k *Key) MustInt(defaultVal ...int) int {
method MustInt64 (line 269) | func (k *Key) MustInt64(defaultVal ...int64) int64 {
method MustUint (line 280) | func (k *Key) MustUint(defaultVal ...uint) uint {
method MustUint64 (line 291) | func (k *Key) MustUint64(defaultVal ...uint64) uint64 {
method MustDuration (line 302) | func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration {
method MustTimeFormat (line 313) | func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) t...
method MustTime (line 324) | func (k *Key) MustTime(defaultVal ...time.Time) time.Time {
method In (line 330) | func (k *Key) In(defaultVal string, candidates []string) string {
method InFloat64 (line 342) | func (k *Key) InFloat64(defaultVal float64, candidates []float64) floa...
method InInt (line 354) | func (k *Key) InInt(defaultVal int, candidates []int) int {
method InInt64 (line 366) | func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 {
method InUint (line 378) | func (k *Key) InUint(defaultVal uint, candidates []uint) uint {
method InUint64 (line 390) | func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 {
method InTimeFormat (line 402) | func (k *Key) InTimeFormat(format string, defaultVal time.Time, candid...
method InTime (line 414) | func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) tim...
method RangeFloat64 (line 420) | func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 {
method RangeInt (line 430) | func (k *Key) RangeInt(defaultVal, min, max int) int {
method RangeInt64 (line 440) | func (k *Key) RangeInt64(defaultVal, min, max int64) int64 {
method RangeTimeFormat (line 450) | func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time...
method RangeTime (line 460) | func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time {
method Strings (line 465) | func (k *Key) Strings(delim string) []string {
method StringsWithShadows (line 509) | func (k *Key) StringsWithShadows(delim string) []string {
method Float64s (line 527) | func (k *Key) Float64s(delim string) []float64 {
method Ints (line 533) | func (k *Key) Ints(delim string) []int {
method Int64s (line 539) | func (k *Key) Int64s(delim string) []int64 {
method Uints (line 545) | func (k *Key) Uints(delim string) []uint {
method Uint64s (line 551) | func (k *Key) Uint64s(delim string) []uint64 {
method TimesFormat (line 558) | func (k *Key) TimesFormat(format, delim string) []time.Time {
method Times (line 565) | func (k *Key) Times(delim string) []time.Time {
method ValidFloat64s (line 571) | func (k *Key) ValidFloat64s(delim string) []float64 {
method ValidInts (line 578) | func (k *Key) ValidInts(delim string) []int {
method ValidInt64s (line 585) | func (k *Key) ValidInt64s(delim string) []int64 {
method ValidUints (line 592) | func (k *Key) ValidUints(delim string) []uint {
method ValidUint64s (line 599) | func (k *Key) ValidUint64s(delim string) []uint64 {
method ValidTimesFormat (line 605) | func (k *Key) ValidTimesFormat(format, delim string) []time.Time {
method ValidTimes (line 611) | func (k *Key) ValidTimes(delim string) []time.Time {
method StrictFloat64s (line 616) | func (k *Key) StrictFloat64s(delim string) ([]float64, error) {
method StrictInts (line 621) | func (k *Key) StrictInts(delim string) ([]int, error) {
method StrictInt64s (line 626) | func (k *Key) StrictInt64s(delim string) ([]int64, error) {
method StrictUints (line 631) | func (k *Key) StrictUints(delim string) ([]uint, error) {
method StrictUint64s (line 636) | func (k *Key) StrictUint64s(delim string) ([]uint64, error) {
method StrictTimesFormat (line 642) | func (k *Key) StrictTimesFormat(format, delim string) ([]time.Time, er...
method StrictTimes (line 648) | func (k *Key) StrictTimes(delim string) ([]time.Time, error) {
method parseFloat64s (line 653) | func (k *Key) parseFloat64s(strs []string, addInvalid, returnOnInvalid...
method parseInts (line 668) | func (k *Key) parseInts(strs []string, addInvalid, returnOnInvalid boo...
method parseInt64s (line 683) | func (k *Key) parseInt64s(strs []string, addInvalid, returnOnInvalid b...
method parseUints (line 698) | func (k *Key) parseUints(strs []string, addInvalid, returnOnInvalid bo...
method parseUint64s (line 713) | func (k *Key) parseUint64s(strs []string, addInvalid, returnOnInvalid ...
method parseTimesFormat (line 728) | func (k *Key) parseTimesFormat(format string, strs []string, addInvali...
method SetValue (line 743) | func (k *Key) SetValue(v string) {
function newKey (line 42) | func newKey(s *Section, name, val string) *Key {
type ValueMapper (line 88) | type ValueMapper
function parseBool (line 168) | func parseBool(str string) (value bool, err error) {
FILE: vendor/github.com/go-ini/ini/parser.go
type tokenType (line 27) | type tokenType
constant _TOKEN_INVALID (line 30) | _TOKEN_INVALID tokenType = iota
constant _TOKEN_COMMENT (line 31) | _TOKEN_COMMENT
constant _TOKEN_SECTION (line 32) | _TOKEN_SECTION
constant _TOKEN_KEY (line 33) | _TOKEN_KEY
type parser (line 36) | type parser struct
method BOM (line 53) | func (p *parser) BOM() error {
method readUntil (line 80) | func (p *parser) readUntil(delim byte) ([]byte, error) {
method readMultilines (line 142) | func (p *parser) readMultilines(line, val, valQuote string) (string, e...
method readContinuationLines (line 168) | func (p *parser) readContinuationLines(val string) (string, error) {
method readValue (line 196) | func (p *parser) readValue(in []byte,
function newParser (line 43) | func newParser(r io.Reader) *parser {
function cleanComment (line 92) | func cleanComment(in []byte) ([]byte, bool) {
function readKeyName (line 100) | func readKeyName(in []byte) (string, int, error) {
function hasSurroundedQuote (line 191) | func hasSurroundedQuote(in string, quote byte) bool {
method parse (line 260) | func (f *File) parse(reader io.Reader) (err error) {
FILE: vendor/github.com/go-ini/ini/section.go
type Section (line 24) | type Section struct
method Name (line 47) | func (s *Section) Name() string {
method Body (line 53) | func (s *Section) Body() string {
method SetBody (line 58) | func (s *Section) SetBody(body string) {
method NewKey (line 66) | func (s *Section) NewKey(name, val string) (*Key, error) {
method NewBooleanKey (line 96) | func (s *Section) NewBooleanKey(name string) (*Key, error) {
method GetKey (line 107) | func (s *Section) GetKey(name string) (*Key, error) {
method HasKey (line 141) | func (s *Section) HasKey(name string) bool {
method Haskey (line 148) | func (s *Section) Haskey(name string) bool {
method HasValue (line 153) | func (s *Section) HasValue(value string) bool {
method Key (line 168) | func (s *Section) Key(name string) *Key {
method Keys (line 180) | func (s *Section) Keys() []*Key {
method ParentKeys (line 189) | func (s *Section) ParentKeys() []*Key {
method KeyStrings (line 209) | func (s *Section) KeyStrings() []string {
method KeysHash (line 216) | func (s *Section) KeysHash() map[string]string {
method DeleteKey (line 230) | func (s *Section) DeleteKey(name string) {
method ChildSections (line 248) | func (s *Section) ChildSections() []*Section {
function newSection (line 36) | func newSection(f *File, name string) *Section {
FILE: vendor/github.com/go-ini/ini/struct.go
type NameMapper (line 28) | type NameMapper
method parseFieldName (line 61) | func (s *Section) parseFieldName(raw, actual string) string {
function parseDelim (line 71) | func parseDelim(actual string) string {
function setSliceWithProperType (line 81) | func setSliceWithProperType(key *Key, field reflect.Value, delim string,...
function wrapStrictError (line 143) | func wrapStrictError(err error, isStrict bool) error {
function setWithProperType (line 153) | func setWithProperType(t reflect.Type, key *Key, field reflect.Value, de...
function parseTagOptions (line 214) | func parseTagOptions(tag string) (rawName string, omitEmpty bool, allowS...
method mapTo (line 226) | func (s *Section) mapTo(val reflect.Value, isStrict bool) error {
method MapTo (line 273) | func (s *Section) MapTo(v interface{}) error {
method StrictMapTo (line 288) | func (s *Section) StrictMapTo(v interface{}) error {
method MapTo (line 302) | func (f *File) MapTo(v interface{}) error {
method StrictMapTo (line 308) | func (f *File) StrictMapTo(v interface{}) error {
function MapToWithMapper (line 313) | func MapToWithMapper(v interface{}, mapper NameMapper, source interface{...
function StrictMapToWithMapper (line 324) | func StrictMapToWithMapper(v interface{}, mapper NameMapper, source inte...
function MapTo (line 334) | func MapTo(v, source interface{}, others ...interface{}) error {
function StrictMapTo (line 340) | func StrictMapTo(v, source interface{}, others ...interface{}) error {
function reflectSliceWithProperType (line 345) | func reflectSliceWithProperType(key *Key, field reflect.Value, delim str...
function reflectWithProperType (line 375) | func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value...
function isEmptyValue (line 399) | func isEmptyValue(v reflect.Value) bool {
method reflectFrom (line 420) | func (s *Section) reflectFrom(val reflect.Value) error {
method ReflectFrom (line 485) | func (s *Section) ReflectFrom(v interface{}) error {
method ReflectFrom (line 499) | func (f *File) ReflectFrom(v interface{}) error {
function ReflectFromWithMapper (line 504) | func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) ...
function ReflectFrom (line 510) | func ReflectFrom(cfg *File, v interface{}) error {
FILE: vendor/github.com/go-openapi/jsonpointer/pointer.go
constant emptyPointer (line 39) | emptyPointer = ``
constant pointerSeparator (line 40) | pointerSeparator = `/`
constant invalidStart (line 42) | invalidStart = `JSON pointer must be empty or start with a "` + pointerS...
type JSONPointable (line 50) | type JSONPointable interface
type JSONSetable (line 56) | type JSONSetable interface
function New (line 61) | func New(jsonPointerString string) (Pointer, error) {
type Pointer (line 70) | type Pointer struct
method parse (line 75) | func (p *Pointer) parse(jsonPointerString string) error {
method Get (line 94) | func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind...
method Set (line 99) | func (p *Pointer) Set(document interface{}, value interface{}) (interf...
method get (line 213) | func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvide...
method set (line 244) | func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameP...
method DecodedTokens (line 340) | func (p *Pointer) DecodedTokens() []string {
method IsEmpty (line 350) | func (p *Pointer) IsEmpty() bool {
method String (line 355) | func (p *Pointer) String() string {
function GetForToken (line 104) | func GetForToken(document interface{}, decodedToken string) (interface{}...
function SetForToken (line 109) | func SetForToken(document interface{}, decodedToken string, value interf...
function getSingleImpl (line 113) | func getSingleImpl(node interface{}, decodedToken string, nameProvider *...
function setSingleImpl (line 162) | func setSingleImpl(node, data interface{}, decodedToken string, nameProv...
constant encRefTok0 (line 372) | encRefTok0 = `~0`
constant encRefTok1 (line 373) | encRefTok1 = `~1`
constant decRefTok0 (line 374) | decRefTok0 = `~`
constant decRefTok1 (line 375) | decRefTok1 = `/`
function Unescape (line 379) | func Unescape(token string) string {
function Escape (line 386) | func Escape(token string) string {
FILE: vendor/github.com/go-openapi/jsonreference/reference.go
constant fragmentRune (line 38) | fragmentRune = `#`
function New (line 42) | func New(jsonReferenceString string) (Ref, error) {
function MustCreateRef (line 52) | func MustCreateRef(ref string) Ref {
type Ref (line 61) | type Ref struct
method GetURL (line 73) | func (r *Ref) GetURL() *url.URL {
method GetPointer (line 78) | func (r *Ref) GetPointer() *jsonpointer.Pointer {
method String (line 83) | func (r *Ref) String() string {
method IsRoot (line 97) | func (r *Ref) IsRoot() bool {
method IsCanonical (line 105) | func (r *Ref) IsCanonical() bool {
method parse (line 110) | func (r *Ref) parse(jsonReferenceString string) error {
method Inherits (line 141) | func (r *Ref) Inherits(child Ref) (*Ref, error) {
FILE: vendor/github.com/go-openapi/spec/bindata.go
function bindataRead (line 21) | func bindataRead(data []byte, name string) ([]byte, error) {
type asset (line 41) | type asset struct
type bindataFileInfo (line 47) | type bindataFileInfo struct
method Name (line 54) | func (fi bindataFileInfo) Name() string {
method Size (line 57) | func (fi bindataFileInfo) Size() int64 {
method Mode (line 60) | func (fi bindataFileInfo) Mode() os.FileMode {
method ModTime (line 63) | func (fi bindataFileInfo) ModTime() time.Time {
method IsDir (line 66) | func (fi bindataFileInfo) IsDir() bool {
method Sys (line 69) | func (fi bindataFileInfo) Sys() interface{} {
function jsonschemaDraft04JSONBytes (line 75) | func jsonschemaDraft04JSONBytes() ([]byte, error) {
function jsonschemaDraft04JSON (line 82) | func jsonschemaDraft04JSON() (*asset, error) {
function v2SchemaJSONBytes (line 95) | func v2SchemaJSONBytes() ([]byte, error) {
function v2SchemaJSON (line 102) | func v2SchemaJSON() (*asset, error) {
function Asset (line 116) | func Asset(name string) ([]byte, error) {
function AssetString (line 129) | func AssetString(name string) (string, error) {
function MustAsset (line 136) | func MustAsset(name string) []byte {
function MustAssetString (line 147) | func MustAssetString(name string) string {
function AssetInfo (line 154) | func AssetInfo(name string) (os.FileInfo, error) {
function AssetDigest (line 168) | func AssetDigest(name string) ([sha256.Size]byte, error) {
function Digests (line 181) | func Digests() (map[string][sha256.Size]byte, error) {
function AssetNames (line 194) | func AssetNames() []string {
function AssetDir (line 222) | func AssetDir(name string) ([]string, error) {
type bintree (line 244) | type bintree struct
function RestoreAsset (line 257) | func RestoreAsset(dir, name string) error {
function RestoreAssets (line 278) | func RestoreAssets(dir, name string) error {
function _filePath (line 294) | func _filePath(dir, name string) string {
FILE: vendor/github.com/go-openapi/spec/cache.go
type ResolutionCache (line 20) | type ResolutionCache interface
type simpleCache (line 25) | type simpleCache struct
method Get (line 31) | func (s *simpleCache) Get(uri string) (interface{}, bool) {
method Set (line 42) | func (s *simpleCache) Set(uri string, data interface{}) {
function init (line 50) | func init() {
function initResolutionCache (line 55) | func initResolutionCache() ResolutionCache {
FILE: vendor/github.com/go-openapi/spec/contact_info.go
type ContactInfo (line 20) | type ContactInfo struct
FILE: vendor/github.com/go-openapi/spec/debug.go
function init (line 33) | func init() {
function debugOptions (line 37) | func debugOptions() {
function debugLog (line 41) | func debugLog(msg string, args ...interface{}) {
FILE: vendor/github.com/go-openapi/spec/expander.go
type ExpandOptions (line 24) | type ExpandOptions struct
function ResolveRefWithBase (line 32) | func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions)...
function ResolveRef (line 52) | func ResolveRef(root interface{}, ref *Ref) (*Schema, error) {
function ResolveParameter (line 73) | func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) {
function ResolveParameterWithBase (line 78) | func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOpt...
function ResolveResponse (line 92) | func ResolveResponse(root interface{}, ref Ref) (*Response, error) {
function ResolveResponseWithBase (line 97) | func ResolveResponseWithBase(root interface{}, ref Ref, opts *ExpandOpti...
function ResolveItems (line 114) | func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Item...
function ResolvePathItem (line 131) | func ResolvePathItem(root interface{}, ref Ref, opts *ExpandOptions) (*P...
function ExpandSpec (line 148) | func ExpandSpec(spec *Swagger, options *ExpandOptions) error {
function baseForRoot (line 205) | func baseForRoot(root interface{}, cache ResolutionCache) string {
function ExpandSchema (line 224) | func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCach...
function ExpandSchemaWithBasePath (line 237) | func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opt...
function expandItems (line 261) | func expandItems(target Schema, parentRefs []string, resolver *schemaLoa...
function expandSchema (line 281) | func expandSchema(target Schema, parentRefs []string, resolver *schemaLo...
function expandPathItem (line 445) | func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath...
function expandOperation (line 485) | func expandOperation(op *Operation, resolver *schemaLoader, basePath str...
function ExpandResponseWithRoot (line 515) | func ExpandResponseWithRoot(response *Response, root interface{}, cache ...
function ExpandResponse (line 534) | func ExpandResponse(response *Response, basePath string) error {
function ExpandParameterWithRoot (line 551) | func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cac...
function ExpandParameter (line 570) | func ExpandParameter(parameter *Parameter, basePath string) error {
function getRefAndSchema (line 586) | func getRefAndSchema(input interface{}) (*Ref, *Schema, error) {
function expandParameterOrResponse (line 608) | func expandParameterOrResponse(input interface{}, resolver *schemaLoader...
FILE: vendor/github.com/go-openapi/spec/external_docs.go
type ExternalDocumentation (line 21) | type ExternalDocumentation struct
FILE: vendor/github.com/go-openapi/spec/header.go
constant jsonArray (line 26) | jsonArray = "array"
type HeaderProps (line 30) | type HeaderProps struct
type Header (line 37) | type Header struct
method WithDescription (line 50) | func (h *Header) WithDescription(description string) *Header {
method Typed (line 56) | func (h *Header) Typed(tpe, format string) *Header {
method CollectionOf (line 63) | func (h *Header) CollectionOf(items *Items, format string) *Header {
method WithDefault (line 71) | func (h *Header) WithDefault(defaultValue interface{}) *Header {
method WithMaxLength (line 77) | func (h *Header) WithMaxLength(max int64) *Header {
method WithMinLength (line 83) | func (h *Header) WithMinLength(min int64) *Header {
method WithPattern (line 89) | func (h *Header) WithPattern(pattern string) *Header {
method WithMultipleOf (line 95) | func (h *Header) WithMultipleOf(number float64) *Header {
method WithMaximum (line 101) | func (h *Header) WithMaximum(max float64, exclusive bool) *Header {
method WithMinimum (line 108) | func (h *Header) WithMinimum(min float64, exclusive bool) *Header {
method WithEnum (line 115) | func (h *Header) WithEnum(values ...interface{}) *Header {
method WithMaxItems (line 121) | func (h *Header) WithMaxItems(size int64) *Header {
method WithMinItems (line 127) | func (h *Header) WithMinItems(size int64) *Header {
method UniqueValues (line 133) | func (h *Header) UniqueValues() *Header {
method AllowDuplicates (line 139) | func (h *Header) AllowDuplicates() *Header {
method MarshalJSON (line 145) | func (h Header) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 162) | func (h *Header) UnmarshalJSON(data []byte) error {
method JSONLookup (line 176) | func (h Header) JSONLookup(token string) (interface{}, error) {
function ResponseHeader (line 45) | func ResponseHeader() *Header {
FILE: vendor/github.com/go-openapi/spec/info.go
type Extensions (line 26) | type Extensions
method Add (line 29) | func (e Extensions) Add(key string, value interface{}) {
method GetString (line 35) | func (e Extensions) GetString(key string) (string, bool) {
method GetBool (line 44) | func (e Extensions) GetBool(key string) (bool, bool) {
method GetStringSlice (line 53) | func (e Extensions) GetStringSlice(key string) ([]string, bool) {
type VendorExtensible (line 73) | type VendorExtensible struct
method AddExtension (line 78) | func (v *VendorExtensible) AddExtension(key string, value interface{}) {
method MarshalJSON (line 89) | func (v VendorExtensible) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 101) | func (v *VendorExtensible) UnmarshalJSON(data []byte) error {
type InfoProps (line 119) | type InfoProps struct
type Info (line 132) | type Info struct
method JSONLookup (line 138) | func (i Info) JSONLookup(token string) (interface{}, error) {
method MarshalJSON (line 147) | func (i Info) MarshalJSON() ([]byte, error) {
method UnmarshalJSON (line 160) | func (i *Info) UnmarshalJSON(data []byte) error {
FILE: vendor/github.com/go-openapi/spec/items.go
constant jsonRef (line 26) | jsonRef = "$ref"
type SimpleSchema (line 30) | type SimpleSchema struct
method TypeName (line 40) | func (s *SimpleSchema) TypeName() string {
method ItemsTypeName (line 48) | func (s *SimpleSchema) ItemsTypeName() string {
type CommonValidations (line 56) | type CommonValidations struct
type Items (line 75) | type Items struct
method Typed (line 88) | func (i *Items) Typed(tpe, format string) *Items {
method CollectionOf (line 95) | func (i *Items) CollectionOf(items *Items, format string) *Items {
method WithDefault (line 103) | func (i *Items) WithDefault(defaultValue interface{}) *Items {
method WithMaxLength (line 109) | func (i *Items) WithMaxLength(max int64) *Items {
method WithMinLength (line 115) | func (i *Items) WithMinLength(min int64) *Items {
method WithPattern (line 121) | func (i *Items) WithPattern(pattern string) *Items {
method WithMultipleOf (line 127) | func (i *Items) WithMultipleOf(number float64) *Items {
method WithMaximum (line 133) | func (i *Items) WithMaximum(max float64, exclusive bool) *Items {
method WithMinimum (line 140) | func (i *Items) WithMinimum(
Copy disabled (too large)
Download .json
Condensed preview — 932 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (15,775K chars).
[
{
"path": ".gitignore",
"chars": 65,
"preview": ".idea/\n.DS_Store\n\nruntime/*\n!runtime/qrcode/bg.jpg\n!runtime/fonts"
},
{
"path": "Dockerfile",
"chars": 225,
"preview": "FROM golang:latest\n\nENV GOPROXY https://goproxy.cn,direct\nWORKDIR $GOPATH/src/github.com/EDDYCJY/go-gin-example\nCOPY . $"
},
{
"path": "LICENSE",
"chars": 1088,
"preview": "The MIT License (MIT)\n\nCopyright (c) The go-gin-example Authors\n\nPermission is hereby granted, free of charge, to any pe"
},
{
"path": "Makefile",
"chars": 366,
"preview": ".PHONY: build clean tool lint help\n\nall: build\n\nbuild:\n\t@go build -v .\n\ntool:\n\tgo vet ./...; true\n\tgofmt -w .\n\nlint:\n\tgo"
},
{
"path": "README.md",
"chars": 14631,
"preview": "# Go Gin Example - Blog API[](https://goreport"
},
{
"path": "README_ZH.md",
"chars": 13040,
"preview": "# Go Gin Example - 博客 API [](https://goreportc"
},
{
"path": "conf/app.ini",
"chars": 670,
"preview": "[app]\r\nPageSize = 10\r\nJwtSecret = 233\r\nPrefixUrl = http://127.0.0.1:8000\r\n\r\nRuntimeRootPath = runtime/\r\n\r\nImageSavePath "
},
{
"path": "docs/docs.go",
"chars": 20568,
"preview": "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n// This file was generated by swaggo/swag at\n// 2020-03-22 15:19:36.75970"
},
{
"path": "docs/sql/blog.sql",
"chars": 2302,
"preview": "/*\r\nNavicat MySQL Data Transfer\r\n\r\nSource Database : blog\r\n\r\nTarget Server Type : MYSQL\r\nTarget Server Version "
},
{
"path": "docs/swagger/swagger.json",
"chars": 19114,
"preview": "{\n \"swagger\": \"2.0\",\n \"info\": {\n \"description\": \"An example of gin\",\n \"title\": \"Golang Gin API\",\n "
},
{
"path": "docs/swagger/swagger.yaml",
"chars": 8472,
"preview": "basePath: '{{.BasePath}}'\ndefinitions:\n app.Response:\n properties:\n code:\n type: integer\n data:\n "
},
{
"path": "docs/swagger.json",
"chars": 19268,
"preview": "{\n \"swagger\": \"2.0\",\n \"info\": {\n \"description\": \"An example of gin\",\n \"title\": \"Golang Gin API\",\n "
},
{
"path": "docs/swagger.yaml",
"chars": 8448,
"preview": "definitions:\n app.Response:\n properties:\n code:\n type: integer\n data:\n type: object\n ms"
},
{
"path": "go.mod",
"chars": 1795,
"preview": "module github.com/EDDYCJY/go-gin-example\n\ngo 1.13\n\nrequire (\n\tgithub.com/360EntSecGroup-Skylar/excelize v1.3.1-0.2018052"
},
{
"path": "go.sum",
"chars": 18080,
"preview": "github.com/360EntSecGroup-Skylar/excelize v1.3.1-0.20180527032555-9e463b461434 h1:sJVNhDPQ1uL3izsJQGWFQb3lUvFloaTIgqz0Cl"
},
{
"path": "main.go",
"chars": 1753,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDYCJY/go-gin-example/model"
},
{
"path": "middleware/jwt/jwt.go",
"chars": 852,
"preview": "package jwt\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/dgrijalva/jwt-go\"\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDYCJY/go-g"
},
{
"path": "models/article.go",
"chars": 2928,
"preview": "package models\n\nimport (\n\t\"github.com/jinzhu/gorm\"\n)\n\ntype Article struct {\n\tModel\n\n\tTagID int `json:\"tag_id\" gorm:\"inde"
},
{
"path": "models/auth.go",
"chars": 550,
"preview": "package models\n\nimport \"github.com/jinzhu/gorm\"\n\ntype Auth struct {\n\tID int `gorm:\"primary_key\" json:\"id\"`\n\tUse"
},
{
"path": "models/models.go",
"chars": 3038,
"preview": "package models\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/jinzhu/gorm/dialects/mysql\"\n\n\t\"github.c"
},
{
"path": "models/tag.go",
"chars": 2409,
"preview": "package models\n\nimport (\n\t\"github.com/jinzhu/gorm\"\n)\n\ntype Tag struct {\n\tModel\n\n\tName string `json:\"name\"`\n\tCreate"
},
{
"path": "pkg/app/form.go",
"chars": 609,
"preview": "package app\n\nimport (\n\t\"github.com/astaxie/beego/validation\"\n\t\"github.com/gin-gonic/gin\"\n\t\"net/http\"\n\n\t\"github.com/EDDYC"
},
{
"path": "pkg/app/request.go",
"chars": 271,
"preview": "package app\n\nimport (\n\t\"github.com/astaxie/beego/validation\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/logging\"\n)\n\n// Mar"
},
{
"path": "pkg/app/response.go",
"chars": 452,
"preview": "package app\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/e\"\n)\n\ntype Gin struct {\n\tC *g"
},
{
"path": "pkg/e/cache.go",
"chars": 71,
"preview": "package e\n\nconst (\n\tCACHE_ARTICLE = \"ARTICLE\"\n\tCACHE_TAG = \"TAG\"\n)\n"
},
{
"path": "pkg/e/code.go",
"chars": 1044,
"preview": "package e\n\nconst (\n\tSUCCESS = 200\n\tERROR = 500\n\tINVALID_PARAMS = 400\n\n\tERROR_EXIST_TAG = 10001\n\tER"
},
{
"path": "pkg/e/msg.go",
"chars": 1508,
"preview": "package e\n\nvar MsgFlags = map[int]string{\n\tSUCCESS: \"ok\",\n\tERROR: \"fai"
},
{
"path": "pkg/export/excel.go",
"chars": 559,
"preview": "package export\n\nimport \"github.com/EDDYCJY/go-gin-example/pkg/setting\"\n\nconst EXT = \".xlsx\"\n\n// GetExcelFullUrl get the "
},
{
"path": "pkg/file/file.go",
"chars": 1836,
"preview": "package file\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"mime/multipart\"\n\t\"os\"\n\t\"path\"\n)\n\n// GetSize get the file size\nfunc GetSize("
},
{
"path": "pkg/gredis/redis.go",
"chars": 2065,
"preview": "package gredis\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n\n\t\"github.com/gomodule/redigo/redis\"\n\n\t\"github.com/EDDYCJY/go-gin-exam"
},
{
"path": "pkg/logging/file.go",
"chars": 507,
"preview": "package logging\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/setting\"\n)\n\n// getLogFilePath get the "
},
{
"path": "pkg/logging/log.go",
"chars": 1524,
"preview": "package logging\n\nimport (\n\t\"fmt\"\n\t\"github.com/EDDYCJY/go-gin-example/pkg/file\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n"
},
{
"path": "pkg/qrcode/qrcode.go",
"chars": 1905,
"preview": "package qrcode\n\nimport (\n\t\"image/jpeg\"\n\n\t\"github.com/boombuler/barcode\"\n\t\"github.com/boombuler/barcode/qr\"\n\n\t\"github.com"
},
{
"path": "pkg/setting/setting.go",
"chars": 1695,
"preview": "package setting\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/go-ini/ini\"\n)\n\ntype App struct {\n\tJwtSecret string\n\tPageSize int"
},
{
"path": "pkg/upload/image.go",
"chars": 1813,
"preview": "package upload\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"mime/multipart\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/EDDYCJY/go-gin-example/p"
},
{
"path": "pkg/util/jwt.go",
"chars": 1034,
"preview": "package util\n\nimport (\n\t\"time\"\n\n\t\"github.com/dgrijalva/jwt-go\"\n)\n\nvar jwtSecret []byte\n\ntype Claims struct {\n\tUsername s"
},
{
"path": "pkg/util/md5.go",
"chars": 204,
"preview": "package util\n\nimport (\n\t\"crypto/md5\"\n\t\"encoding/hex\"\n)\n\n// EncodeMD5 md5 encryption\nfunc EncodeMD5(value string) string "
},
{
"path": "pkg/util/pagination.go",
"chars": 343,
"preview": "package util\n\nimport (\n\t\"github.com/unknwon/com\"\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/se"
},
{
"path": "pkg/util/util.go",
"chars": 165,
"preview": "package util\n\nimport \"github.com/EDDYCJY/go-gin-example/pkg/setting\"\n\n// Setup Initialize the util\nfunc Setup() {\n\tjwtSe"
},
{
"path": "routers/api/auth.go",
"chars": 1562,
"preview": "package api\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/astaxie/beego/validation\"\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDY"
},
{
"path": "routers/api/upload.go",
"chars": 1595,
"preview": "package api\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/app\"\n\t\"github.co"
},
{
"path": "routers/api/v1/article.go",
"chars": 9009,
"preview": "package v1\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/unknwon/com\"\n\t\"github.com/astaxie/beego/validation\"\n\t\"github.com/boombule"
},
{
"path": "routers/api/v1/tag.go",
"chars": 6451,
"preview": "package v1\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/unknwon/com\"\n\t\"github.com/astaxie/beego/validation\"\n\t\"github.com/gin-goni"
},
{
"path": "routers/router.go",
"chars": 1663,
"preview": "package routers\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gin-gonic/gin\"\n\n\t_ \"github.com/EDDYCJY/go-gin-example/docs\"\n\t\"github"
},
{
"path": "service/article_service/article.go",
"chars": 2766,
"preview": "package article_service\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/EDDYCJY/go-gin-example/models\"\n\t\"github.com/EDDYCJY/go-"
},
{
"path": "service/article_service/article_poster.go",
"chars": 3596,
"preview": "package article_service\n\nimport (\n\t\"image\"\n\t\"image/draw\"\n\t\"image/jpeg\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/golang/freetype\""
},
{
"path": "service/auth_service/auth.go",
"chars": 219,
"preview": "package auth_service\n\nimport \"github.com/EDDYCJY/go-gin-example/models\"\n\ntype Auth struct {\n\tUsername string\n\tPassword s"
},
{
"path": "service/cache_service/article.go",
"chars": 751,
"preview": "package cache_service\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/e\"\n)\n\ntype Article struct"
},
{
"path": "service/cache_service/tag.go",
"chars": 567,
"preview": "package cache_service\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/EDDYCJY/go-gin-example/pkg/e\"\n)\n\ntype Tag struct {\n\t"
},
{
"path": "service/tag_service/tag.go",
"chars": 3292,
"preview": "package tag_service\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/360EntSecGroup-Skylar/excelize\"\n\t\""
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/.travis.yml",
"chars": 247,
"preview": "language: go\n\ninstall:\n - go get -d -t -v ./... && go build -v ./...\n\ngo:\n - 1.8.x\n - 1.9.x\n\nscript:\n - go vet ./..."
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/CODE_OF_CONDUCT.md",
"chars": 3223,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/CONTRIBUTING.md",
"chars": 17034,
"preview": "# Contributing to excelize\n\nWant to hack on excelize? Awesome! This page contains information about reporting issues as "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/LICENSE",
"chars": 1547,
"preview": "BSD 3-Clause License\n\nCopyright (c) 2016 - 2018 360 Enterprise Security Group, Endpoint Security,\ninc. All rights reserv"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/README.md",
"chars": 5720,
"preview": "\n\n# Excelize\n\n[\n\n# Excelize\n\n[\n\nconst (\n\t// STCellFormulaT"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/chart.go",
"chars": 38314,
"preview": "package excelize\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// This section defines the current"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/col.go",
"chars": 10626,
"preview": "package excelize\n\nimport (\n\t\"bytes\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Define the default cell size and EMU unit of mea"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/comment.go",
"chars": 6146,
"preview": "package excelize\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// parseFormatCommentsSet provides "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/date.go",
"chars": 3937,
"preview": "package excelize\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\n// timeLocationUTC defined the UTC time location.\nvar timeLocationUTC, _ ="
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/excelize.go",
"chars": 12767,
"preview": "package excelize\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/file.go",
"chars": 2336,
"preview": "package excelize\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// NewFile provides function to create new file"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/lib.go",
"chars": 4265,
"preview": "package excelize\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"unicode\"\n)\n\n// ReadZipReader c"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/picture.go",
"chars": 16336,
"preview": "package excelize\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"errors\"\n\t\"image\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"pat"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/rows.go",
"chars": 12374,
"preview": "package excelize\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// GetRows return all "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/shape.go",
"chars": 14796,
"preview": "package excelize\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// parseFormatShapeSet provides fun"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/sheet.go",
"chars": 23430,
"preview": "package excelize\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"errors\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\t\"uni"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/sheetpr.go",
"chars": 3161,
"preview": "package excelize\n\n// SheetPrOption is an option of a view of a worksheet. See SetSheetPrOptions().\ntype SheetPrOption in"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/sheetview.go",
"chars": 4441,
"preview": "package excelize\n\nimport \"fmt\"\n\n// SheetViewOption is an option of a view of a worksheet. See SetSheetViewOptions().\ntyp"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/styles.go",
"chars": 84016,
"preview": "package excelize\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Excel styles can "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/table.go",
"chars": 14098,
"preview": "package excelize\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// parseFormatTabl"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/templates.go",
"chars": 11975,
"preview": "// This file contains default templates for XML files we don't yet populated\n// based on content.\n\npackage excelize\n\n// "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/vmlDrawing.go",
"chars": 4521,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// vmlDrawing directly maps the root element in the file\n// xl/drawings/vmlDraw"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlChart.go",
"chars": 22942,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxChartSpace directly maps the c:chartSpace element. The chart namespace i"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlComments.go",
"chars": 2275,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxComments directly maps the comments element from the namespace\n// http:/"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlContentTypes.go",
"chars": 880,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxTypes directly maps the types element of content types for relationship\n"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlDecodeDrawing.go",
"chars": 7822,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// decodeCellAnchor directly maps the oneCellAnchor (One Cell Anchor Shape Size"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlDrawing.go",
"chars": 17249,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// Source relationship and namespace.\nconst (\n\tSourceRelationship "
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlSharedStrings.go",
"chars": 1865,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxSST directly maps the sst element from the namespace\n// http://schemas.o"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlStyles.go",
"chars": 15246,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxStyleSheet directly maps the stylesheet element in the namespace\n// http"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlTable.go",
"chars": 9853,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxTable directly maps the table element. A table helps organize and provid"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlWorkbook.go",
"chars": 15150,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xmlxWorkbookRels contains xmlxWorkbookRelations which maps sheet id and shee"
},
{
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlWorksheet.go",
"chars": 28339,
"preview": "package excelize\n\nimport \"encoding/xml\"\n\n// xlsxWorksheet directly maps the worksheet element in the namespace\n// http:/"
},
{
"path": "vendor/github.com/PuerkitoBio/purell/.gitignore",
"chars": 39,
"preview": "*.sublime-*\n.DS_Store\n*.swp\n*.swo\ntags\n"
},
{
"path": "vendor/github.com/PuerkitoBio/purell/.travis.yml",
"chars": 115,
"preview": "language: go\n\ngo:\n - 1.4.x\n - 1.5.x\n - 1.6.x\n - 1.7.x\n - 1.8.x\n - 1.9.x\n - \"1.10.x\"\n - tip\n"
},
{
"path": "vendor/github.com/PuerkitoBio/purell/LICENSE",
"chars": 1471,
"preview": "Copyright (c) 2012, Martin Angers\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or witho"
},
{
"path": "vendor/github.com/PuerkitoBio/purell/README.md",
"chars": 9336,
"preview": "# Purell\n\nPurell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I kno"
},
{
"path": "vendor/github.com/PuerkitoBio/purell/purell.go",
"chars": 12599,
"preview": "/*\nPackage purell offers URL normalization as described on the wikipedia page:\nhttp://en.wikipedia.org/wiki/URL_normaliz"
},
{
"path": "vendor/github.com/PuerkitoBio/urlesc/.travis.yml",
"chars": 125,
"preview": "language: go\n\ngo:\n - 1.4.x\n - 1.5.x\n - 1.6.x\n - 1.7.x\n - 1.8.x\n - tip\n\ninstall:\n - go build .\n\nscript:\n - go tes"
},
{
"path": "vendor/github.com/PuerkitoBio/urlesc/LICENSE",
"chars": 1479,
"preview": "Copyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or with"
},
{
"path": "vendor/github.com/PuerkitoBio/urlesc/README.md",
"chars": 595,
"preview": "urlesc [](https://travis-ci.org/PuerkitoBio/u"
},
{
"path": "vendor/github.com/PuerkitoBio/urlesc/urlesc.go",
"chars": 4785,
"preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/Unknwon/com/.gitignore",
"chars": 264,
"preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n.idea\n\n# Architectu"
},
{
"path": "vendor/github.com/Unknwon/com/.travis.yml",
"chars": 144,
"preview": "language: go\n\ngo:\n - 1.3.x\n - 1.4.x\n - 1.5.x\n - 1.6.x\n - 1.7.x\n - 1.8.x\n - 1.9.x\n - 1.10.x\n - 1.11.x\n - 1.12.x"
},
{
"path": "vendor/github.com/Unknwon/com/LICENSE",
"chars": 10272,
"preview": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AN"
},
{
"path": "vendor/github.com/Unknwon/com/README.md",
"chars": 963,
"preview": "Common Functions\n================\n\n[](https://travis-ci.org/unknwo"
},
{
"path": "vendor/github.com/Unknwon/com/cmd.go",
"chars": 4869,
"preview": "// +build go1.3\n\n// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you"
},
{
"path": "vendor/github.com/Unknwon/com/convert.go",
"chars": 3699,
"preview": "// Copyright 2014 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/dir.go",
"chars": 5948,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/file.go",
"chars": 3423,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/html.go",
"chars": 1698,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/http.go",
"chars": 5306,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/math.go",
"chars": 825,
"preview": "// Copyright 2014 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/path.go",
"chars": 2099,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/regex.go",
"chars": 1859,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/slice.go",
"chars": 1988,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/string.go",
"chars": 5575,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/time.go",
"chars": 3944,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/Unknwon/com/url.go",
"chars": 1095,
"preview": "// Copyright 2013 com authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use t"
},
{
"path": "vendor/github.com/alecthomas/template/LICENSE",
"chars": 1479,
"preview": "Copyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or with"
},
{
"path": "vendor/github.com/alecthomas/template/README.md",
"chars": 381,
"preview": "# Go's `text/template` package with newline elision\n\nThis is a fork of Go 1.4's [text/template](http://golang.org/pkg/te"
},
{
"path": "vendor/github.com/alecthomas/template/doc.go",
"chars": 15420,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/exec.go",
"chars": 26374,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/funcs.go",
"chars": 14890,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/go.mod",
"chars": 38,
"preview": "module github.com/alecthomas/template\n"
},
{
"path": "vendor/github.com/alecthomas/template/helper.go",
"chars": 3723,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/parse/lex.go",
"chars": 14064,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/parse/node.go",
"chars": 20545,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/parse/parse.go",
"chars": 18588,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/alecthomas/template/template.go",
"chars": 6740,
"preview": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "vendor/github.com/astaxie/beego/LICENSE",
"chars": 547,
"preview": "Copyright 2014 astaxie\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except"
},
{
"path": "vendor/github.com/astaxie/beego/validation/README.md",
"chars": 2623,
"preview": "validation\n==============\n\nvalidation is a form validation for a data validation and error collecting using Go.\n\n## Inst"
},
{
"path": "vendor/github.com/astaxie/beego/validation/util.go",
"chars": 6709,
"preview": "// Copyright 2014 beego Author. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "vendor/github.com/astaxie/beego/validation/validation.go",
"chars": 11493,
"preview": "// Copyright 2014 beego Author. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "vendor/github.com/astaxie/beego/validation/validators.go",
"chars": 16292,
"preview": "// Copyright 2014 beego Author. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\""
},
{
"path": "vendor/github.com/boombuler/barcode/.gitignore",
"chars": 9,
"preview": ".vscode/\n"
},
{
"path": "vendor/github.com/boombuler/barcode/LICENSE",
"chars": 1085,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Florian Sundermann\n\nPermission is hereby granted, free of charge, to any perso"
},
{
"path": "vendor/github.com/boombuler/barcode/README.md",
"chars": 1166,
"preview": "[](https://"
},
{
"path": "vendor/github.com/boombuler/barcode/barcode.go",
"chars": 1014,
"preview": "package barcode\n\nimport \"image\"\n\nconst (\n\tTypeAztec = \"Aztec\"\n\tTypeCodabar = \"Codabar\"\n\tTypeCode128 "
},
{
"path": "vendor/github.com/boombuler/barcode/qr/alphanumeric.go",
"chars": 1426,
"preview": "package qr\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/boombuler/barcode/utils\"\n)\n\nconst charSet string = \"01234"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/automatic.go",
"chars": 573,
"preview": "package qr\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/boombuler/barcode/utils\"\n)\n\nfunc encodeAuto(content string, ecl ErrorCorrectio"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/blocks.go",
"chars": 1784,
"preview": "package qr\n\ntype block struct {\n\tdata []byte\n\tecc []byte\n}\ntype blockList []*block\n\nfunc splitToBlocks(data <-chan byte"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/encoder.go",
"chars": 15495,
"preview": "// Package qr can be used to create QR barcodes.\npackage qr\n\nimport (\n\t\"image\"\n\n\t\"github.com/boombuler/barcode\"\n\t\"github"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/errorcorrection.go",
"chars": 639,
"preview": "package qr\n\nimport (\n\t\"github.com/boombuler/barcode/utils\"\n)\n\ntype errorCorrection struct {\n\trs *utils.ReedSolomonEncode"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/numeric.go",
"chars": 1136,
"preview": "package qr\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/boombuler/barcode/utils\"\n)\n\nfunc encodeNumeric(content st"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/qrcode.go",
"chars": 3309,
"preview": "package qr\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\n\t\"github.com/boombuler/barcode\"\n\t\"github.com/boombuler/barcode/uti"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/unicode.go",
"chars": 681,
"preview": "package qr\n\nimport (\n\t\"errors\"\n\n\t\"github.com/boombuler/barcode/utils\"\n)\n\nfunc encodeUnicode(content string, ecl ErrorCor"
},
{
"path": "vendor/github.com/boombuler/barcode/qr/versioninfo.go",
"chars": 9417,
"preview": "package qr\n\nimport \"math\"\n\n// ErrorCorrectionLevel indicates the amount of \"backup data\" stored in the QR code\ntype Erro"
},
{
"path": "vendor/github.com/boombuler/barcode/scaledbarcode.go",
"chars": 2850,
"preview": "package barcode\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n)\n\ntype wrapFunc func(x, y int) color.Color\n\n"
},
{
"path": "vendor/github.com/boombuler/barcode/utils/base1dcode.go",
"chars": 1285,
"preview": "// Package utils contain some utilities which are needed to create barcodes\npackage utils\n\nimport (\n\t\"image\"\n\t\"image/col"
},
{
"path": "vendor/github.com/boombuler/barcode/utils/bitlist.go",
"chars": 2552,
"preview": "package utils\n\n// BitList is a list that contains bits\ntype BitList struct {\n\tcount int\n\tdata []int32\n}\n\n// NewBitList "
},
{
"path": "vendor/github.com/boombuler/barcode/utils/galoisfield.go",
"chars": 1319,
"preview": "package utils\n\n// GaloisField encapsulates galois field arithmetics\ntype GaloisField struct {\n\tSize int\n\tBase int\n"
},
{
"path": "vendor/github.com/boombuler/barcode/utils/gfpoly.go",
"chars": 2817,
"preview": "package utils\n\ntype GFPoly struct {\n\tgf *GaloisField\n\tCoefficients []int\n}\n\nfunc (gp *GFPoly) Degree() int {\n\t"
},
{
"path": "vendor/github.com/boombuler/barcode/utils/reedsolomon.go",
"chars": 1091,
"preview": "package utils\n\nimport (\n\t\"sync\"\n)\n\ntype ReedSolomonEncoder struct {\n\tgf *GaloisField\n\tpolynomes []*GFPoly\n\tm "
},
{
"path": "vendor/github.com/boombuler/barcode/utils/runeint.go",
"chars": 458,
"preview": "package utils\n\n// RuneToInt converts a rune between '0' and '9' to an integer between 0 and 9\n// If the rune is outside "
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/.gitignore",
"chars": 16,
"preview": ".DS_Store\nbin\n\n\n"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/.travis.yml",
"chars": 117,
"preview": "language: go\n\nscript:\n - go vet ./...\n - go test -v ./...\n\ngo:\n - 1.3\n - 1.4\n - 1.5\n - 1.6\n - 1.7\n - tip\n"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/LICENSE",
"chars": 1058,
"preview": "Copyright (c) 2012 Dave Grijalva\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this s"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md",
"chars": 4693,
"preview": "## Migration Guide from v2 -> v3\n\nVersion 3 adds several new, frequently requested features. To do so, it introduces a "
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/README.md",
"chars": 7313,
"preview": "A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://se"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md",
"chars": 6104,
"preview": "## `jwt-go` Version History\n\n#### 3.1.0\n\n* Improvements to `jwt` command line tool\n* Added `SkipClaimsValidation` option"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/claims.go",
"chars": 3683,
"preview": "package jwt\n\nimport (\n\t\"crypto/subtle\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// For a type to be a Claims object, it must just have a Valid "
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/doc.go",
"chars": 166,
"preview": "// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html\n/"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/ecdsa.go",
"chars": 3570,
"preview": "package jwt\n\nimport (\n\t\"crypto\"\n\t\"crypto/ecdsa\"\n\t\"crypto/rand\"\n\t\"errors\"\n\t\"math/big\"\n)\n\nvar (\n\t// Sadly this is missing "
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go",
"chars": 1461,
"preview": "package jwt\n\nimport (\n\t\"crypto/ecdsa\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"errors\"\n)\n\nvar (\n\tErrNotECPublicKey = errors.New"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/errors.go",
"chars": 1844,
"preview": "package jwt\n\nimport (\n\t\"errors\"\n)\n\n// Error constants\nvar (\n\tErrInvalidKey = errors.New(\"key is invalid\")\n\tErrInval"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/hmac.go",
"chars": 2388,
"preview": "package jwt\n\nimport (\n\t\"crypto\"\n\t\"crypto/hmac\"\n\t\"errors\"\n)\n\n// Implements the HMAC-SHA family of signing methods signing"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/map_claims.go",
"chars": 2632,
"preview": "package jwt\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t// \"fmt\"\n)\n\n// Claims type that uses the map[string]interface{} for JS"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/none.go",
"chars": 1659,
"preview": "package jwt\n\n// Implements the none signing method. This is required by the spec\n// but you probably should never use i"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/parser.go",
"chars": 4060,
"preview": "package jwt\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype Parser struct {\n\tValidMethods []string"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/rsa.go",
"chars": 2365,
"preview": "package jwt\n\nimport (\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n)\n\n// Implements the RSA family of signing methods signing "
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/rsa_pss.go",
"chars": 2771,
"preview": "// +build go1.4\n\npackage jwt\n\nimport (\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n)\n\n// Implements the RSAPSS family of sign"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/rsa_utils.go",
"chars": 1614,
"preview": "package jwt\n\nimport (\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"errors\"\n)\n\nvar (\n\tErrKeyMustBePEMEncoded = errors.N"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/signing_method.go",
"chars": 1117,
"preview": "package jwt\n\nimport (\n\t\"sync\"\n)\n\nvar signingMethods = map[string]func() SigningMethod{}\nvar signingMethodLock = new(sync"
},
{
"path": "vendor/github.com/dgrijalva/jwt-go/token.go",
"chars": 3409,
"preview": "package jwt\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"strings\"\n\t\"time\"\n)\n\n// TimeFunc provides the current time wh"
},
{
"path": "vendor/github.com/gin-contrib/sse/.travis.yml",
"chars": 357,
"preview": "language: go\nsudo: false\ngo:\n - 1.8.x\n - 1.9.x\n - 1.10.x\n - 1.11.x\n - 1.12.x\n - master\n\ngit:\n depth: 10\n\nmatrix:\n"
},
{
"path": "vendor/github.com/gin-contrib/sse/LICENSE",
"chars": 1090,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Manuel Martínez-Almeida\n\nPermission is hereby granted, free of charge, to any "
},
{
"path": "vendor/github.com/gin-contrib/sse/README.md",
"chars": 1744,
"preview": "# Server-Sent Events\n\n[](https://godoc.org/github.com/g"
},
{
"path": "vendor/github.com/gin-contrib/sse/go.mod",
"chars": 87,
"preview": "module github.com/gin-contrib/sse\n\ngo 1.12\n\nrequire github.com/stretchr/testify v1.3.0\n"
},
{
"path": "vendor/github.com/gin-contrib/sse/go.sum",
"chars": 608,
"preview": "github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=\ngithub.com/davecgh/go-spew v1.1.0/go.m"
},
{
"path": "vendor/github.com/gin-contrib/sse/sse-decoder.go",
"chars": 3738,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-contrib/sse/sse-encoder.go",
"chars": 2256,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-contrib/sse/writer.go",
"chars": 395,
"preview": "package sse\n\nimport \"io\"\n\ntype stringWriter interface {\n\tio.Writer\n\tWriteString(string) (int, error)\n}\n\ntype stringWrapp"
},
{
"path": "vendor/github.com/gin-gonic/gin/.gitignore",
"chars": 77,
"preview": "vendor/*\n!vendor/vendor.json\ncoverage.out\ncount.out\ntest\nprofile.out\ntmp.out\n"
},
{
"path": "vendor/github.com/gin-gonic/gin/.travis.yml",
"chars": 1053,
"preview": "language: go\n\nmatrix:\n fast_finish: true\n include:\n - go: 1.8.x\n - go: 1.9.x\n - go: 1.10.x\n - go: 1.11.x\n env: "
},
{
"path": "vendor/github.com/gin-gonic/gin/AUTHORS.md",
"chars": 4182,
"preview": "List of all the awesome people working to make Gin the best Web Framework in Go.\n\n## gin 1.x series authors\n\n**Gin Core "
},
{
"path": "vendor/github.com/gin-gonic/gin/BENCHMARKS.md",
"chars": 53485,
"preview": "\n## Benchmark System\n\n**VM HOST:** DigitalOcean \n**Machine:** 4 CPU, 8 GB RAM. Ubuntu 16.04.2 x64 \n**Date:** July 19th"
},
{
"path": "vendor/github.com/gin-gonic/gin/CHANGELOG.md",
"chars": 16689,
"preview": "\n### Gin 1.4.0\n\n- [NEW] Support for [Go Modules](https://github.com/golang/go/wiki/Modules) [#1569](https://github.com/"
},
{
"path": "vendor/github.com/gin-gonic/gin/CODE_OF_CONDUCT.md",
"chars": 3219,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "vendor/github.com/gin-gonic/gin/CONTRIBUTING.md",
"chars": 623,
"preview": "## Contributing \n\n- With issues:\n - Use the search tool before opening a new issue.\n - Please provide source code and "
},
{
"path": "vendor/github.com/gin-gonic/gin/LICENSE",
"chars": 1090,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Manuel Martínez-Almeida\n\nPermission is hereby granted, free of charge, to any "
},
{
"path": "vendor/github.com/gin-gonic/gin/Makefile",
"chars": 1972,
"preview": "GO ?= go\nGOFMT ?= gofmt \"-s\"\nPACKAGES ?= $(shell $(GO) list ./... | grep -v /vendor/)\nVETPACKAGES ?= $(shell $(GO) list "
},
{
"path": "vendor/github.com/gin-gonic/gin/README.md",
"chars": 52858,
"preview": "# Gin Web Framework\n\n<img align=\"right\" width=\"159px\" src=\"https://raw.githubusercontent.com/gin-gonic/logo/master/color"
},
{
"path": "vendor/github.com/gin-gonic/gin/auth.go",
"chars": 3013,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/binding.go",
"chars": 3694,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/default_validator.go",
"chars": 1330,
"preview": "// Copyright 2017 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/form.go",
"chars": 2077,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/form_mapping.go",
"chars": 7614,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/json.go",
"chars": 1120,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/msgpack.go",
"chars": 770,
"preview": "// Copyright 2017 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/protobuf.go",
"chars": 864,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/query.go",
"chars": 469,
"preview": "// Copyright 2017 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/uri.go",
"chars": 408,
"preview": "// Copyright 2018 Gin Core Team. All rights reserved.\n// Use of this source code is governed by a MIT style\n// license "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/xml.go",
"chars": 701,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/binding/yaml.go",
"chars": 708,
"preview": "// Copyright 2018 Gin Core Team. All rights reserved.\n// Use of this source code is governed by a MIT style\n// license "
},
{
"path": "vendor/github.com/gin-gonic/gin/codecov.yml",
"chars": 110,
"preview": "coverage:\n notify:\n gitter:\n default:\n url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165\n"
},
{
"path": "vendor/github.com/gin-gonic/gin/context.go",
"chars": 32733,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
},
{
"path": "vendor/github.com/gin-gonic/gin/context_appengine.go",
"chars": 243,
"preview": "// +build appengine\n\n// Copyright 2017 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is govern"
},
{
"path": "vendor/github.com/gin-gonic/gin/debug.go",
"chars": 2744,
"preview": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// "
}
]
// ... and 732 more files (download for full content)
About this extraction
This page contains the full source code of the eddycjy/go-gin-example GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 932 files (30.1 MB), approximately 3.7M tokens, and a symbol index with 115893 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.