Documentation ¶
Index ¶
- Constants
- func EnumFileServer(callback func(*NetResource) bool) error
- func FindVacantDrive() (uint, error)
- func GetDiskFreeSpace(rootPathName string) (free uint64, total uint64, totalFree uint64, err error)
- func NetUse(drive, vol string) (func(bool, bool), error)
- func UNCtoNetDrive(uncpath string) (newpath string, closer func(bool, bool))
- func VolumeName(drive string) (label string, fsname string, err error)
- func WNetAddConnection2(remote, local, user, pass string) (err error)
- func WNetCancelConnection2(name string, update bool, force bool) error
- func WNetEnum(callback func(nr *NetResource) bool) error
- func WNetGetConnectionUTF16a(drive uint16) (string, error)
- func WNetGetConnectionUTF16s(localName []uint16) (string, error)
- type Drive
- type NetDrive
- type NetResource
- func (nr *NetResource) Comment() string
- func (nr *NetResource) Enum(callback func(*NetResource) bool) error
- func (nr *NetResource) IsDir() bool
- func (nr *NetResource) LocalName() string
- func (nr *NetResource) ModTime() time.Time
- func (nr *NetResource) Mode() os.FileMode
- func (nr *NetResource) Name() string
- func (nr *NetResource) Provider() string
- func (nr *NetResource) RemoteName() string
- func (nr *NetResource) Size() int64
- func (nr *NetResource) Sys() interface{}
- type NetResourceHandle
Constants ¶
View Source
const CONNECT_UPDATE_PROFILE = 1
View Source
const ERROR_NO_MORE_ITEMS = 259
View Source
const RESOURCEDISPLAYTYPE_NETWORK = 6
View Source
const RESOURCEDISPLAYTYPE_SERVER = 2
View Source
const RESOURCETYPE_ANY = 0
View Source
const RESOURCETYPE_DISK = 1
View Source
const RESOURCETYPE_PRINT = 2
View Source
const RESOURCEUSAGE_ALL = 19
View Source
const RESOURCEUSAGE_ATTACHED = 16
View Source
const RESOURCEUSAGE_CONNECTABLE = 1
View Source
const RESOURCEUSAGE_CONTAINER = 2
View Source
const RESOURCE_CONNECTED = 1
Code generated by go-importconst DO NOT EDIT.
View Source
const RESOURCE_CONTEXT = 5
View Source
const RESOURCE_GLOBALNET = 2
View Source
const RESOURCE_REMEMBERED = 3
Variables ¶
This section is empty.
Functions ¶
func EnumFileServer ¶
func EnumFileServer(callback func(*NetResource) bool) error
EnumFileServer lists up file-servers.
func FindVacantDrive ¶
FindVacantDrive returns the last unused drive like 'Z'
func NetUse ¶
NetUse do same thing as `net use X: \\server\path...`
drive - `X:` vol - `server\\path\...`
returns
func(update,force) - function release the drive update - true: updates connection as not a persistent one force - true: disconnect even if open process exists. error
func UNCtoNetDrive ¶
UNCtoNetDrive replace UNCPath to path using netdrive.
uncpath - for example \\server\path\folder\name
returns
newpath - X:\folder\name
func WNetAddConnection2 ¶
WNetAddConnection2 makes a connection to a network resource and can redirect a local device to the network resource
remote - UNC-Path like `\\localhost\C$` local - local-drive like `X:` user - username. When it is "", default username is used. pass - password. When it is "", default passwors is used.
func WNetCancelConnection2 ¶
WNetCancelConnection2 cancels an existing network connection.
update - true: updates connection as not a persistent one force - true: disconnect even if open process exists.
func WNetEnum ¶
func WNetEnum(callback func(nr *NetResource) bool) error
func WNetGetConnectionUTF16a ¶
func WNetGetConnectionUTF16s ¶
Types ¶
type NetDrive ¶
func GetNetDrives ¶
type NetResource ¶
type NetResource struct { Scope uint32 Type uint32 DisplayType uint32 Usage uint32 // contains filtered or unexported fields }
func NewFileServer ¶
func NewFileServer(name string) (*NetResource, error)
NewFileServer is constructor of NetResource for FileServer's root node.
func (*NetResource) Comment ¶
func (nr *NetResource) Comment() string
func (*NetResource) Enum ¶
func (nr *NetResource) Enum(callback func(*NetResource) bool) error
func (*NetResource) IsDir ¶
func (nr *NetResource) IsDir() bool
func (*NetResource) LocalName ¶
func (nr *NetResource) LocalName() string
func (*NetResource) ModTime ¶
func (nr *NetResource) ModTime() time.Time
func (*NetResource) Mode ¶
func (nr *NetResource) Mode() os.FileMode
func (*NetResource) Name ¶
func (nr *NetResource) Name() string
func (*NetResource) Provider ¶
func (nr *NetResource) Provider() string
func (*NetResource) RemoteName ¶
func (nr *NetResource) RemoteName() string
func (*NetResource) Size ¶
func (nr *NetResource) Size() int64
func (*NetResource) Sys ¶
func (nr *NetResource) Sys() interface{}
type NetResourceHandle ¶
type NetResourceHandle struct {
// contains filtered or unexported fields
}
NetResourceHandle is compatible type with "net/http".File
func (*NetResourceHandle) Close ¶
func (this *NetResourceHandle) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.