custom-sink

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

Custom Sink Implementation Example

This example shows how to extend the evm-scanner framework by implementing your own Output (Sink) interface. This is useful for sending blockchain events to internal tools, proprietary APIs, or unsupported notification services (like Slack, Discord, or Telegram).

How to Implement a Sink

To create a custom sink, you only need to implement three methods:

type Output interface {
    Name() string
    Send(ctx context.Context, logs []DecodedLog) error
    Close() error
}

How to Run

go run main.go

Why use this?

The framework's SetHandler allows you to write any logic, but implementing the sink.Output interface allows you to reuse your sink across different projects or scanners, and integrate it into a Pipeline (as shown in the multi-sink example).

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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