handler

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package handler is a generated GoMock package.

Index

Constants

View Source
const (
	DOWN = "DOWN"
	UP   = "UP"
)

Variables

This section is empty.

Functions

func CreateMigration

func CreateMigration(c *gofr.Context) (interface{}, error)

CreateMigration generates a migration file with a timestamp prefix in the format YYYYMMDDHHIISS, followed by the provided name

func Migrate

func Migrate(c *gofr.Context) (interface{}, error)

Migrate executes the migration

Types

type Create

type Create struct {
}

func (Create) Chdir

func (c Create) Chdir(dir string) error

Chdir changes the current working directory to the named directory

func (Create) Create

func (c Create) Create(name string) (*os.File, error)

Create creates or truncates the named file. If the file already exists, it is truncated

func (Create) Help

func (c Create) Help() interface{}

Help returns a formatted string containing usage instructions, flags, examples and a description

func (Create) IsNotExist

func (c Create) IsNotExist(err error) bool

IsNotExist returns a boolean indicating whether the error is known to report that a file or directory does not exist

func (Create) Mkdir

func (c Create) Mkdir(name string, perm os.FileMode) error

Mkdir creates a new directory with the specified name and permission bits (before umask)

func (Create) OpenFile

func (c Create) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile opens the named file with specified flag (O_RDONLY etc.)

func (Create) ReadDir

func (c Create) ReadDir(dir string) ([]os.DirEntry, error)

ReadDir reads the named directory, returning all its directory entries sorted by filename

func (Create) Stat

func (c Create) Stat(name string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file

type FSCreate

type FSCreate interface {
	Chdir(dir string) error
	Mkdir(name string, perm os.FileMode) error
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	ReadDir(dir string) ([]os.DirEntry, error)
	Create(name string) (*os.File, error)
	Stat(name string) (os.FileInfo, error)
	IsNotExist(err error) bool
}

type FSMigrate

type FSMigrate interface {
	Getwd() (string, error)
	Chdir(dir string) error
	Mkdir(name string, perm os.FileMode) error
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Stat(name string) (os.FileInfo, error)
	IsNotExist(err error) bool
}

type Handler

type Handler struct {
}

func (Handler) Chdir

func (h Handler) Chdir(dir string) error

Chdir changes the current working directory to the named directory

func (Handler) Getwd

func (h Handler) Getwd() (string, error)

Getwd returns a rooted path name corresponding to the current directory

func (Handler) Help

func (h Handler) Help() interface{}

Help returns a formatted string containing usage instructions, flags, examples and a description

func (Handler) IsNotExist

func (h Handler) IsNotExist(err error) bool

IsNotExist returns a boolean indicating whether the error is known to report that a file or directory does not exist

func (Handler) Mkdir

func (h Handler) Mkdir(name string, perm os.FileMode) error

Mkdir creates a new directory with the specified name and permission bits (before umask)

func (Handler) OpenFile

func (h Handler) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile opens the named file with specified flag (O_RDONLY etc.)

func (Handler) Stat

func (h Handler) Stat(name string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file

type MockFSCreate

type MockFSCreate struct {
	// contains filtered or unexported fields
}

MockFSCreate is a mock of FSCreate interface

func NewMockFSCreate

func NewMockFSCreate(ctrl *gomock.Controller) *MockFSCreate

NewMockFSCreate creates a new mock instance

func (*MockFSCreate) Chdir

func (m *MockFSCreate) Chdir(dir string) error

Chdir mocks base method

func (*MockFSCreate) Create

func (m *MockFSCreate) Create(name string) (*os.File, error)

Create mocks base method

func (*MockFSCreate) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockFSCreate) IsNotExist

func (m *MockFSCreate) IsNotExist(err error) bool

IsNotExist mocks base method

func (*MockFSCreate) Mkdir

func (m *MockFSCreate) Mkdir(name string, perm os.FileMode) error

Mkdir mocks base method

func (*MockFSCreate) OpenFile

func (m *MockFSCreate) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile mocks base method

func (*MockFSCreate) ReadDir

func (m *MockFSCreate) ReadDir(dir string) ([]os.DirEntry, error)

ReadDir mocks base method

func (*MockFSCreate) Stat

func (m *MockFSCreate) Stat(name string) (os.FileInfo, error)

Stat mocks base method

type MockFSCreateMockRecorder

type MockFSCreateMockRecorder struct {
	// contains filtered or unexported fields
}

MockFSCreateMockRecorder is the mock recorder for MockFSCreate

func (*MockFSCreateMockRecorder) Chdir

func (mr *MockFSCreateMockRecorder) Chdir(dir interface{}) *gomock.Call

Chdir indicates an expected call of Chdir

func (*MockFSCreateMockRecorder) Create

func (mr *MockFSCreateMockRecorder) Create(name interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockFSCreateMockRecorder) IsNotExist

func (mr *MockFSCreateMockRecorder) IsNotExist(err interface{}) *gomock.Call

IsNotExist indicates an expected call of IsNotExist

func (*MockFSCreateMockRecorder) Mkdir

func (mr *MockFSCreateMockRecorder) Mkdir(name, perm interface{}) *gomock.Call

Mkdir indicates an expected call of Mkdir

func (*MockFSCreateMockRecorder) OpenFile

func (mr *MockFSCreateMockRecorder) OpenFile(name, flag, perm interface{}) *gomock.Call

OpenFile indicates an expected call of OpenFile

func (*MockFSCreateMockRecorder) ReadDir

func (mr *MockFSCreateMockRecorder) ReadDir(dir interface{}) *gomock.Call

ReadDir indicates an expected call of ReadDir

func (*MockFSCreateMockRecorder) Stat

func (mr *MockFSCreateMockRecorder) Stat(name interface{}) *gomock.Call

Stat indicates an expected call of Stat

type MockFSMigrate

type MockFSMigrate struct {
	// contains filtered or unexported fields
}

MockFSMigrate is a mock of FSMigrate interface

func NewMockFSMigrate

func NewMockFSMigrate(ctrl *gomock.Controller) *MockFSMigrate

NewMockFSMigrate creates a new mock instance

func (*MockFSMigrate) Chdir

func (m *MockFSMigrate) Chdir(dir string) error

Chdir mocks base method

func (*MockFSMigrate) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockFSMigrate) Getwd

