Documentation
¶
Index ¶
Constants ¶
const ( DefaultFolderPermission os.FileMode = 0755 DefaultFilePermission os.FileMode = 0644 )
Define default permissions as constant for clarity Default permission 0755 (Owner: rwx, Group/Others: r-x) Fefault permission 0644 (Owner: read/write, Group/Others: read only)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type OSFileSystem ¶
type OSFileSystem struct{}
func NewOSFileSystem ¶
func NewOSFileSystem() *OSFileSystem
func (*OSFileSystem) CreateFolder ¶
func (o *OSFileSystem) CreateFolder(folderPath string, permission os.FileMode) error
Common Folder Permissions: 0755 → Owner: read/write/execute | Group: read/execute | Others: read/execute 0700 → Owner: read/write/execute | Group: no access | Others: no access 0777 → Everyone: read/write/execute (!! usually not recommended for security !!)
Common File Permissions (for reference): 0644 → Owner: read/write | Group: read | Others: read 0600 → Owner: read/write | Group: no access | Others: no access 0755 → Owner: read/write/execute | Group: read/execute | Others: read/execute (for executable files)
Octal Permission Breakdown:
0 = --- (no permission) 1 = --x (execute) 2 = -w- (write) 3 = -wx (write and execute) 4 = r-- (read) 5 = r-x (read and execute) 6 = rw- (read and write) 7 = rwx (read, write, and execute)
Format: 0<Owner><Group><Others> (each digit is a sum of r=4, w=2, x=1) Note: Permissions are based on standard UNIX file mode bits, stable across Go versions.
CreateFolder creates a folder
type StructureBuilder ¶
type StructureBuilder struct {
// contains filtered or unexported fields
}
StructureBuilder builds a project scaffold.
func NewStructureBuilder ¶
func NewStructureBuilder(fs FileSystem) *StructureBuilder