osproxy

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package osproxy is a package that provides an os proxy for the app.

Index

Constants

This section is empty.

Variables

View Source
var Args = os.Args

Args is a variable for os.Args.

View Source
var Stderr = os.Stderr

Stderr is a variable for os.Stderr.

View Source
var Stdout = os.Stdout

Stdout is a variable for os.Stdout.

Functions

This section is empty.

Types

type FileInstance

type FileInstance struct {
	FieldFile *os.File
}

FileInstance is a struct that implements FileInstanceInterface.

func (*FileInstance) Close

func (f *FileInstance) Close() error

Close is a proxy for os.File.Close().

func (*FileInstance) Read

func (f *FileInstance) Read(p []byte) (n int, err error)

Read is a proxy for os.File.Read().

func (*FileInstance) Seek

func (f *FileInstance) Seek(offset int64, whence int) (int64, error)

Seek is a proxy for os.File.Seek().

func (*FileInstance) Write

func (f *FileInstance) Write(b []byte) (n int, err error)

Write is a proxy for os.File.Write().

type FileInstanceInterface

type FileInstanceInterface interface {
	Close() error
	Read(p []byte) (n int, err error)
	Seek(offset int64, whence int) (int64, error)
	Write(b []byte) (n int, err error)
}

FileInstanceInterface is an interface for os.File.

type Os

type Os interface {
	Create(name string) (FileInstanceInterface, error)
	FileMode(perm fsproxy.FileMode) fsproxy.FileMode
	Getenv(key string) string
	IsNotExist(err error) bool
	MkdirAll(path string, perm fsproxy.FileMode) error
	Open(name string) (*FileInstance, error)
	Pipe() (*FileInstance, *FileInstance, error)
	Remove(name string) error
	RemoveAll(path string) error
	Stat(name string) (*fsproxy.FileInfoInstance, error)
	TempDir() string
}

Os is an interface for os.

func New

func New() Os

New is a constructor for OsProxy.

type OsProxy

type OsProxy struct{}

OsProxy is a struct that implements Os.

func (*OsProxy) Create

func (*OsProxy) Create(name string) (FileInstanceInterface, error)

Create is a proxy for os.Create.

func (*OsProxy) FileMode

func (*OsProxy) FileMode(perm fsproxy.FileMode) fsproxy.FileMode

Filemode is a proxy for os.FileMode.

func (*OsProxy) Getenv

func (*OsProxy) Getenv(key string) string

Getenv is a proxy for os.Getenv.

func (*OsProxy) IsNotExist

func (*OsProxy) IsNotExist(err error) bool

IsNotExist is a proxy for os.IsNotExist.

func (*OsProxy) MkdirAll

func (*OsProxy) MkdirAll(path string, perm fsproxy.FileMode) error

MkdirAll is a proxy for os.MkdirAll.

func (*OsProxy) Open

func (*OsProxy) Open(name string) (*FileInstance, error)

Open is a proxy for os.Open.

func (*OsProxy) Pipe

func (*OsProxy) Pipe() (*FileInstance, *FileInstance, error)

Pipe is a proxy for os.Pipe.

func (*OsProxy) Remove

func (*OsProxy) Remove(name string) error

Remove is a proxy for os.Remove.

func (*OsProxy) RemoveAll

func (*OsProxy) RemoveAll(path string) error

RemoveAll is a proxy for os.RemoveAll.

func (*OsProxy) Stat

func (*OsProxy) Stat(name string) (*fsproxy.FileInfoInstance, error)

Stat is a proxy for os.Stat.

func (*OsProxy) TempDir

func (*OsProxy) TempDir() string

TempDir is a proxy for os.TempDir.

Jump to

Keyboard shortcuts

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