✨Super-fast and easy data transforming with any interfaces

BELT

Super-fast and easy data transforming with any interfaces

Just connect Belt to your Factory

Methods

  • Transform data
    • Map
    • Filter
  • Assistance
    • Pipe
    • Append
  • Load data
    • FromHttp
    • FromQuery
  • Initialize and build
    • NewFactory
    • Build
  • Debug
    • ListItems
    • Type

Getting Started

  • Initialize Factory with sync option
    // true: with go sync, false: without go sync
    option := FactoryOptions{true}
    items = NewFactory(items, option)
    • or use FromHttp to load data from http request
      type Commit struct {
          Commits  int    `json:"commits"`
          Date     string `json:"date"`
          Day      int    `json:"day"`
          Month    int    `json:"month"`
          Week     int    `json:"week"`
          LastWeek bool   `json:"lastWeek"`
          LastDay  bool   `json:"lastDay"`
      }
      func example() {
          url := "https://gw.alipayobjects.com/os/antvdemo/assets/data/github-commit.json"
          output := Commit{}
          items := NewFactory([]I{}, FactoryOptions{false}).FromHttp(url, output)
      }
    • or use FromQuery to load data from MySQL database
      type User struct {
          id          int
          email       string
      }
      func example(){
          dbSource := "USER/PASSWORD@tcp(HOST:PORT)/DATABASE"
          query := "select id, email from user where isDeleted = ?"
          output := User{}
          items := NewFactory([]I{}, FactoryOptions{false}).FromQuery(dbSource, output, query, 0)
      }
  • Transform data and build result
    • create functions for transforming data
      15 { return true, nil } return false, nil } func printLen(items []I) error { fmt.Println(len(items)) return nil }">
      func map1(item I, idx int) (I, error) {
          p := item.(Parent)
          time.Sleep(1 * time.Millisecond)
          return Parent{
              id:   p.id + idx,
              name: p.name,
          }, nil
      }
      func map2(item I, idx int) (I, error) {
          p := item.(Parent)
          return Child{
              p,
              "Hello",
          }, nil
      }
      func filter1(item I, _ int) (bool, error) {
          i := item.(Child)
          if i.id > 15 {
              return true, nil
          }
          return false, nil
      }
      func printLen(items []I) error {
          fmt.Println(len(items))
          return nil
      }
    • connect Belts to Factory and build
      func example(){
          items = NewFactory(items, option).Map(map1).Map(map2).Filter(filter1).Append(newChild).Pipe(printLen).Build()
      }

License

© Zini, Released under the MIT License

Owner
Jeon Jin Heo
재밌는거 하고살자
Jeon Jin Heo
Similar Resources

Send and receive files securely through Tor.

Send and receive files securely through Tor.

onionbox A basic implementation of OnionShare in Go. Mostly built as a fun project, onionbox is still a WIP so usage is not guaranteed secure, yet. Ke

Nov 22, 2022

Wormhole-gui is a cross-platform application that lets you easily share files, folders and text between devices.

Wormhole-gui is a cross-platform application that lets you easily share files, folders and text between devices.

Cross-platform application for easy encrypted sharing of files, folders, and text between devices.

Dec 30, 2022

Distributed File Store Application Consist of API Server to handle file operations and command line tool to do operations

Filestore Distributed File Store Application Consist of API Server to handle file operations and command line tool to do operations (store named binar

Nov 7, 2021

aqua is a simple file uploading and sharing server for personal use.

aqua is a simple file uploading and sharing server for personal use.

aqua is a simple file uploading and sharing server for personal use. It is built to be easy to set up and host on your own server, for example to use it in combination with uploading tools like ShareX.

Jul 7, 2022

Handshake Query is a cross-platform library to trustlessly resolve and verify Handshake names using a p2p light client

Handshake Query ⚠️ Usage of this library is not currently recommended in your application as the API will likely change. Handshake Query is a cross-pl

Dec 22, 2022

Transfer - A simple go application for uploading, downloading and checksumming of files

Transfer This project holds a simple go application for uploading, downloading a

Aug 18, 2022

garlicshare is an open source tool that lets you securely and anonymously share files on a hosted onion service using the Tor network.

garlicshare is an open source tool that lets you securely and anonymously share files on a hosted onion service using the Tor network.

garlicshare is an open source tool that lets you securely and anonymously share files on a hosted onion service using the Tor network.

Dec 22, 2022

Simple temporary file upload and transfer web application coding with Go language.

Temp File Transfer Web Application Simple temporary file upload and transfer web application coding with Go language. Explore the Golang » Live Demo T

Dec 2, 2022

🖥 Securely transfer and send anything between computers with TUI.

🖥 Securely transfer and send anything between computers with TUI.

🖥️ Securely transfer and send anything between computers with TUI. Installation ways

Dec 21, 2022
Easy and fast file sharing from the command-line.

Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance.

Jan 2, 2023
Golang PoC software for reliable file transfers over a data diode. DIY gigabit data diode hardware instructions
Golang PoC software for reliable file transfers over a data diode. DIY gigabit data diode hardware instructions

DIY Data Diode Simple DIY gigabit data diode (hardware and software). Presented at SEC-T 2021. Hardware By doing a simple hardware mod to a fiber conv

Dec 1, 2022
oDrop, a fast efficient cross-platform file transfer software for server and home environments

oDrop is a cross-platform LAN file transfer software to efficiently transfer files between computers, oDrop is useful in environments where GUI is not available.

Jun 4, 2022
An experimental project to build a framework for naming and sharing files and other data securely
An experimental project to build a framework for naming and sharing files and other data securely

Upspin Documentation: upspin.io About the project Upspin is an experimental project to build a framework for naming and sharing files and other data s

Oct 20, 2021
Yet another netcat for fast file transfer

nyan Yet another netcat for fast file transfer When I need to transfer a file in safe environment (e.g. LAN / VMs), I just want to use a simple comman

Apr 30, 2022
proxyd proxies data between TCP, TLS, and unix sockets

proxyd proxyd proxies data between TCP, TLS, and unix sockets TLS termination: Connecting to a remote application's unix socket: +---------+

Nov 9, 2022
pcp - 📦 Command line peer-to-peer data transfer tool based on libp2p.
pcp - 📦 Command line peer-to-peer data transfer tool based on libp2p.

pcp - Command line peer-to-peer data transfer tool based on libp2p.

Jan 5, 2023
🌧 BitTorrent client and library in Go
🌧 BitTorrent client and library in Go

rain BitTorrent client and library in Go. Running in production at put.io. Features Core protocol Fast extension Magnet links Multiple trackers UDP tr

Jan 5, 2023
JuiceFS is a distributed POSIX file system built on top of Redis and S3.
JuiceFS is a distributed POSIX file system built on top of Redis and S3.

JuiceFS is an open-source POSIX file system built on top of Redis and object storage

Jan 5, 2023
A web based drag and drop file transfer tool for sending files across the internet.

DnD A file transfer tool. Demo Usage Get go get github.com/0xcaff/dnd or download the latest release (you don't need go to run it) Run dnd Now navig

Dec 16, 2022