Skip to content

itsubaki/gostream

Repository files navigation

gostream

PkgGoDev Go Report Card tests

Stream Processing library for Go

TODO

  • Window
    • LengthWindow
    • LengthBatchWindow
    • TimeWindow
    • TimeBatchWindow
  • Select
  • Where
    • Equals, NotEquals
    • Larger, Less
    • AND, OR
  • OrderBy
  • Limit, Offset
  • Aggregate Function
    • Avg, Sum, Count
    • Max, Min

Example

type LogEvent struct {
  Time    time.Time
  Level   int
  Message string
}

q := "select * from LogEvent.length(10)"
s, err := gostream.New().
    Add(LogEvent{}).
    Query(q)
if err != nil {
  fmt.Printf("new gostream: %v", err)
  return
}
defer s.Close()

go func() {
  for {
    fmt.Printf("%v\n", <-s.Output())
  }
}()

s.Input() <- LogEvent{
  Time: time.Now()
  Level: 1
  Message: "something happened"
}
type LogEvent struct {
  Time    time.Time
  Level   int
  Message string
}

s := stream.New().
  SelectAll().
  From(LogEvent{}).
  Length(10).
  OrderBy("Level", stream.DESC).
  Limit(10, 5)
defer s.Close()
go s.Run()

go func() {
  for {
    fmt.Printf("%v\n", <-s.Output())
  }
}()

s.Input() <- LogEvent{
  Time: time.Now()
  Level: 1
  Message: "something happened"
}

About

Stream Processing library for Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy