github.com/Jeffail/benthos/v3@v3.65.0/lib/input/reader/kinesis_balanced_wasm.go (about)

     1  //go:build wasm
     2  // +build wasm
     3  
     4  package reader
     5  
     6  import (
     7  	"context"
     8  	"errors"
     9  	"time"
    10  
    11  	"github.com/Jeffail/benthos/v3/lib/log"
    12  	"github.com/Jeffail/benthos/v3/lib/message/batch"
    13  	"github.com/Jeffail/benthos/v3/lib/metrics"
    14  	"github.com/Jeffail/benthos/v3/lib/types"
    15  )
    16  
    17  //------------------------------------------------------------------------------
    18  
    19  var errNoWASM = errors.New("component not supported in WASM builds")
    20  
    21  // KinesisBalancedConfig is configuration values for the input type.
    22  type KinesisBalancedConfig struct {
    23  	MaxBatchCount int                `json:"max_batch_count" yaml:"max_batch_count"`
    24  	Batching      batch.PolicyConfig `json:"batching" yaml:"batching"`
    25  }
    26  
    27  // NewKinesisBalancedConfig creates a new Config with default values.
    28  func NewKinesisBalancedConfig() KinesisBalancedConfig {
    29  	return KinesisBalancedConfig{}
    30  }
    31  
    32  // KinesisBalanced is a benthos reader.Type implementation that reads messages
    33  // from an Amazon Kinesis stream.
    34  type KinesisBalanced struct{}
    35  
    36  // NewKinesisBalanced creates a new Amazon Kinesis stream reader.Type.
    37  func NewKinesisBalanced(
    38  	conf KinesisBalancedConfig,
    39  	log log.Modular,
    40  	stats metrics.Type,
    41  ) (*KinesisBalanced, error) {
    42  	return nil, errNoWASM
    43  }
    44  
    45  // Connect attempts to establish a connection to the target Kinesis stream.
    46  func (k *KinesisBalanced) Connect() error {
    47  	return errNoWASM
    48  }
    49  
    50  // ConnectWithContext attempts to establish a connection to the target Kinesis
    51  // stream.
    52  func (k *KinesisBalanced) ConnectWithContext(ctx context.Context) error {
    53  	return errNoWASM
    54  }
    55  
    56  // ReadWithContext attempts to read a new message from the target Kinesis
    57  // stream.
    58  func (k *KinesisBalanced) ReadWithContext(ctx context.Context) (types.Message, AsyncAckFn, error) {
    59  	return nil, nil, errNoWASM
    60  }
    61  
    62  // Read attempts to read a new message from the target Kinesis stream.
    63  func (k *KinesisBalanced) Read() (types.Message, error) {
    64  	return nil, errNoWASM
    65  }
    66  
    67  // Acknowledge confirms whether or not our unacknowledged messages have been
    68  // successfully propagated or not.
    69  func (k *KinesisBalanced) Acknowledge(err error) error {
    70  	return errNoWASM
    71  }
    72  
    73  // CloseAsync begins cleaning up resources used by this reader asynchronously.
    74  func (k *KinesisBalanced) CloseAsync() {
    75  }
    76  
    77  // WaitForClose will block until either the reader is closed or a specified
    78  // timeout occurs.
    79  func (k *KinesisBalanced) WaitForClose(time.Duration) error {
    80  	return errNoWASM
    81  }
    82  
    83  //------------------------------------------------------------------------------