Documentation
¶
Index ¶
- Constants
- Variables
- func ArtifactCSVDialect(delimiter string, header *bool) (string, bool)
- type ArtifactEvidence
- type Config
- type Connector
- func (c *Connector) Close() error
- func (c *Connector) Execute(ctx context.Context, queryData json.RawMessage, ...) (*result.ExecutionResult, error)
- func (c *Connector) FetchArtifactCSV(ctx context.Context, evidence ArtifactEvidence, limit int64, ...) (*result.FileResult, error)
- func (c *Connector) IntrospectSchema(ctx context.Context) (*filedata.Schema, error)
- func (c *Connector) PublishArtifact(ctx context.Context, evidence ArtifactEvidence, body io.Reader, ...) (retErr error)
- func (c *Connector) TestConnection(ctx context.Context) (err error)
- type Credentials
- type QueryFormat
Constants ¶
const ( QueryFormatUnknown = filedata.QueryFormatUnknown QueryFormatAuto = filedata.QueryFormatAuto QueryFormatCSV = filedata.QueryFormatCSV QueryFormatJSON = filedata.QueryFormatJSON QueryFormatFile = filedata.QueryFormatFile QueryFormatSpreadsheet = filedata.QueryFormatSpreadsheet )
const MaxArtifactBytes = 10 << 20
Variables ¶
var ErrArtifactChanged = xerror.New(xerror.KindInvalidInput, "FTP_ARTIFACT_CHANGED", "FTP artifact bytes differ from receipt")
Functions ¶
Types ¶
type ArtifactEvidence ¶
type ArtifactEvidence struct {
DeliveryID uuid.UUID
FinalPath string
StagingPath string
SizeBytes int64
SHA256 string
}
func PrepareArtifactCSV ¶
func PrepareArtifactCSV(config Config, directory, filename string, id uuid.UUID, limit int64, content any, options filedata.ParseCSVOptions) (ArtifactEvidence, []byte, error)
PrepareArtifactCSV performs no provider I/O. The directory must come from a qualified storage binding and the filename from the pinned write operation.
type Config ¶
type Config struct {
Host string `json:"host" validate:"required,hostname|ip"`
Port int `json:"port" validate:"required,min=1,max=65535"`
BasePath string `json:"base_path,omitempty"`
ConnectTimeout int `json:"connect_timeout,omitempty" validate:"omitempty,min=1,max=300"`
AllowPrivateHosts bool `json:"allow_private_hosts,omitempty"`
}
Config holds configuration for FTP connections.
func (Config) ValidateBasePath ¶
ValidateBasePath checks the configured directory before it is persisted or used.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector connects to FTP servers and executes file-backed row queries.
func (*Connector) Execute ¶
func (c *Connector) Execute( ctx context.Context, queryData json.RawMessage, params map[string]types.TypedParam, limits ...types.ExecutionLimits, ) (*result.ExecutionResult, error)
Execute runs an FTP file operation (read or write) and returns an FTP execution result.
func (*Connector) FetchArtifactCSV ¶
func (c *Connector) FetchArtifactCSV(ctx context.Context, evidence ArtifactEvidence, limit int64, options filedata.ParseCSVOptions) (*result.FileResult, error)
FetchArtifactCSV fetches one copy and checks its identity before parsing.
func (*Connector) IntrospectSchema ¶
IntrospectSchema enumerates supported files and infers schema fields.
func (*Connector) PublishArtifact ¶
func (c *Connector) PublishArtifact(ctx context.Context, evidence ArtifactEvidence, body io.Reader, beforeRename func(context.Context) error) (retErr error)
PublishArtifact receives evidence and bytes already matched by the trusted executor. beforeRename rechecks the live database claim after STOR.
type Credentials ¶
type Credentials struct {
Username string `json:"username" validate:"required,min=1"`
Password string `json:"password" validate:"required,min=1"`
}
Credentials holds FTP authentication values.
type QueryFormat ¶
type QueryFormat = filedata.QueryFormat
QueryFormat is an alias for filedata.QueryFormat.