func (m *MockFSMigrate) Getwd() (string, error)

Getwd mocks base method

func (*MockFSMigrate) IsNotExist

func (m *MockFSMigrate) IsNotExist(err error) bool

IsNotExist mocks base method

func (*MockFSMigrate) Mkdir

func (m *MockFSMigrate) Mkdir(name string, perm os.FileMode) error

Mkdir mocks base method

func (*MockFSMigrate) OpenFile

func (m *MockFSMigrate) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile mocks base method

func (*MockFSMigrate) Stat

func (m *MockFSMigrate) Stat(name string) (os.FileInfo, error)

Stat mocks base method

type MockFSMigrateMockRecorder

type MockFSMigrateMockRecorder struct {
	// contains filtered or unexported fields
}

MockFSMigrateMockRecorder is the mock recorder for MockFSMigrate

func (*MockFSMigrateMockRecorder) Chdir

func (mr *MockFSMigrateMockRecorder) Chdir(dir interface{}) *gomock.Call

Chdir indicates an expected call of Chdir

func (*MockFSMigrateMockRecorder) Getwd

func (mr *MockFSMigrateMockRecorder) Getwd() *gomock.Call

Getwd indicates an expected call of Getwd

func (*MockFSMigrateMockRecorder) IsNotExist

func (mr *MockFSMigrateMockRecorder) IsNotExist(err interface{}) *gomock.Call

IsNotExist indicates an expected call of IsNotExist

func (*MockFSMigrateMockRecorder) Mkdir

func (mr *MockFSMigrateMockRecorder) Mkdir(name, perm interface{}) *gomock.Call

Mkdir indicates an expected call of Mkdir

func (*MockFSMigrateMockRecorder) OpenFile

func (mr *MockFSMigrateMockRecorder) OpenFile(name, flag, perm interface{}) *gomock.Call

OpenFile indicates an expected call of OpenFile

func (*MockFSMigrateMockRecorder) Stat

func (mr *MockFSMigrateMockRecorder) Stat(name interface{}) *gomock.Call

Stat indicates an expected call of Stat

Jump to

Keyboard shortcuts

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