github.com/Jeffail/benthos/v3@v3.65.0/lib/output/drop.go (about)

     1  package output
     2  
     3  import (
     4  	"github.com/Jeffail/benthos/v3/internal/docs"
     5  	"github.com/Jeffail/benthos/v3/lib/log"
     6  	"github.com/Jeffail/benthos/v3/lib/metrics"
     7  	"github.com/Jeffail/benthos/v3/lib/output/writer"
     8  	"github.com/Jeffail/benthos/v3/lib/types"
     9  )
    10  
    11  //------------------------------------------------------------------------------
    12  
    13  func init() {
    14  	Constructors[TypeDrop] = TypeSpec{
    15  		constructor: fromSimpleConstructor(NewDrop),
    16  		Summary: `
    17  Drops all messages.`,
    18  		Categories: []Category{
    19  			CategoryUtility,
    20  		},
    21  		config: docs.FieldComponent().HasType(docs.FieldTypeObject),
    22  	}
    23  }
    24  
    25  //------------------------------------------------------------------------------
    26  
    27  // NewDrop creates a new Drop output type.
    28  func NewDrop(conf Config, mgr types.Manager, log log.Modular, stats metrics.Type) (Type, error) {
    29  	return NewWriter(
    30  		TypeDrop, writer.NewDrop(conf.Drop, log, stats), log, stats,
    31  	)
    32  }
    33  
    34  //------------------------------------------------------------------------------