Documentation
¶
Index ¶
- func ContentDigest(content []byte) string
- func ObjectMetadataURL(region, endpoint, bucket, key string) (*url.URL, error)
- func ReadObjectMetadata(ctx context.Context, httpClient *http.Client, config Config, creds Credentials, ...) (bool, error)
- func WithRedirectsDisabled(ctx context.Context) context.Context
- type Client
- func (c *Client) Close() error
- func (c *Client) GetObject(ctx context.Context, req GetObjectRequest) (*ObjectContent, error)
- func (c *Client) HeadObject(ctx context.Context, req HeadObjectRequest) (bool, error)
- func (c *Client) ListObjects(ctx context.Context, req ListObjectsRequest) ([]Object, error)
- func (c *Client) MatchesObject(ctx context.Context, req MatchObjectRequest) (bool, error)
- func (c *Client) PutObject(ctx context.Context, req PutObjectRequest) (*PutObjectResult, error)
- func (c *Client) PutObjectStream(ctx context.Context, req StreamWriteRequest) (_ *StreamWriteResult, retErr error)
- func (c *Client) ReadObjectTo(ctx context.Context, req GetObjectRequest, dst io.Writer) (*filestream.Metadata, error)
- func (c *Client) TestConnection(ctx context.Context, req TestConnectionRequest) error
- func (c *Client) ValidatePut(overwrite bool) error
- type Config
- type Credentials
- type GetObjectRequest
- type HeadObjectRequest
- type ListObjectsRequest
- type MatchObjectRequest
- type Object
- type ObjectContent
- type PutObjectRequest
- type PutObjectResult
- type StreamWriteRequest
- type StreamWriteResult
- type TestConnectionRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentDigest ¶
ContentDigest identifies the exact serialized bytes that a prepared write would dispatch.
func ObjectMetadataURL ¶
ObjectMetadataURL uses the SDK's partition and path rules without provider I/O.
func ReadObjectMetadata ¶
func ReadObjectMetadata(ctx context.Context, httpClient *http.Client, config Config, creds Credentials, request HeadObjectRequest) (bool, error)
ReadObjectMetadata uses the admitted HTTP client and static credentials only. No environment credential discovery, redirects, retries or bucket listing is authorized.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client performs S3-compatible provider requests through the AWS SDK.
func (*Client) GetObject ¶
func (c *Client) GetObject(ctx context.Context, req GetObjectRequest) (*ObjectContent, error)
GetObject reads one S3 object body into memory within the supplied byte limit.
func (*Client) HeadObject ¶
HeadObject reports whether one S3 object exists without returning its body.
func (*Client) ListObjects ¶
ListObjects lists object metadata under a bucket/prefix for schema introspection.
func (*Client) MatchesObject ¶
MatchesObject confirms the complete prepared bytes and configured metadata with bounded memory.
func (*Client) PutObject ¶
func (c *Client) PutObject(ctx context.Context, req PutObjectRequest) (*PutObjectResult, error)
PutObject writes one S3 object body after optional overwrite protection.
func (*Client) PutObjectStream ¶
func (c *Client) PutObjectStream(ctx context.Context, req StreamWriteRequest) (_ *StreamWriteResult, retErr error)
PutObjectStream uploads sequential bounded parts, publishing only after input verification. An error after completion starts requires independent readback; callers must never infer that an existing object can safely be overwritten.
func (*Client) ReadObjectTo ¶
func (c *Client) ReadObjectTo(ctx context.Context, req GetObjectRequest, dst io.Writer) (*filestream.Metadata, error)
ReadObjectTo consumes one finite object with backpressure from the destination. The caller owns the writer and must discard partial output on any error.
func (*Client) TestConnection ¶
func (c *Client) TestConnection(ctx context.Context, req TestConnectionRequest) error
TestConnection checks only the configured prefix when credentials are prefix-restricted.
func (*Client) ValidatePut ¶
ValidatePut checks the endpoint contract before a sink claims a provider effect.
type Config ¶
type Config struct {
Endpoint string `json:"endpoint,omitempty" validate:"omitempty,url"`
Region string `json:"region" validate:"required,min=1"`
Bucket string `json:"bucket" validate:"required,min=1"`
Prefix string `json:"prefix,omitempty"`
ForcePathStyle bool `json:"force_path_style,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty" validate:"omitempty,min=1,max=300"`
AllowPrivateHosts bool `json:"allow_private_hosts,omitempty"`
}
Config holds S3-compatible connector runtime configuration.
type Credentials ¶
type Credentials struct {
AccessKeyID string `json:"access_key_id" validate:"required,min=1"`
SecretAccessKey string `json:"secret_access_key" validate:"required,min=1"`
SessionToken string `json:"session_token,omitempty"`
}
Credentials holds write-only S3 access key credentials.
type GetObjectRequest ¶
GetObjectRequest identifies one S3 object read and its runtime byte guardrail.
type HeadObjectRequest ¶
HeadObjectRequest identifies one S3 object metadata lookup.
type ListObjectsRequest ¶
ListObjectsRequest identifies a bucket and prefix to introspect.
type MatchObjectRequest ¶
type MatchObjectRequest struct {
Bucket, Key, SHA256, ContentType string
SizeBytes int64
Metadata map[string]string
}
MatchObjectRequest describes the prepared output, never a replacement write.
type ObjectContent ¶
type ObjectContent struct {
Key string
Content []byte
ContentType string
Metadata map[string]string
}
ObjectContent is an in-memory S3 object body plus safe provider metadata.
type PutObjectRequest ¶
type PutObjectRequest struct {
Bucket string
Key string
Content []byte
ContentType string
Metadata map[string]string
Overwrite bool
}
PutObjectRequest describes one S3 object write after Braidplane binding.
type PutObjectResult ¶
type PutObjectResult struct {
WrittenBytes int
}
PutObjectResult reports the number of bytes accepted for an S3 write.
type StreamWriteRequest ¶
type StreamWriteRequest struct {
Bucket string
Key string
Body io.Reader
SizeBytes int64
MaxBytes int64
SHA256 string
ContentType string
Metadata map[string]string
Overwrite bool
}
StreamWriteRequest requires the length and digest of retained, verified input.
type StreamWriteResult ¶
StreamWriteResult distinguishes a complete acknowledgement from an uncertain one.
type TestConnectionRequest ¶
TestConnectionRequest identifies the bucket checked by connection tests.