github.com/sandwich-go/boost@v1.3.29/xos/copy_options.go (about) 1 package xos 2 3 import ( 4 "os" 5 ) 6 7 // SymlinkAction represents what to do on symlink. 8 type SymlinkAction int 9 10 const ( 11 // Deep creates hard-copy of contents. 12 Deep SymlinkAction = iota 13 // Shallow creates new symlink to the dest of symlink. 14 Shallow 15 // Skip does nothing with symlink. 16 Skip 17 ) 18 19 //go:generate optiongen --option_return_previous=false --option_prefix=WithCopy 20 func CopyOptionsOptionDeclareWithDefault() interface{} { 21 return map[string]interface{}{ 22 // OnSymlink can specify what to do on symlink 23 "OnSymlink": func(src string) SymlinkAction { return Shallow }, 24 // Skip can specify which files should be skipped 25 "Skip": func(src string) (bool, error) { return false, nil }, 26 // AddPermission to every entities, 27 "AddPermission": os.FileMode(0), 28 // Sync file after copy. 29 "Sync": false, 30 } 31 }