ContextError wraps a context error to support os.IsTimeout function.Errerror(*ContextError) Error() string(*ContextError) Timeout() bool
*ContextError : error
Dialer contains options for func (*Dialer) Dial.InitiatorInitiator // if it's zero, clientMaxCreditBalance is used. (See feature.go for more details)NegotiatorNegotiator Dial performs negotiation and authentication.
It returns a session. It doesn't support NetBIOS transport.
This implementation doesn't support multi-session on the same TCP connection.
If you want to use another session, you need to prepare another TCP connection at first. DialContext performs negotiation and authentication using the provided context.
Note that returned session doesn't inherit context.
If you want to use the same context, call Session.WithContext manually.
This implementation doesn't support multi-session on the same TCP connection.
If you want to use another session, you need to prepare another TCP connection at first.
InvalidResponseError represents a data sent by the server is corrupted or unexpected.Messagestring(*InvalidResponseError) Error() string
*InvalidResponseError : error
Negotiator contains options for func (*Dialer) Dial. // if it's zero, generated by crypto/rand. // enforce signing? // if it's zero, clientDialects is used. (See feature.go for more details)
ResponseError represents a error with a nt status code sent by the server.
The NTSTATUS is defined in [MS-ERREF].
https://msdn.microsoft.com/en-au/library/cc704588.aspx // NTSTATUS(*ResponseError) Error() string
*ResponseError : error
Session represents a SMB session.(*Session) ListSharenames() ([]string, error) Logoff invalidates the current SMB session. Mount mounts the SMB share.
sharename must follow format like `<share>` or `\\<server>\<share>`.
Note that the mounted share doesn't inherit session's context.
If you want to use the same context, call Share.WithContext manually.(*Session) WithContext(ctx context.Context) *Session
func (*Dialer).Dial(tcpConn net.Conn) (*Session, error)
func (*Dialer).DialContext(ctx context.Context, tcpConn net.Conn) (*Session, error)
func (*Session).WithContext(ctx context.Context) *Session
func github.com/limanmys/render-engine/internal/bridge.OpenSmbConnection(host, username, password string) (*Session, error)
Share represents a SMB tree connection with VFS interface.(*Share) Chmod(name string, mode os.FileMode) error(*Share) Chtimes(name string, atime time.Time, mtime time.Time) error(*Share) Create(name string) (*File, error)(*Share) DirFS(dirname string) fs.FS Glob should work like filepath.Glob.(*Share) Lstat(name string) (os.FileInfo, error)(*Share) Mkdir(name string, perm os.FileMode) error MkdirAll mimics os.MkdirAll(*Share) Open(name string) (*File, error)(*Share) OpenFile(name string, flag int, perm os.FileMode) (*File, error)(*Share) ReadDir(dirname string) ([]os.FileInfo, error)(*Share) ReadFile(filename string) ([]byte, error)(*Share) Readlink(name string) (string, error)(*Share) Remove(name string) error RemoveAll removes path and any children it contains.
It removes everything it can but returns the first error
it encounters. If the path does not exist, RemoveAll
returns nil (no error).(*Share) Rename(oldpath, newpath string) error(*Share) Stat(name string) (os.FileInfo, error)(*Share) Statfs(name string) (FileFsInfo, error) Symlink mimics os.Symlink.
This API should work on latest Windows and latest MacOS.
However it may not work on Linux because Samba doesn't support reparse point well.
Also there is a restriction on target pathname.
Generally, a pathname begins with leading backslash (e.g `\dir\name`) can be interpreted as two ways.
On windows, it is evaluated as a relative path, on other systems, it is evaluated as an absolute path.
This implementation always assumes that format is absolute path.
So, if you know the target server is Windows, you should avoid that format.
If you want to use an absolute target path on windows, you can use // `C:\dir\name` format instead.(*Share) Truncate(name string, size int64) error Umount disconects the current SMB tree.(*Share) WithContext(ctx context.Context) *Share(*Share) WriteFile(filename string, data []byte, perm os.FileMode) error
func (*Session).Mount(sharename string) (*Share, error)
func (*Share).WithContext(ctx context.Context) *Share
TransportError represents a error come from net.Conn layer.Errerror(*TransportError) Error() string
*TransportError : error
Match reports whether name matches the shell file name pattern.
The pattern syntax is:
pattern:
{ term }
term:
'*' matches any sequence of non-Separator characters
'?' matches any single non-Separator character
'[' [ '^' ] { character-range } ']'
character class (must be non-empty)
c matches character c (c != '*', '?', '[')
character-range:
c matches character c (c != '-', ']')
lo '-' hi matches character c for lo <= c <= hi
Match requires pattern to match all of name, not just a substring.
The only possible returned error is ErrBadPattern, when pattern
is malformed.
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.