std

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

package std is used to create wrappers for standard Go functions to support mocking in tests where necessary

package std is used to create wrappers for standard Go functions to support mocking in tests where necessary

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.Reader
	io.Closer
}

File interface is used to mock os.File structure

type FileMode

type FileMode uint32

A FileMode represents a file's mode and permission bits.

type MockOs

type MockOs interface {
	MockFile(path string, data []byte)
}

type Os

type Os interface {
	Open(name string) (File, error)
	Stat(name string) (os.FileInfo, error)
	IsExist(err error) bool
}

Os interface is used to mock os package

func NewMockOs

func NewMockOs() Os

NewMockOs returns Os interface that replaces supported os package functionality with mock functions.

func NewOs

func NewOs() Os

NewOs returns Os interface that forwards supported methods to os package.

Jump to

Keyboard shortcuts

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