Giter VIP home page Giter VIP logo

gooru's Introduction

Gooru

Gooru (Guru) 用于存放无聊程序员 Galaxyzeta 造的 golang 轮子。欢迎找出各种 bug 或提交新轮子!

Gooru is a playground. It intends to hold any Golang stuff written by boring programmer Galaxyzeta. Feel free to propose issues and make contributions !

内容简介:

  • algo:算法。

    • compare:
      • comparator:比较器,强行实现了任意基本类型的比较,此外还提供一些常用比较函数。
    • sort:排序算**子。
  • concurrency:并发工具包。

    • async:异步任务。
      • delayedjob:使用基于轮询的 TimerWheel 完成异步任务。存在性能问题,考虑改写后废弃原版。
      • intervaljob:基于 time.Ticker 完成周期性任务。
    • spinLock:自旋锁,直到任务完成,一直非阻塞自旋。
    • semaphore:基于 Mutexchan 分别实现了信号量。
    • goroutine:获得关于 goroutine 的一些信息。
    • synchronizer:
      • aqs:抄了 java AQS,提供了 IAQS 接口,用于实现各种同步容器。
      • reentrantlock:可重入锁,golang 提供的 mutex 是不可重入的。
    • waiter: 对 WaitGroup 的二次封装,用于等待若干个函数的执行完毕。
  • consistenthash:一致性哈希工具包。

  • ds:数据结构包。

    • list
      • singlelinkedlist:单向线程不安全链表。可用作栈或队列,性能比系统提供的 list 要好。
      • doublelinkedlist:双向线程不安全链表。
      • list_interface:提供了List Stack Queue 的接口定义。
      • priority_queue:提供了基于 interface{} 的优先队列,实现了 Queue
    • map
      • hashmap:二次封装的,线程不安全的 map
      • map:提供 Map 接口定义。
      • lru: 提供基于 LRU 淘汰策略的缓存 map
    • tree
      • bst:二叉搜索树,线程不安全,提供了基于 bst 的 BSTMap,保证插入元素的有序性。
    • deprecated:用于研究数据结构原理,但实现不如系统自带的高效。不推荐使用。
      • hashmap:手动实现散列表,使用链地址法解决哈希冲突。性能不如 map
      • safe_hashmap:通过互斥锁实现的线程安全 map,性能比 sync.Map 略差。
  • dp:设计模式。

  • logger:日志打印。

  • framework:手撸各种框架。

    • server:web 服务器
      • simple:手动实现的 web 服务器。简陋。
      • gecko:模仿 Gin 和 Echo 做的 web 服务器,使用路由树。
    • ioc:简陋的依赖注入框架,可以循环依赖。
    • cache:缓存框架
      • gocaching:一个非常简单的分布式缓存框架,参考 GroupCache。重在学习一致性哈希。
  • test:滚轮子测试。

  • tutorial:入门 golang。

  • util:工具。

    • common:一些缩写和转化工具。
    • alias:一些函数的缩写。例如 P1Consumer 表示一个入参的无返回值函数。
    • benchmark:用于效率测试。
    • assert:断言工具,断言失败会导致 panic

一些大胆想法:

  • 实现一个 Stream 操纵任何切片进行变形。因为 golang 的流式编程确实是缺乏。
  • 把 python enumerate 和 zip 等函数抄过来。

gooru's People

Contributors

galaxyzeta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.