Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConstructCallback ¶
type ConstructCallback func(path string, dir, conflicted bool, status ConstructStatus)
ConstructCallback is called after files and directories is created
type ConstructConflictedCallback ¶
ConstructConflictedCallback is called when a new file content is diifferent from an existing file If it returns true, it overwrites a new one
type ConstructStatus ¶
type ConstructStatus int
ConstructStatus represents a status of constructing processes
const ( // ConstructSuccess is returned when constructing is succeeded ConstructSuccess ConstructStatus = iota + 1 // ConstructSkipped is returned when constructing is skipped ConstructSkipped // ConstructFailed is returned when constructing is failed ConstructFailed )
func (ConstructStatus) IsFailed ¶
func (s ConstructStatus) IsFailed() bool
IsFailed returns true if a status represents failed
func (ConstructStatus) IsSkipped ¶
func (s ConstructStatus) IsSkipped() bool
IsSkipped returns true if a status represents skipped
func (ConstructStatus) IsSuccess ¶
func (s ConstructStatus) IsSuccess() bool
IsSuccess returns true if a status represents success
func (ConstructStatus) String ¶
func (s ConstructStatus) String() string
type Directory ¶
type Directory struct { Entry // contains filtered or unexported fields }
Directory represents a directory entry of filesystem
func EmptyDirectory ¶
EmptyDirectory returns an empty directory object
func NewDirectory ¶
NewDirectory returns a directory object
type Entry ¶
type Entry interface { Name() string Path() string IsDir() bool IsParentOf(other Entry) bool IsChildOf(other Entry) bool }
Entry represents a filesystem entry
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance
func (*MockRepository) Construct ¶
func (_m *MockRepository) Construct(scff Scaffold, name string, cb ConstructCallback, conflictedCb ConstructConflictedCallback) error
Construct mocks base method
func (*MockRepository) EXPECT ¶
func (_m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRepository) GetAll ¶
func (_m *MockRepository) GetAll() ([]Scaffold, error)
GetAll mocks base method
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository
func (*MockRepositoryMockRecorder) Construct ¶
func (_mr *MockRepositoryMockRecorder) Construct(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
Construct indicates an expected call of Construct
func (*MockRepositoryMockRecorder) GetAll ¶
func (_mr *MockRepositoryMockRecorder) GetAll() *gomock.Call
GetAll indicates an expected call of GetAll
type MockScaffold ¶
type MockScaffold struct {
// contains filtered or unexported fields
}
MockScaffold is a mock of Scaffold interface
func NewMockScaffold ¶
func NewMockScaffold(ctrl *gomock.Controller) *MockScaffold
NewMockScaffold creates a new mock instance
func (*MockScaffold) EXPECT ¶
func (_m *MockScaffold) EXPECT() *MockScaffoldMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockScaffold) Synopsis ¶
func (_m *MockScaffold) Synopsis() string
Synopsis mocks base method
type MockScaffoldMockRecorder ¶
type MockScaffoldMockRecorder struct {
// contains filtered or unexported fields
}
MockScaffoldMockRecorder is the mock recorder for MockScaffold
func (*MockScaffoldMockRecorder) Help ¶
func (_mr *MockScaffoldMockRecorder) Help() *gomock.Call
Help indicates an expected call of Help
func (*MockScaffoldMockRecorder) Name ¶
func (_mr *MockScaffoldMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockScaffoldMockRecorder) Path ¶
func (_mr *MockScaffoldMockRecorder) Path() *gomock.Call
Path indicates an expected call of Path
func (*MockScaffoldMockRecorder) Synopsis ¶
func (_mr *MockScaffoldMockRecorder) Synopsis() *gomock.Call
Synopsis indicates an expected call of Synopsis
type Repository ¶
type Repository interface { GetAll() ([]Scaffold, error) Construct( scff Scaffold, name string, cb ConstructCallback, conflictedCb ConstructConflictedCallback, ) error }
Repository is a repository for scaffolds
type Scaffold ¶
Scaffold represents an executable subcommand
func NewScaffold ¶
NewScaffold reeturns a new scaffold object