{"id":16331824,"url":"https://github.com/searking/golang","last_synced_at":"2025-04-04T13:12:11.378Z","repository":{"id":44490153,"uuid":"198572912","full_name":"searKing/golang","owner":"searKing","description":"various libs or tools for Golang","archived":false,"fork":false,"pushed_at":"2025-03-13T01:36:12.000Z","size":5663,"stargazers_count":103,"open_issues_count":2,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T12:57:40.349Z","etag":null,"topics":["cache-file","connection-mux","generic-template","generics","glog","go","gogenerate","golang","reorderbuffer","rotate-file","signal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/searKing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-24T06:31:19.000Z","updated_at":"2025-03-27T10:55:19.000Z","dependencies_parsed_at":"2023-02-04T06:46:27.385Z","dependency_job_id":"796f3807-ff78-44dc-952d-0f11f21b4827","html_url":"https://github.com/searKing/golang","commit_stats":{"total_commits":1595,"total_committers":5,"mean_commits":319.0,"dds":0.3473354231974921,"last_synced_commit":"367a7a10941722be36d7287ac3921665a28561b8"},"previous_names":[],"tags_count":1061,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searKing%2Fgolang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searKing%2Fgolang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searKing%2Fgolang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searKing%2Fgolang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/searKing","download_url":"https://codeload.github.com/searKing/golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182401,"owners_count":20897381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache-file","connection-mux","generic-template","generics","glog","go","gogenerate","golang","reorderbuffer","rotate-file","signal"],"created_at":"2024-10-10T23:28:41.857Z","updated_at":"2025-04-04T13:12:11.360Z","avatar_url":"https://github.com/searKing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/searKing/golang.svg)](https://pkg.go.dev/github.com/searKing/golang)\n[![Report card](https://goreportcard.com/badge/github.com/searKing/golang)](https://goreportcard.com/report/github.com/searKing/golang)\n[\u003cimg src=\"https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2FsearKing%2Fgolang\u0026countColor=%23263759\" height=\"20\"\u003e](https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2FsearKing%2Fgolang)\n[\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg\" height=\"20\"\u003e](https://jb.gg/OpenSourceSupport)\n\n# golang\n\nvarious libs or tools for Golang\n\n# GoLibraries\n\n* [exp](https://pkg.go.dev/github.com/searKing/golang/go/exp) — `exp` holds experimental packages and defines various\n  functions useful with [generics](https://go.dev/doc/tutorial/generics) of any type.\n    - [slices](https://pkg.go.dev/github.com/searKing/golang/go/exp/slices) defines various functions useful with slices\n      of any type.\n    - [maps](https://pkg.go.dev/github.com/searKing/golang/go/exp/maps) defines various functions useful with maps of\n      any type.\n    - [image](https://pkg.go.dev/github.com/searKing/golang/go/exp/image)\n      defines [Point[T]](https://pkg.go.dev/github.com/searKing/golang/go/exp/image#Point)\n      and [Rectangle[T]](https://pkg.go.dev/github.com/searKing/golang/go/exp/image#Rectangle) of any type.\n    - [sync.LRU](https://pkg.go.dev/github.com/searKing/golang/go/exp/sync#LRU) implements a thread safe fixed size LRU\n      cache, based on [not-thread safe lru](https://pkg.go.dev/github.com/searKing/golang/go/exp/container/lru#LRU)\n    - [sync.FixedPool](https://pkg.go.dev/github.com/searKing/golang/go/exp/sync#FixedPool) is a set of resident and\n      temporary items that may be individually saved and retrieved.\n    - [types.Optional](https://pkg.go.dev/github.com/searKing/golang/go/exp/types#Optional) represents a Value that may\n      be null.\n    - [container.hashring](https://pkg.go.dev/github.com/searKing/golang/go/exp/container/hashring#HashRing) —\n      hashring provides a consistent hashing function, read more about consistent hashing on\n      wikipedia: [Consistent_hashing](http://en.wikipedia.org/wiki/Consistent_hashing).\n    - [container.lru](https://pkg.go.dev/github.com/searKing/golang/go/exp/container/lru#LRU) implements a Go map[K]V\n      but implements a non-thread safe fixed size LRU cache.\n      Loads, stores, and deletes run in amortized constant time.\n    - [container.queue](https://pkg.go.dev/github.com/searKing/golang/go/exp/container/queue#Queue) implements a\n      two-stage queue of FIFO, not a deque.\n* [slog](https://pkg.go.dev/github.com/searKing/log/slog) - `slog`\n  provides [GlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewGlogHandler),\n  [GlogHumanHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewGlogHumanHandler),\n  [NewRotateHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateHandler) and\n  [MultiHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#MultiHandler) handlers\n  for [slog](https://pkg.go.dev/log/slog)\n    - [GlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewGlogHandler) provides a Handler that\n      writes Records to an io.Writer as line-delimited [glog](https://github.com/google/glog) formats, Log lines have\n      this\n      form: [Lyyyymmdd hh:mm:ss.uuuuuu threadid file:line\\] msg...](https://github.com/google/glog/blob/v0.6.0/src/glog/logging.h.in#L346).\n    - [GlogHumanHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewGlogHumanHandler) provides a\n      Handler that writes Records to an io.Writer as line-delimited [glog](https://github.com/google/glog) formats, but\n      human-readable, Log lines have this\n      form: [\\[LLLLL\\] \\[yyyymmdd hh:mm:ss.uuuuuu\\] \\[threadid\\] \\[file:line(func)\\] msg...](https://github.com/searKing/golang/blob/go/v1.2.86/go/log/slog/glog_handler.go#L85).\n    - [MultiHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#MultiHandler) that duplicates its writes\n      to all the provided handlers, similar to the Unix tee(1) command. `MultiHandler` might be useful for write log to\n      many Handlers, like writing log to both stdout and rotate file.\n    - [RotateHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateHandler) that provides a\n      Handler that writes Records to\n      a [RotateFile](https://pkg.go.dev/github.com/searKing/golang/go/os). `RotateHandler` might be useful for write log\n      to ease administration of systems that generate large numbers of files. It allows automatic rotation,\n      removal, and handler of files. Each file may be handled daily, weekly, monthly, strftimely, time_layoutly or when\n      it grows too large. Here are some helper\n      functions, [NewRotateGlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateGlogHandler), [NewRotateGlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateGlogHandler), [NewRotateGlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateGlogHandler), [NewRotateGlogHandler](https://pkg.go.dev/github.com/searKing/golang/go/log/slog#NewRotateGlogHandler)\n* [webhdfs](https://pkg.go.dev/github.com/searKing/webhdfs) - Hadoop WebHDFS REST API client library for Golang with fs\n  module like (asynchronous) interface.\n* [Thread](https://pkg.go.dev/github.com/searKing/golang/go/sync#Thread) — Thread should be used for such as\n  calling OS services or non-Go library functions that depend on per-thread state, as runtime.LockOSThread().\n* [BurstLimiter](https://pkg.go.dev/github.com/searKing/golang/go/time/rate#BurstLimiter) — BurstLimiter behaves\n  like Limiter in `time`, BurstLimiter controls how frequently events are allowed to happen.\n    - It implements a \"token bucket\" of size b, initially full、empty or any size, and refilled by `PutToken`\n      or `PutTokenN`. The difference is\n      that `time/rate.Limiter`initially full and refilled at rate r tokens per second.\n    - It implements a [Reorder Buffer](https://en.wikipedia.org/wiki/Re-order_buffer) allocated by `Reserve`\n      or `ReserveN` into account when allowing future events and `Wait` or `WaitN` blocks until lim permits n events to\n      happen.\n* [generator](https://pkg.go.dev/github.com/searKing/golang/go/go/generator#Generator) — Generator behaves\n  like `Generator` in python or ES6, with yield and next statements.\n* [signal](https://pkg.go.dev/github.com/searKing/golang/go/os/signal#Notify) — Signal enhances signal.Notify with the\n  stacktrace of cgo.\n* [sql](https://pkg.go.dev/github.com/searKing/golang/go/database/sql#NullDuration) — Enhance go std sql.\n    - NullDuration\n      -\n      ```NullDuration represents an interface that may be null. NullDuration implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString.```\n    - NullJson\n      -\n      ```NullJson represents an interface that may be null. NullJson implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString. Deprecate, use go-nulljson instead. For more information, see: https://pkg.go.dev/github.com/searKing/golang/tools/go-nulljson```\n* [ternary_search_tree](https://pkg.go.dev/github.com/searKing/golang/go/container/trie_tree/ternary_search_tree#TernarySearchTree)\n  — A type of trie (sometimes called a prefix tree) where nodes are arranged in a manner similar to a binary search\n  tree, but with up to three children rather than the binary tree's limit of two.\n* [mux](https://pkg.go.dev/github.com/searKing/golang/go/net/mux) — Mux is a generic Go library to multiplex\n  connections based on their payload. Using mux, you can serve gRPC, SSH, HTTPS, HTTP, Go RPC, and pretty much any other\n  protocol on the same TCP listener.\n* [SniffReader](https://pkg.go.dev/github.com/searKing/golang/go/io#SniffReader) — A Reader that allows sniff\n  and read from the provided input reader. data is buffered if Sniff(true) is called. buffered data is taken first, if\n  Sniff(false) is called.\n* [multiple_prefix](https://pkg.go.dev/github.com/searKing/golang/go/format/multiple_prefix) - Prefixes for\n  decimal and binary multiples, [Prefixes for decimal multiples](https://physics.nist.gov/cuu/Units/prefixes.html)\n  , [Prefixes for binary multiples](https://physics.nist.gov/cuu/Units/binary.html).\n* [flag](https://pkg.go.dev/github.com/searKing/golang/go/flag) — Enhance go std flag, such as StringSlice that\n  is a flag.Value that accumulates strings, e.g. --flag=one --flag=two would produce []string{\"one\", \"two\"}.\n* [goroutine](https://pkg.go.dev/github.com/searKing/golang/go/runtime/goroutine) — goroutine is a collection of\n  apis about goroutine.\n    - ID() — returns goroutine id of the goroutine that calls it.\n    - Lock — represents a goroutine ID, with goroutine ID checked, that is whether GoRoutines of lock newer and check\n      caller differ.\n* [hashring](https://pkg.go.dev/github.com/searKing/golang/go/container/hashring) — hashring provides a\n  consistent hashing function, read more about consistent hashing on\n  wikipedia:  [Consistent_hashing](http://en.wikipedia.org/wiki/Consistent_hashing).\n* [RotateFile](https://pkg.go.dev/github.com/searKing/golang/go/os#RotateFile) — RotateFile derived from os.File, and is\n  designed to ease administration of systems that generate large numbers of files. It allows automatic rotation,\n  removal, and handler of files. Each file may be handled daily, weekly, monthly, strftimely, time_layoutly or when it\n  grows too large.\n    - [NewFactoryFromFile](https://pkg.go.dev/github.com/searKing/golang/third_party/github.com/sirupsen/logrus#NewFactoryFromFile) —\n      NewFactoryFromFile is an example of os.RotateFile register for logrus.\n* [CacheFile](https://pkg.go.dev/github.com/searKing/golang/go/os#CacheFile) - CacheFile is a package cache(Eventual\n  consistency, behaves like sync.LRU[string, *os.File]), backed by a file system directory tree. It is safe for multiple\n  processes on a single machine to use the\n  same cache directory in a local file system simultaneously. They will coordinate using operating system file locks and\n  may duplicate effort but will not corrupt the cache. It's usually used to support download cache, download if cache\n  file not hit.\n* [UnlinkOldestFiles](https://pkg.go.dev/github.com/searKing/golang/go/os#UnlinkOldestFilesFunc) - UnlinkOldestFiles\n  unlink old files if [DiskQuota](https://pkg.go.dev/github.com/searKing/golang/go/os#DiskQuota) exceeds. It's usually\n  used for disk clean.\n\n# GoGenerateTools\n\n* [go generate](https://blog.golang.org/generate) is only useful if you have tools to use it with! Here is an incomplete\n  list of useful tools that generate code.\n* [go-syncmap](https://pkg.go.dev/github.com/searKing/golang/tools/go-syncmap) — Generates Go code using a\n  package as a generic template for sync.Map.\n* [go-syncpool](https://pkg.go.dev/github.com/searKing/golang/tools/go-syncpool) — Generates Go code using a\n  package as a generic template for sync.Pool.\n* [go-atomicvalue](https://pkg.go.dev/github.com/searKing/golang/tools/go-atomicvalue) — Generates Go code using\n  a package as a generic template for atomic.Value.\n* [go-option](https://pkg.go.dev/github.com/searKing/golang/tools/go-option) — Generates Go code using a package\n  as a graceful option.\n* [go-nulljson](https://pkg.go.dev/github.com/searKing/golang/tools/go-nulljson) — Generates Go code using a\n  package as a generic template that implements sql.Scanner and sql.Valuer.\n* [go-enum](https://pkg.go.dev/github.com/searKing/golang/tools/go-enum) — Generates Go code using a package as\n  a generic template, which implements interface fmt.Stringer | binary | json | text | sql | yaml for enums.\n* [go-import](https://pkg.go.dev/github.com/searKing/golang/tools/go-import) — Performs auto import of non go\n  files.\n* [go-sqlx](https://pkg.go.dev/github.com/searKing/golang/tools/go-sqlx) — Generates Go code using a package as\n  a generic template that implements sqlx.\n                                                                               ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsearking%2Fgolang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsearking%2Fgolang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsearking%2Fgolang/lists"}