Documentation ¶
Index ¶
- Variables
- func MakeAMQPWriter(config map[string]interface{}) (kodex.Writer, error)
- func MakeBytesWriter(config map[string]interface{}) (kodex.Writer, error)
- func MakeCountWriter(config map[string]interface{}) (kodex.Writer, error)
- func MakeFileWriter(config map[string]interface{}) (kodex.Writer, error)
- func MakeHTTPWriter(config map[string]interface{}) (kodex.Writer, error)
- func MakeInMemoryWriter(params map[string]interface{}) (kodex.Writer, error)
- func MakeStdoutWriter(params map[string]interface{}) (kodex.Writer, error)
- type AMQPBase
- type AMQPWriter
- type BytesWriter
- type CountWriter
- type FileWriter
- type HTTPWriter
- type InMemoryWriter
- type StdoutWriter
- type TopicExchangeChosen
Constants ¶
This section is empty.
Variables ¶
View Source
var AMQPBaseForm = forms.Form{ ErrorMsg: "invalid data encountered in the AMQP form", Fields: []forms.Field{ { Name: "format", Validators: []forms.Validator{ forms.IsOptional{Default: "json"}, forms.IsIn{Choices: []interface{}{"json"}}, }, }, { Name: "compress", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsBoolean{}, }, }, { Name: "queue", Validators: []forms.Validator{ forms.IsString{}, }, }, { Name: "routing_key", Validators: []forms.Validator{ forms.IsString{}, }, }, { Name: "exchange", Validators: []forms.Validator{ forms.IsString{}, }, }, { Name: "exchange_type", Validators: []forms.Validator{ forms.IsIn{Choices: []interface{}{"fanout", "direct", "topic"}}, }, }, { Name: "queue_expires_after_ms", Validators: []forms.Validator{ forms.IsOptional{Default: int64(0)}, forms.IsInteger{HasMin: true, Min: 0}, }, }, { Name: "url", Validators: []forms.Validator{ forms.IsString{}, }, }, }, }
View Source
var AMQPWriterForm = forms.Form{ ErrorMsg: "invalid data encountered in the AMQP writer form", Fields: append([]forms.Field{ { Name: "confirmation_timeout", Validators: []forms.Validator{ forms.IsOptional{Default: 1.0}, forms.IsFloat{Convert: false}, }, }, }, AMQPBaseForm.Fields...), }
View Source
var BytesWriterForm = forms.Form{ ErrorMsg: "invalid data encountered in the bytes writer form", Fields: []forms.Field{ { Name: "format", Validators: []forms.Validator{ forms.IsIn{Choices: []interface{}{"json"}}, }, }, { Name: "compress", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsBoolean{}, }, }, }, }
View Source
var CountWriterForm = forms.Form{ ErrorMsg: "invalid data encountered in the count writer form", Fields: []forms.Field{ { Name: "max", Validators: []forms.Validator{ forms.IsOptional{Default: 10}, forms.IsInteger{HasMin: true, Min: 0, HasMax: true, Max: 100}, }, }, }, }
View Source
var FileWriterForm = forms.Form{ ErrorMsg: "invalid data encountered in the file writer form", Fields: []forms.Field{ { Name: "path", Validators: []forms.Validator{ forms.IsOptional{Default: ""}, forms.IsString{}, }, }, { Name: "base-name", Validators: []forms.Validator{ forms.IsRequired{}, forms.IsString{}, }, }, { Name: "format", Validators: []forms.Validator{ forms.IsOptional{Default: "json"}, forms.IsIn{Choices: []interface{}{"json", "csv"}}, }, }, { Name: "compress", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsBoolean{}, }, }, { Name: "add-time", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsBoolean{}, }, }, }, }
View Source
var HTTPWriterForm = forms.Form{ ErrorMsg: "invalid data encountered in the HTTP writer form", Fields: []forms.Field{ { Name: "format", Validators: []forms.Validator{ forms.IsIn{Choices: []interface{}{"json"}}, }, }, { Name: "url", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsString{}, }, }, { Name: "headers", Validators: []forms.Validator{ forms.IsOptional{Default: false}, forms.IsStringMap{ Form: &forms.Form{ Fields: []forms.Field{ { Name: "*", Validators: []forms.Validator{ forms.IsString{}, }, }, }, }, }, }, }, }, }
View Source
var Writers = kodex.WriterDefinitions{ "file": kodex.WriterDefinition{ Maker: MakeFileWriter, Form: FileWriterForm, Internal: true, }, "http": kodex.WriterDefinition{ Maker: MakeHTTPWriter, Form: HTTPWriterForm, }, "bytes": kodex.WriterDefinition{ Maker: MakeBytesWriter, Form: BytesWriterForm, Internal: true, }, "in-memory": kodex.WriterDefinition{ Maker: MakeInMemoryWriter, Internal: true, }, "stdout": kodex.WriterDefinition{ Maker: MakeStdoutWriter, Internal: true, }, "amqp": kodex.WriterDefinition{ Maker: MakeAMQPWriter, Form: AMQPWriterForm, Internal: false, }, "count": kodex.WriterDefinition{ Maker: MakeCountWriter, Form: CountWriterForm, Internal: true, }, }
Functions ¶
func MakeInMemoryWriter ¶
Types ¶
type AMQPBase ¶
type AMQPBase struct { Connection *amqp.Connection Channel *amqp.Channel Queue amqp.Queue QueueExpiresAfterMs int64 URL string Format string Compress bool QueueName string RoutingKey string BaseRoutingKey string BaseQueueName string Exchange string ExchangeType string Model kodex.Model }
func MakeAMQPBase ¶
type AMQPWriter ¶
type AMQPWriter struct { ConfirmationTimeout float64 Confirmations chan amqp.Confirmation AMQPBase }
func (*AMQPWriter) SetupWithModel ¶
func (a *AMQPWriter) SetupWithModel(model kodex.Model) error
type BytesWriter ¶
type BytesWriter struct { Output []byte Format string Compress bool // contains filtered or unexported fields }
func (*BytesWriter) Teardown ¶
func (s *BytesWriter) Teardown() error
type CountWriter ¶
type CountWriter struct {
// contains filtered or unexported fields
}
func (*CountWriter) Count ¶
func (s *CountWriter) Count() int64
func (*CountWriter) LastItems ¶
func (s *CountWriter) LastItems() []map[string]interface{}
func (*CountWriter) Teardown ¶
func (s *CountWriter) Teardown() error
type FileWriter ¶
type FileWriter struct { BasePath string Name string Format string Compress bool AddTime bool // contains filtered or unexported fields }
func (*FileWriter) Teardown ¶
func (s *FileWriter) Teardown() error
type HTTPWriter ¶
type HTTPWriter struct { Format string URL string Config kodex.Config Headers map[string]interface{} }
func (*HTTPWriter) Teardown ¶
func (s *HTTPWriter) Teardown() error
type InMemoryWriter ¶
type InMemoryWriter struct {
// contains filtered or unexported fields
}
func (*InMemoryWriter) Result ¶
func (s *InMemoryWriter) Result() []map[string]interface{}
func (*InMemoryWriter) Teardown ¶
func (s *InMemoryWriter) Teardown() error
type StdoutWriter ¶
type StdoutWriter struct { }
func (*StdoutWriter) Teardown ¶
func (s *StdoutWriter) Teardown() error
type TopicExchangeChosen ¶
type TopicExchangeChosen struct{}
func (TopicExchangeChosen) Validate ¶
func (t TopicExchangeChosen) Validate(value interface{}, values map[string]interface{}) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.