Documentation
¶
Index ¶
- Variables
- func ReadAll[R io.ReadCloser](acquire IOE.IOEither[error, R]) IOE.IOEither[error, []byte]
- func Remove(name string) IOE.IOEither[error, string]
- func WithTempFile[A any](f func(*os.File) IOE.IOEither[error, A]) IOE.IOEither[error, A]
- func Write[R any, W io.WriteCloser](acquire IOE.IOEither[error, W]) func(use func(W) IOE.IOEither[error, R]) IOE.IOEither[error, R]
- func WriteAll[W io.WriteCloser](data []byte) func(acquire IOE.IOEither[error, W]) IOE.IOEither[error, []byte]
- func WriteFile(dstName string, perm os.FileMode) func([]byte) IOE.IOEither[error, []byte]
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Open opens a file for reading Open = IOE.Eitherize1(os.Open) // Create opens a file for writing Create = IOE.Eitherize1(os.Create) // ReadFile reads the context of a file ReadFile = IOE.Eitherize1(os.ReadFile) )
View Source
var ( // CreateTemp created a temp file with proper parametrization CreateTemp = IOE.Eitherize2(os.CreateTemp) )
Functions ¶
func WithTempFile ¶ added in v1.0.10
WithTempFile creates a temporary file, then invokes a callback to create a resource based on the file, then close and remove the temp file
func Write ¶
func Write[R any, W io.WriteCloser](acquire IOE.IOEither[error, W]) func(use func(W) IOE.IOEither[error, R]) IOE.IOEither[error, R]
Write uses a generator function to create a stream, writes data to it and closes it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.