dfstore

package
v2.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteObjectInput

type DeleteObjectInput struct {
	// BucketName is bucket name.
	BucketName string

	// ObjectKey is object key.
	ObjectKey string
}

DeleteObjectInput is used to construct request of deleting object.

func (*DeleteObjectInput) Validate

func (i *DeleteObjectInput) Validate() error

Validate validates DeleteObjectInput fields.

type Dfstore

type Dfstore interface {
	// GetObjectMetadataRequestWithContext returns *http.Request of getting object metadata.
	GetObjectMetadataRequestWithContext(ctx context.Context, input *GetObjectMetadataInput) (*http.Request, error)

	// GetObjectMetadataWithContext returns matedata of object.
	GetObjectMetadataWithContext(ctx context.Context, input *GetObjectMetadataInput) (*pkgobjectstorage.ObjectMetadata, error)

	// GetObjectRequestWithContext returns *http.Request of getting object.
	GetObjectRequestWithContext(ctx context.Context, input *GetObjectInput) (*http.Request, error)

	// GetObjectWithContext returns data of object.
	GetObjectWithContext(ctx context.Context, input *GetObjectInput) (io.ReadCloser, error)

	// PutObjectRequestWithContext returns *http.Request of putting object.
	PutObjectRequestWithContext(ctx context.Context, input *PutObjectInput) (*http.Request, error)

	// PutObjectWithContext puts data of object.
	PutObjectWithContext(ctx context.Context, input *PutObjectInput) error

	// DeleteObjectRequestWithContext returns *http.Request of deleting object.
	DeleteObjectRequestWithContext(ctx context.Context, input *DeleteObjectInput) (*http.Request, error)

	// DeleteObjectWithContext deletes data of object.
	DeleteObjectWithContext(ctx context.Context, input *DeleteObjectInput) error

	// IsObjectExistRequestWithContext returns *http.Request of heading object.
	IsObjectExistRequestWithContext(ctx context.Context, input *IsObjectExistInput) (*http.Request, error)

	// IsObjectExistWithContext returns whether the object exists.
	IsObjectExistWithContext(ctx context.Context, input *IsObjectExistInput) (bool, error)
}

Dfstore is the interface used for object storage.

func New

func New(endpoint string, options ...Option) Dfstore

New dfstore instance.

type GetObjectInput

type GetObjectInput struct {
	// BucketName is bucket name.
	BucketName string

	// ObjectKey is object key.
	ObjectKey string

	// Filter is used to generate a unique Task ID by
	// filtering unnecessary query params in the URL,
	// it is separated by & character.
	Filter string

	// Range is the HTTP range header.
	Range string
}

GetObjectInput is used to construct request of getting object.

func (*GetObjectInput) Validate

func (i *GetObjectInput) Validate() error

Validate validates GetObjectInput fields.

type GetObjectMetadataInput added in v2.0.5

type GetObjectMetadataInput struct {
	// BucketName is bucket name.
	BucketName string

	// ObjectKey is object key.
	ObjectKey string
}

GetObjectMetadataInput is used to construct request of getting object metadata.

func (*GetObjectMetadataInput) Validate added in v2.0.5

func (i *GetObjectMetadataInput) Validate() error

Validate validates GetObjectMetadataInput fields.

type IsObjectExistInput

type IsObjectExistInput struct {
	// BucketName is bucket name.
	BucketName string

	// ObjectKey is object key.
	ObjectKey string
}

IsObjectExistInput is used to construct request of heading object.

func (*IsObjectExistInput) Validate

func (i *IsObjectExistInput) Validate() error

Validate validates IsObjectExistInput fields.

type Option

type Option func(dfs *dfstore)

Option is a functional option for configuring the dfstore.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient set http client for dfstore.

type PutObjectInput added in v2.0.9

type PutObjectInput struct {
	// BucketName is bucket name.
	BucketName string

	// ObjectKey is object key.
	ObjectKey string

	// Filter is used to generate a unique Task ID by
	// filtering unnecessary query params in the URL,
	// it is separated by & character.
	Filter string

	// Mode is the mode in which the backend is written,
	// including WriteBack and AsyncWriteBack.
	Mode int

	// MaxReplicas is the maximum number of
	// replicas of an object cache in seed peers.
	MaxReplicas int

	// Reader is reader of object.
	Reader io.Reader
}

PutObjectInput is used to construct request of putting object.

func (*PutObjectInput) Validate added in v2.0.9

func (i *PutObjectInput) Validate() error

Validate validates PutObjectInput fields.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL