Documentation ¶
Index ¶
- Constants
- type AuthCallback
- type Client
- func (c *Client) Close() error
- func (c *Client) Destroy() error
- func (c *Client) GetDebug() int
- func (c *Client) GetUser() string
- func (c *Client) GetWorkgroup() string
- func (c *Client) Open(furl string, flags, mode int) (File, error)
- func (c *Client) Opendir(durl string) (File, error)
- func (c *Client) SetAuthCallback(f AuthCallback)
- func (c *Client) SetDebug(level int)
- func (c *Client) SetUseKerberos()
- func (c *Client) SetUser(user string)
- func (c *Client) SetWorkgroup(wg string)
- type Dirent
- type File
- type SmbcType
Examples ¶
Constants ¶
const ( // SmbcWorkgroup is a workgroup entity. SmbcWorkgroup SmbcType = C.SMBC_WORKGROUP SmbcFileShare = C.SMBC_FILE_SHARE SmbcPrinterShare = C.SMBC_PRINTER_SHARE SmbcCommsShare = C.SMBC_COMMS_SHARE SmbcIPCShare = C.SMBC_IPC_SHARE // SmbcDir is a directory. SmbcDir = C.SMBC_DIR // SmbcFile is a file. SmbcFile = C.SMBC_FILE // SmbcLink is a symlink. SmbcLink = C.SMBC_LINK )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCallback ¶
AuthCallback is the authentication function that will be called during connection with samba.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a samba client instance, handling its own context and lock.
func New ¶
func New() *Client
New creates a new samba client.
Example ¶
client := libsmbclient.New() dh, err := client.Opendir("smb://localhost") if err != nil { log.Fatal(err) } defer dh.Closedir() for { dirent, err := dh.Readdir() if err != nil { break } fmt.Println(dirent) }
Output:
func (*Client) GetWorkgroup ¶
GetWorkgroup returns the name of the current workgroup.
func (*Client) Open ¶
Open opens a file and returns a handle on success. FIXME: mode is actually "mode_t mode"
func (*Client) SetAuthCallback ¶
func (c *Client) SetAuthCallback(f AuthCallback)
SetAuthCallback assigns the authentication function that will be called during connection with samba.
func (*Client) SetUseKerberos ¶
func (c *Client) SetUseKerberos()
SetUseKerberos enable krb5 integration for authentication.
func (*Client) SetWorkgroup ¶
SetWorkgroup sets the work group to use for the session.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File reprends a samba file.
func (*File) Close ¶
func (e *File) Close()
Close closes current file and and releases its ressources.
func (*File) Lseek ¶
Lseek repositions the file offset of the open file to the argument offset according to the directive whence.