Documentation
¶
Overview ¶
Package argossftp instruments github.com/pkg/sftp clients. *sftp.Client is a concrete struct whose methods (besides ReadDirContext) take no context.Context - the library predates that convention, same constraint hit with Azure Service Bus's *Sender in the messaging phase. Because it's a concrete struct rather than an interface, Wrap can embed it: every method not explicitly overridden below (Close, Chmod, Getwd, ...) keeps working unmodified through Go's normal method promotion. The overridden operations gain *Context-suffixed siblings - mirroring the library's own ReadDir/ReadDirContext naming - rather than silently changing an existing method's signature.
Neither SFTP nor SMTP (the other niche-phase module) have an OpenTelemetry semantic-convention namespace, unlike HTTP/DB/messaging/ RPC; the attributes here (sftp.operation, sftp.path) are Argos-specific.
Index ¶
- type Client
- func (c *Client) CreateContext(ctx context.Context, path string) (*sftp.File, error)
- func (c *Client) MkdirAllContext(ctx context.Context, path string) error
- func (c *Client) MkdirContext(ctx context.Context, path string) error
- func (c *Client) OpenContext(ctx context.Context, path string) (*sftp.File, error)
- func (c *Client) RemoveContext(ctx context.Context, path string) error
- func (c *Client) RenameContext(ctx context.Context, oldname, newname string) error
- func (c *Client) StatContext(ctx context.Context, path string) (os.FileInfo, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps *sftp.Client. Every method of the embedded client not overridden below is used unmodified via Go's normal method promotion.
func (*Client) CreateContext ¶
CreateContext is Client.Create with a span.
func (*Client) MkdirAllContext ¶
MkdirAllContext is Client.MkdirAll with a span.
func (*Client) MkdirContext ¶
MkdirContext is Client.Mkdir with a span.
func (*Client) OpenContext ¶
OpenContext is Client.Open with a span.
func (*Client) RemoveContext ¶
RemoveContext is Client.Remove with a span.
func (*Client) RenameContext ¶
RenameContext is Client.Rename with a span. When WithPathAttribute is set, the destination is recorded as sftp.destination_path alongside the source path recorded on every span.
type Option ¶
type Option func(*config)
Option configures the Client returned by Wrap.
func WithLogger ¶
WithLogger attaches a Logger for error-level logging of failed operations, in addition to the span/metric recording that always happens.
func WithPathAttribute ¶
WithPathAttribute enables recording the file path as the sftp.path attribute. Off by default: paths can embed usernames or other identifying information callers may not want copied into telemetry.