Documentation
ΒΆ
Overview ΒΆ
Package rustfs client.go - RustFS Go SDK client entrypoint
Package rustfs options.go
Index ΒΆ
- type Client
- func (c *Client) Bucket() bucket.Service
- func (c *Client) EndpointURL() *url.URL
- func (c *Client) HealthCheck(opts *core.HealthCheckOptions) *core.HealthCheckResult
- func (c *Client) HealthCheckWithRetry(opts *core.HealthCheckOptions, maxRetries int) *core.HealthCheckResult
- func (c *Client) IsSecure() bool
- func (c *Client) Object() object.Service
- func (c *Client) Region() string
- func (c *Client) SetAppInfo(appName, appVersion string)
- type Options
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type Client ΒΆ
type Client struct {
// contains filtered or unexported fields
}
Client is the RustFS client
func New ΒΆ
New creates a new RustFS client
Parameters:
- endpoint: RustFS server address (e.g., "localhost:9000", "rustfs.example.com")
- opts: client configuration options
Returns:
- *Client: client instance
- error: error details
Example:
client, err := rustfs.New("localhost:9000", &rustfs.Options{
Credentials: credentials.NewStaticV4("access-key", "secret-key", ""),
Secure: false,
})
func (*Client) Bucket ΒΆ added in v1.0.0
Bucket returns the Bucket service interface
Example:
err := client.Bucket().Create(ctx, "my-bucket")
func (*Client) EndpointURL ΒΆ
EndpointURL returns the client's endpoint URL
func (*Client) HealthCheck ΒΆ
func (c *Client) HealthCheck(opts *core.HealthCheckOptions) *core.HealthCheckResult
HealthCheck performs a simple HEAD request to verify connectivity
Parameters:
- opts: health check options (nil uses defaults)
Returns:
- *core.HealthCheckResult: health check result
Example:
result := client.HealthCheck(nil)
if result.Healthy {
fmt.Printf("Service healthy, response time: %v\n", result.ResponseTime)
}
func (*Client) HealthCheckWithRetry ΒΆ added in v1.0.0
func (c *Client) HealthCheckWithRetry(opts *core.HealthCheckOptions, maxRetries int) *core.HealthCheckResult
HealthCheckWithRetry performs a health check with retries
Parameters:
- opts: health check options
- maxRetries: maximum retries (<= 0 defaults to 3)
Returns:
- *core.HealthCheckResult: final health check result
Example:
result := client.HealthCheckWithRetry(&core.HealthCheckOptions{
Timeout: 5 * time.Second,
}, 3)
func (*Client) Object ΒΆ added in v1.0.0
Object returns the Object service interface
Example:
info, err := client.Object().Put(ctx, "my-bucket", "my-object", reader, size)
func (*Client) SetAppInfo ΒΆ
SetAppInfo sets application info appended to the User-Agent header
Parameters:
- appName: application name
- appVersion: application version
type Options ΒΆ
type Options struct {
// Credentials is the credential provider
// Required, used for signing requests
Credentials *credentials.Credentials
// Secure indicates whether to use HTTPS
// Default: false
Secure bool
// Region is the region
// If not set, will be automatically detected
Region string
// Transport is a custom HTTP transport
// If not set, default transport will be used
Transport http.RoundTripper
// Trace is the HTTP trace client
Trace *httptrace.ClientTrace
// BucketLookup is the bucket lookup type
// Default: BucketLookupAuto
BucketLookup types.BucketLookupType
// CustomRegionViaURL is a custom region lookup function
CustomRegionViaURL func(u url.URL) string
// BucketLookupViaURL is a custom bucket lookup function
BucketLookupViaURL func(u url.URL, bucketName string) types.BucketLookupType
// TrailingHeaders enables trailing headers (for streaming upload)
// Requires server support
TrailingHeaders bool
// MaxRetries is the maximum number of retries
// Default: 10, set to 1 to disable retries
MaxRetries int
}
Options contains client configuration options
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
Package bucket bucket/bucket.go
|
Package bucket bucket/bucket.go |
|
Package errors/check.go
|
Package errors/check.go |
|
internal
|
|
|
cache
Package cache internal/cache/location.go
|
Package cache internal/cache/location.go |
|
core
Package core internal/core/executor.go
|
Package core internal/core/executor.go |
|
transport
Package transport internal/transport/trace.go
|
Package transport internal/transport/trace.go |
|
Package object object/copy.go
|
Package object object/copy.go |
|
pkg
|
|
|
credentials
Package credentials provides credential retrieval and management for S3 compatible object storage.
|
Package credentials provides credential retrieval and management for S3 compatible object storage. |
|
signer
Package signer provides AWS Signature Version 4 and Version 2 signing implementations.
|
Package signer provides AWS Signature Version 4 and Version 2 signing implementations. |
|
Package types/bucket.go
|
Package types/bucket.go |