internal

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package internal implements the internals for bulk operations

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadAppendRequest is returned when a caller passes bad parameters to
	// Append
	ErrBadAppendRequest = errors.New("bad request")
	// ErrBulkState is returned when the bulk state is invalid
	ErrBulkState = errors.New("bulk state error")
)

Functions

func Append

func Append(stateFile string, req generator.GenerateRequest, openFileFn OpenFileFn) error

Append appends a mock generate request to the bulk state

func Finalize

func Finalize(stateFile, rootDir string, openFn OpenFn, generateFn GenerateFn) error

Finalize complete bulk processing by generating all the requested mocks

func Initialize

func Initialize(stateFile, rootDir string, createFn CreateFn) error

Initialize initializes bulk processing and creates the bulk processing state file

Types

type CreateFn

type CreateFn func(name string) (file io.WriteCloser, err error)

CreateFn is the function type of os.Create

type GenerateFn

type GenerateFn func(reqs ...generator.GenerateRequest) error

GenerateFn is the function type of generator.Generate

type OpenFileFn

type OpenFileFn func(name string, flag int, perm os.FileMode) (ReadWriteSeekCloser, error)

OpenFileFn is the function type of os.OpenFile

type OpenFn

type OpenFn func(name string) (file io.ReadCloser, err error)

OpenFn is the function type of os.Open

type ReadWriteSeekCloser

type ReadWriteSeekCloser interface {
	io.Reader
	io.Writer
	io.Seeker
	io.Closer
}

ReadWriteSeekCloser is the interface that groups the basic Read, Write, Seek and Close methods.

Jump to

Keyboard shortcuts

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