You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.0KB

Add a storage layer for attachments (#11387) * Add a storage layer for attachments * Fix some bug * fix test * Fix copyright head and lint * Fix bug * Add setting for minio and flags for migrate-storage * Add documents * fix lint * Add test for minio store type on attachments * fix test * fix test * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Add warning when storage migrated successfully * Fix drone * fix test * rebase * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * remove log on xorm * Fi download bug * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * refactor the codes * add trace * Fix test * Add URL function to serve attachments directly from S3/Minio * Add ability to enable/disable redirection in attachment configuration * Fix typo * Add a storage layer for attachments * Add setting for minio and flags for migrate-storage * fix lint * Add test for minio store type on attachments * Apply suggestions from code review Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> * Fix drone * fix test * Fix test * display the error on console * Move minio test to amd64 since minio docker don't support arm64 * don't change unrelated files * Fix lint * Fix build * update go.mod and go.sum * Use github.com/minio/minio-go/v6 * Remove unused function * Upgrade minio to v7 and some other improvements * fix lint * Fix go mod Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Tyler <tystuyfzand@gmail.com>
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge)
  2. [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go)
  3. [![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go)
  4. [![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go)
  5. [![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go)
  6. [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE)
  7. [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
  8. A high-performance 100% compatible drop-in replacement of "encoding/json"
  9. You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go)
  10. # Benchmark
  11. ![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png)
  12. Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go
  13. Raw Result (easyjson requires static code generation)
  14. | | ns/op | allocation bytes | allocation times |
  15. | --------------- | ----------- | ---------------- | ---------------- |
  16. | std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
  17. | easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
  18. | jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
  19. | std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
  20. | easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
  21. | jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
  22. Always benchmark with your own workload.
  23. The result depends heavily on the data input.
  24. # Usage
  25. 100% compatibility with standard lib
  26. Replace
  27. ```go
  28. import "encoding/json"
  29. json.Marshal(&data)
  30. ```
  31. with
  32. ```go
  33. import jsoniter "github.com/json-iterator/go"
  34. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  35. json.Marshal(&data)
  36. ```
  37. Replace
  38. ```go
  39. import "encoding/json"
  40. json.Unmarshal(input, &data)
  41. ```
  42. with
  43. ```go
  44. import jsoniter "github.com/json-iterator/go"
  45. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  46. json.Unmarshal(input, &data)
  47. ```
  48. [More documentation](http://jsoniter.com/migrate-from-go-std.html)
  49. # How to get
  50. ```
  51. go get github.com/json-iterator/go
  52. ```
  53. # Contribution Welcomed !
  54. Contributors
  55. - [thockin](https://github.com/thockin)
  56. - [mattn](https://github.com/mattn)
  57. - [cch123](https://github.com/cch123)
  58. - [Oleg Shaldybin](https://github.com/olegshaldybin)
  59. - [Jason Toffaletti](https://github.com/toffaletti)
  60. Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)