Skip to content

0SkillAllLuck/dynostream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynostream

Easy to use Stream Subscriber for DynamoDB

Usage

package main

import (
	"context"
	"log"

	"github.com/0skillallluck/dynostream"
	"github.com/aws/aws-sdk-go/aws/session"
)

func main() {
	// Create a new AWS session
	sess := session.New()

	// Create a new DynoStream
	stream := dynostream.NewFromSession(sess, "my-table")

	// Create a new context for the subscription
	ctx := context.Background()

	// Subscribe to the stream
	channel, errorChannel := stream.Subscribe(ctx)

	// Handle errors
	go func(errCh <-chan error) {
		for err := range errCh {
			log.Println("Error: ", err)
		}
	}(errorChannel)

	// Handle records
	for record := range channel {
		log.Println("Record:", record)
	}
}

About

Easy to use Stream Subscriber for DynamoDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages