os

package
v0.0.0-...-5012a73 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const FileCAP = 10

FileCAP is the capacity of the buffered proxy channel

View Source
const FileInfoCAP = 10

FileInfoCAP is the capacity of the buffered proxy channel

View Source
const FileInfoQUE = 16

FileInfoQUE is the allocated size of the circular queue

View Source
const FileQUE = 16

FileQUE is the allocated size of the circular queue

View Source
const SignalCAP = 10

SignalCAP is the capacity of the buffered proxy channel

View Source
const SignalQUE = 16

SignalQUE is the allocated size of the circular queue

Variables

This section is empty.

Functions

func ChanFile

func ChanFile(inp ...*os.File) (out <-chan *os.File)

ChanFile returns a channel to receive all inputs before close.

func ChanFileFuncErr

func ChanFileFuncErr(act func() (*os.File, error)) (out <-chan *os.File)

ChanFileFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanFileFuncNok

func ChanFileFuncNok(act func() (*os.File, bool)) (out <-chan *os.File)

ChanFileFuncNok returns a channel to receive all results of act until nok before close.

func ChanFileInfo

func ChanFileInfo(inp ...os.FileInfo) (out <-chan os.FileInfo)

ChanFileInfo returns a channel to receive all inputs before close.

func ChanFileInfoFuncErr

func ChanFileInfoFuncErr(act func() (os.FileInfo, error)) (out <-chan os.FileInfo)

ChanFileInfoFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanFileInfoFuncNok

func ChanFileInfoFuncNok(act func() (os.FileInfo, bool)) (out <-chan os.FileInfo)

ChanFileInfoFuncNok returns a channel to receive all results of act until nok before close.

func ChanFileInfoSlice

func ChanFileInfoSlice(inp ...[]os.FileInfo) (out <-chan os.FileInfo)

ChanFileInfoSlice returns a channel to receive all inputs before close.

func ChanFileSlice

func ChanFileSlice(inp ...[]*os.File) (out <-chan *os.File)

ChanFileSlice returns a channel to receive all inputs before close.

func ChanSignal

func ChanSignal(inp ...os.Signal) (out <-chan os.Signal)

ChanSignal returns a channel to receive all inputs before close.

func ChanSignalFuncErr

func ChanSignalFuncErr(act func() (os.Signal, error)) (out <-chan os.Signal)

ChanSignalFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanSignalFuncNok

func ChanSignalFuncNok(act func() (os.Signal, bool)) (out <-chan os.Signal)

ChanSignalFuncNok returns a channel to receive all results of act until nok before close.

func ChanSignalSlice

func ChanSignalSlice(inp ...[]os.Signal) (out <-chan os.Signal)

ChanSignalSlice returns a channel to receive all inputs before close.

func DoneFile

func DoneFile(inp <-chan *os.File) (done <-chan struct{})

DoneFile returns a channel to receive one signal before close after inp has been drained.

func DoneFileFunc

func DoneFileFunc(inp <-chan *os.File, act func(a *os.File)) (out <-chan struct{})

DoneFileFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneFileInfo

func DoneFileInfo(inp <-chan os.FileInfo) (done <-chan struct{})

DoneFileInfo returns a channel to receive one signal before close after inp has been drained.

func DoneFileInfoFunc

func DoneFileInfoFunc(inp <-chan os.FileInfo, act func(a os.FileInfo)) (out <-chan struct{})

DoneFileInfoFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneFileInfoSlice

func DoneFileInfoSlice(inp <-chan os.FileInfo) (done <-chan []os.FileInfo)

DoneFileInfoSlice returns a channel which will receive a slice of all the FileInfos received on inp channel before close. Unlike DoneFileInfo, a full slice is sent once, not just an event.

func DoneFileSlice

func DoneFileSlice(inp <-chan *os.File) (done <-chan []*os.File)

DoneFileSlice returns a channel which will receive a slice of all the Files received on inp channel before close. Unlike DoneFile, a full slice is sent once, not just an event.

func DoneSignal

func DoneSignal(inp <-chan os.Signal) (done <-chan struct{})

DoneSignal returns a channel to receive one signal before close after inp has been drained.

func DoneSignalFunc

func DoneSignalFunc(inp <-chan os.Signal, act func(a os.Signal)) (out <-chan struct{})

DoneSignalFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneSignalSlice

func DoneSignalSlice(inp <-chan os.Signal) (done <-chan []os.Signal)

DoneSignalSlice returns a channel which will receive a slice of all the Signals received on inp channel before close. Unlike DoneSignal, a full slice is sent once, not just an event.

func FileDaisy

func FileDaisy(inp <-chan *os.File, tube FileTube) (out <-chan *os.File)

FileDaisy returns a channel to receive all inp after having passed thru tube.

func FileDaisyChain

func FileDaisyChain(inp <-chan *os.File, tubes ...FileTube) (out <-chan *os.File)

FileDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func FileInfoDaisy

func FileInfoDaisy(inp <-chan os.FileInfo, tube FileInfoTube) (out <-chan os.FileInfo)

FileInfoDaisy returns a channel to receive all inp after having passed thru tube.

func FileInfoDaisyChain

func FileInfoDaisyChain(inp <-chan os.FileInfo, tubes ...FileInfoTube) (out <-chan os.FileInfo)

FileInfoDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func JoinFile

func JoinFile(out chan<- *os.File, inp ...*os.File) (done <-chan struct{})

JoinFile sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinFileChan

func JoinFileChan(out chan<- *os.File, inp <-chan *os.File) (done <-chan struct{})

JoinFileChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinFileInfo

func JoinFileInfo(out chan<- os.FileInfo, inp ...os.FileInfo) (done <-chan struct{})

JoinFileInfo sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinFileInfoChan

func JoinFileInfoChan(out chan<- os.FileInfo, inp <-chan os.FileInfo) (done <-chan struct{})

JoinFileInfoChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinFileInfoSlice

func JoinFileInfoSlice(out chan<- os.FileInfo, inp ...[]os.FileInfo) (done <-chan struct{})

JoinFileInfoSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinFileSlice

func JoinFileSlice(out chan<- *os.File, inp ...[]*os.File) (done <-chan struct{})

JoinFileSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinSignal

func JoinSignal(out chan<- os.Signal, inp ...os.Signal) (done <-chan struct{})

JoinSignal sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinSignalChan

func JoinSignalChan(out chan<- os.Signal, inp <-chan os.Signal) (done <-chan struct{})

JoinSignalChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinSignalSlice

func JoinSignalSlice(out chan<- os.Signal, inp ...[]os.Signal) (done <-chan struct{})

JoinSignalSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func MakeFileChan

func MakeFileChan() (out chan *os.File)

MakeFileChan returns a new open channel (simply a 'chan *os.File' that is).

Note: No 'File-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var myFilePipelineStartsHere := MakeFileChan()
// ... lot's of code to design and build Your favourite "myFileWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	myFilePipelineStartsHere <- drop
}
close(myFilePipelineStartsHere)

Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)

Note: as always (except for PipeFileBuffer) the channel is unbuffered.

func MakeFileInfoChan

func MakeFileInfoChan() (out chan os.FileInfo)

MakeFileInfoChan returns a new open channel (simply a 'chan os.FileInfo' that is).

Note: No 'FileInfo-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var myFileInfoPipelineStartsHere := MakeFileInfoChan()
// ... lot's of code to design and build Your favourite "myFileInfoWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	myFileInfoPipelineStartsHere <- drop
}
close(myFileInfoPipelineStartsHere)

Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)

Note: as always (except for PipeFileInfoBuffer) the channel is unbuffered.

func MakeSignalChan

func MakeSignalChan() (out chan os.Signal)

MakeSignalChan returns a new open channel (simply a 'chan os.Signal' that is).

Note: No 'Signal-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var mySignalPipelineStartsHere := MakeSignalChan()
// ... lot's of code to design and build Your favourite "mySignalWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	mySignalPipelineStartsHere <- drop
}
close(mySignalPipelineStartsHere)

Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)

Note: as always (except for PipeSignalBuffer) the channel is unbuffered.

func PipeFileBuffer

func PipeFileBuffer(inp <-chan *os.File, cap int) (out <-chan *os.File)

PipeFileBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeFileFork

func PipeFileFork(inp <-chan *os.File) (out1, out2 <-chan *os.File)

PipeFileFork returns two channels to receive every result of inp before close.

Note: Yes, it is a VERY simple fanout - but sometimes all You need.

func PipeFileFunc

func PipeFileFunc(inp <-chan *os.File, act func(a *os.File) *os.File) (out <-chan *os.File)

PipeFileFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeFileMap for functional people, but 'map' has a very different meaning in go lang.

func PipeFileInfoBuffer

func PipeFileInfoBuffer(inp <-chan os.FileInfo, cap int) (out <-chan os.FileInfo)

PipeFileInfoBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeFileInfoFork

func PipeFileInfoFork(inp <-chan os.FileInfo) (out1, out2 <-chan os.FileInfo)

PipeFileInfoFork returns two channels to receive every result of inp before close.

Note: Yes, it is a VERY simple fanout - but sometimes all You need.

func PipeFileInfoFunc

func PipeFileInfoFunc(inp <-chan os.FileInfo, act func(a os.FileInfo) os.FileInfo) (out <-chan os.FileInfo)

PipeFileInfoFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeFileInfoMap for functional people, but 'map' has a very different meaning in go lang.

func PipeSignalBuffer

func PipeSignalBuffer(inp <-chan os.Signal, cap int) (out <-chan os.Signal)

PipeSignalBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeSignalFork

func PipeSignalFork(inp <-chan os.Signal) (out1, out2 <-chan os.Signal)

PipeSignalFork returns two channels to receive every result of inp before close.

Note: Yes, it is a VERY simple fanout - but sometimes all You need.

func PipeSignalFunc

func PipeSignalFunc(inp <-chan os.Signal, act func(a os.Signal) os.Signal) (out <-chan os.Signal)

PipeSignalFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeSignalMap for functional people, but 'map' has a very different meaning in go lang.

func SendProxyFile

func SendProxyFile(out chan<- *os.File) chan<- *os.File

SendProxyFile returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.

Note: the expanding buffer is implemented via "container/ring"

func SendProxyFileInfo

func SendProxyFileInfo(out chan<- os.FileInfo) chan<- os.FileInfo

SendProxyFileInfo returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.

Note: the expanding buffer is implemented via "container/ring"

func SendProxySignal

func SendProxySignal(out chan<- os.Signal) chan<- os.Signal

SendProxySignal returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.

Note: the expanding buffer is implemented via "container/ring"

func SignalDaisy

func SignalDaisy(inp <-chan os.Signal, tube SignalTube) (out <-chan os.Signal)

SignalDaisy returns a channel to receive all inp after having passed thru tube.

func SignalDaisyChain

func SignalDaisyChain(inp <-chan os.Signal, tubes ...SignalTube) (out <-chan os.Signal)

SignalDaisyChain returns a channel to receive all inp after having passed thru all tubes.

Types

type FileInfoTube

type FileInfoTube func(inp <-chan os.FileInfo, out <-chan os.FileInfo)

FileInfoTube is the signature for a pipe function.

type FileTube

type FileTube func(inp <-chan *os.File, out <-chan *os.File)

FileTube is the signature for a pipe function.

type SignalTube

type SignalTube func(inp <-chan os.Signal, out <-chan os.Signal)

SignalTube is the signature for a pipe function.

Jump to

Keyboard shortcuts

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