# rxgo **Repository Path**: yin-rui-2000/rxgo ## Basic Information - **Project Name**: rxgo - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-10-29 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Rxgo [![Badge](https://camo.githubusercontent.com/fce1dafb36f344f3caac8b9d6be435ba810e36ab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b2d3939362e6963752d2532334646344435422e7376673f7374796c653d666c61742d737175617265)](https://996.icu/#/en_US) [![LICENSE](https://camo.githubusercontent.com/a72e7743f15db219a6aba534f9de456e86268dd6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d416e74692532303939362d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/996icu/996.ICU/blob/master/LICENSE) [![Slack](https://camo.githubusercontent.com/ce1c0a467b6f4bebada87457a2e767eeb28f586c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736c61636b2d3939366963752d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://join.slack.com/t/996icu/shared_invite/enQtNjI0MjEzMTUxNDI0LTkyMGViNmJiZjYwOWVlNzQ3NmQ4NTQyMDRiZTNmOWFkMzYxZWNmZGI0NDA4MWIwOGVhOThhMzc3NGQyMDBhZDc) [![HitCount](https://camo.githubusercontent.com/a84c5e110399056a137db398775bd565e802bbba/687474703a2f2f686974732e6477796c2e696f2f3939366963752f3939362e4943552e737667)](http://hits.dwyl.io/996icu/996.ICU) Package `rxgo` 提供`go`语言中一致的编程接口,帮助开发者更方便的处理异步数据流 ## Features - function program friendly - Connectable observables, support Hot or Cold item emiting - context support for concurrency - support error type data in observable sequences - internal debug support - unsubscribe supporting - non-opinionated about source of concurrency - async or synchronous execution - 新添加filter操作 ## Requirements - go 1.15 - Windows / Linux(Unix like) ## Installation 下载此包,以便在GO中使用: ```powershell $ go get gitee.com/yin-rui-2000/rxgo ``` ## Usage Go代码中导入此包 ```go import "gitee.com/yin-rui-2000/rxgo" ``` ### 对象序列化 使用`func JsonMarshal(v interface{}) ([]byte, error)`函数将任意数据结构`v interface{}`转换为`Json`格式的序列: ```go bytes, _ := JsonMarshal(myStruct) fmt.Println(string(bytes)) ``` 例如,我们序列化一个自定义的`ColorGroup`数据结构: ```go package main import ( "fmt" RxGo "gitee.com/yin-rui-2000/rxgo" ) func main() { //define pipeline source := RxGo.Just("Hello", "World", "!") next := source.Map(func(s string) string { return s + " " }).ElementAt(2) next.Subscribe(func(x string) { fmt.Print(x) }) } ``` 运行程序可以得到以下结果: ```powershell $ go run main.go World ``` ## License This project is under Mulan PSL v1 License. See the [LICENSE](https://gitee.com/yin-rui-2000/rxgo/blob/master/LICENSE) file for the full license text.