go_dynamodb_stream_subscriber

package module
v0.0.0-...-562fe6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 0 Imported by: 0

README

go-dynamodb-stream-subscriber

Go channel for streaming Dynamodb Updates


import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/dynamodbstreams"
	"github.com/urakozz/go-dynamodb-stream-subscriber/stream"
)
func main(){
  cfg := aws.NewConfig().WithRegion("eu-west-1")
  sess := session.New()
  streamSvc := dynamodbstreams.New(sess, cfg)
  dynamoSvc := dynamodb.New(sess, cfg)
  table := "tableName"
  
  streamSubscriber := stream.NewStreamSubscriber(dynamoSvc, streamSvc, table)
  ch , errCh :=  streamProvider.GetStreamDataAsync()
  
  go func(ch <- chan *dynamodbstreams.Record){
  	for record := range ch {
  		fmt.Println("from channel:", record)
  	}
  }(ch)
  go func(errCh <- chan error){
  	for err := range errCh {
  		fmt.Println("Stream Subscriber error: ", err)
  	}
  }(errCh)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Yury Kozyrev (urakozz) MIT License
Yury Kozyrev (urakozz) MIT License

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL