Parcourir la source

change scope for the stream processor property

flashmob il y a 6 ans
Parent
commit
72acc2bb97

+ 1 - 1
backends/s_chunksaver.go

@@ -599,7 +599,7 @@ const chunkMaxBytes = 1024 * 16 // 16Kb is the default, change using chunksaver_
 func Chunksaver() *StreamDecorator {
 
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 
 		func(sp StreamProcessor) StreamProcessor {
 			var (

+ 1 - 1
backends/s_chunksaver_test.go

@@ -155,7 +155,7 @@ func TestChunkSaverWrite(t *testing.T) {
 
 	// add the default processor as the underlying processor for chunksaver
 	// this will also set our Open, Close and Initialize functions
-	stream := chunksaver.p(DefaultStreamProcessor{})
+	stream := chunksaver.P(DefaultStreamProcessor{})
 	// configure the buffer cap
 	bc := BackendConfig{}
 	bc["chunksaver_chunk_size"] = 64

+ 1 - 1
backends/s_compress.go

@@ -15,7 +15,7 @@ func init() {
 
 func StreamCompress() *StreamDecorator {
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 		func(sp StreamProcessor) StreamProcessor {
 			var zw io.WriteCloser
 			sd.Open = func(e *mail.Envelope) error {

+ 1 - 1
backends/s_debug.go

@@ -14,7 +14,7 @@ func init() {
 
 func StreamDebug() *StreamDecorator {
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 
 		func(sp StreamProcessor) StreamProcessor {
 

+ 1 - 1
backends/s_decompress.go

@@ -19,7 +19,7 @@ func init() {
 
 func StreamDecompress() *StreamDecorator {
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 		func(sp StreamProcessor) StreamProcessor {
 			var (
 				zr io.ReadCloser

+ 1 - 1
backends/s_header.go

@@ -72,7 +72,7 @@ func StreamHeader() *StreamDecorator {
 	}))
 
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 
 		func(sp StreamProcessor) StreamProcessor {
 			var sh *streamHeader

+ 1 - 1
backends/s_headers_parser.go

@@ -32,7 +32,7 @@ const stateHeaderNotScanning = 1
 func StreamHeadersParser() *StreamDecorator {
 
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 		func(sp StreamProcessor) StreamProcessor {
 			var (
 				state    byte

+ 1 - 1
backends/s_mime.go

@@ -27,7 +27,7 @@ func init() {
 func StreamMimeAnalyzer() *StreamDecorator {
 
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 
 		func(sp StreamProcessor) StreamProcessor {
 

+ 1 - 1
backends/s_process.go

@@ -15,7 +15,7 @@ func init() {
 // Buffers to envelope.Data so that processors can be called on it at the end
 func StreamProcess() *StreamDecorator {
 	sd := &StreamDecorator{}
-	sd.p =
+	sd.P =
 
 		func(sp StreamProcessor) StreamProcessor {
 			var envelope *mail.Envelope

+ 2 - 2
backends/stream_decorate.go

@@ -10,7 +10,7 @@ type streamCloseWith func() error
 
 // We define what a decorator to our processor will look like
 type StreamDecorator struct {
-	p     func(StreamProcessor) StreamProcessor
+	P     func(StreamProcessor) StreamProcessor
 	e     *mail.Envelope
 	Close streamCloseWith
 	Open  streamOpenWith
@@ -19,7 +19,7 @@ type StreamDecorator struct {
 // DecorateStream will decorate a StreamProcessor with a slice of passed decorators
 func DecorateStream(c StreamProcessor, ds []*StreamDecorator) (StreamProcessor, []*StreamDecorator) {
 	for i := range ds {
-		c = ds[i].p(c)
+		c = ds[i].P(c)
 	}
 	return c, ds
 }