Documentation
¶
Index ¶
- Variables
- type AppParams
- type Config
- type ContainerResolver
- type FrostFS
- type Handler
- func (h *Handler) DownloadByAddressOrBucketName(c *fasthttp.RequestCtx)
- func (h *Handler) DownloadByAttribute(c *fasthttp.RequestCtx)
- func (h *Handler) DownloadZipped(c *fasthttp.RequestCtx)
- func (h *Handler) HeadByAddressOrBucketName(c *fasthttp.RequestCtx)
- func (h *Handler) HeadByAttribute(c *fasthttp.RequestCtx)
- func (h *Handler) Upload(req *fasthttp.RequestCtx)
- type MultipartFile
- type ObjectPart
- type PrmAuth
- type PrmContainer
- type PrmObjectCreate
- type PrmObjectRead
- type PrmObjectSearch
- type ResObjectSearch
- type TestFrostFS
- func (t *TestFrostFS) AllowUserOperation(cnrID cid.ID, userID user.ID, op acl.Op, objID oid.ID)
- func (t *TestFrostFS) Container(_ context.Context, prm PrmContainer) (*container.Container, error)
- func (t *TestFrostFS) ContainerID(name string) (*cid.ID, error)
- func (t *TestFrostFS) CreateObject(_ context.Context, prm PrmObjectCreate) (oid.ID, error)
- func (t *TestFrostFS) GetEpochDurations(context.Context) (*utils.EpochDurations, error)
- func (t *TestFrostFS) ReadObject(_ context.Context, prm PrmObjectRead) (*ObjectPart, error)
- func (t *TestFrostFS) SearchObjects(_ context.Context, prm PrmObjectSearch) (ResObjectSearch, error)
- func (t *TestFrostFS) SetContainer(cnrID cid.ID, cnr *container.Container)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAccessDenied is returned from FrostFS in case of access violation. ErrAccessDenied = errors.New("access denied") // ErrGatewayTimeout is returned from FrostFS in case of timeout, deadline exceeded etc. ErrGatewayTimeout = errors.New("gateway timeout") )
Functions ¶
This section is empty.
Types ¶
type AppParams ¶ added in v0.30.0
type AppParams struct {
Logger *zap.Logger
FrostFS FrostFS
Owner *user.ID
Resolver ContainerResolver
Cache *cache.BucketCache
}
type ContainerResolver ¶ added in v0.30.0
type FrostFS ¶ added in v0.30.0
type FrostFS interface {
Container(context.Context, PrmContainer) (*container.Container, error)
ReadObject(context.Context, PrmObjectRead) (*ObjectPart, error)
CreateObject(context.Context, PrmObjectCreate) (oid.ID, error)
SearchObjects(context.Context, PrmObjectSearch) (ResObjectSearch, error)
utils.EpochInfoFetcher
}
FrostFS represents virtual connection to FrostFS network.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) DownloadByAddressOrBucketName ¶
func (h *Handler) DownloadByAddressOrBucketName(c *fasthttp.RequestCtx)
DownloadByAddressOrBucketName handles download requests using simple cid/oid or bucketname/key format.
func (*Handler) DownloadByAttribute ¶
func (h *Handler) DownloadByAttribute(c *fasthttp.RequestCtx)
DownloadByAttribute handles attribute-based download requests.
func (*Handler) DownloadZipped ¶
func (h *Handler) DownloadZipped(c *fasthttp.RequestCtx)
DownloadZipped handles zip by prefix requests.
func (*Handler) HeadByAddressOrBucketName ¶
func (h *Handler) HeadByAddressOrBucketName(c *fasthttp.RequestCtx)
HeadByAddressOrBucketName handles head requests using simple cid/oid or bucketname/key format.
func (*Handler) HeadByAttribute ¶
func (h *Handler) HeadByAttribute(c *fasthttp.RequestCtx)
HeadByAttribute handles attribute-based head requests.
func (*Handler) Upload ¶
func (h *Handler) Upload(req *fasthttp.RequestCtx)
Upload handles multipart upload request.
type MultipartFile ¶
type MultipartFile interface {
io.ReadCloser
FileName() string
}
MultipartFile provides standard ReadCloser interface and also allows one to get file name, it's used for multipart uploads.
type ObjectPart ¶ added in v0.30.0
type ObjectPart struct {
// Object header with optional in-memory payload part.
Head *object.Object
// Object payload part encapsulated in io.Reader primitive.
// Returns ErrAccessDenied on read access violation.
Payload io.ReadCloser
}
ObjectPart represents partially read FrostFS object.
type PrmAuth ¶ added in v0.30.0
type PrmAuth struct {
// Bearer token to be used for the operation. Overlaps PrivateKey. Optional.
BearerToken *bearer.Token
}
PrmAuth groups authentication parameters for the FrostFS operation.
type PrmContainer ¶ added in v0.30.0
PrmContainer groups parameters of FrostFS.Container operation.
type PrmObjectCreate ¶ added in v0.30.0
type PrmObjectCreate struct {
// Authentication parameters.
PrmAuth
Object *object.Object
// Object payload encapsulated in io.Reader primitive.
Payload io.Reader
// Enables client side object preparing.
ClientCut bool
// Disables using Tillich-Zémor hash for payload.
WithoutHomomorphicHash bool
// Sets max buffer size to read payload.
BufferMaxSize uint64
}
PrmObjectCreate groups parameters of FrostFS.CreateObject operation.
type PrmObjectRead ¶ added in v0.30.0
type PrmObjectRead struct {
// Authentication parameters.
PrmAuth
// Address to read the object header from.
Address oid.Address
// Offset-length range of the object payload to be read.
PayloadRange [2]uint64
}
PrmObjectRead groups parameters of FrostFS.ReadObject operation.
type PrmObjectSearch ¶ added in v0.30.0
type PrmObjectSearch struct {
// Authentication parameters.
PrmAuth
// Container to select the objects from.
Container cid.ID
Filters object.SearchFilters
}
PrmObjectSearch groups parameters of FrostFS.sear SearchObjects operation.
type ResObjectSearch ¶ added in v0.30.0
type TestFrostFS ¶ added in v0.30.0
type TestFrostFS struct {
// contains filtered or unexported fields
}
func NewTestFrostFS ¶ added in v0.30.0
func NewTestFrostFS(key *keys.PrivateKey) *TestFrostFS
func (*TestFrostFS) AllowUserOperation ¶ added in v0.30.0
AllowUserOperation grants access to object operations. Empty userID and objID means any user and object respectively.
func (*TestFrostFS) Container ¶ added in v0.30.0
func (t *TestFrostFS) Container(_ context.Context, prm PrmContainer) (*container.Container, error)
func (*TestFrostFS) ContainerID ¶ added in v0.30.0
func (t *TestFrostFS) ContainerID(name string) (*cid.ID, error)
func (*TestFrostFS) CreateObject ¶ added in v0.30.0
func (t *TestFrostFS) CreateObject(_ context.Context, prm PrmObjectCreate) (oid.ID, error)
func (*TestFrostFS) GetEpochDurations ¶ added in v0.30.0
func (t *TestFrostFS) GetEpochDurations(context.Context) (*utils.EpochDurations, error)
func (*TestFrostFS) ReadObject ¶ added in v0.30.0
func (t *TestFrostFS) ReadObject(_ context.Context, prm PrmObjectRead) (*ObjectPart, error)
func (*TestFrostFS) SearchObjects ¶ added in v0.30.0
func (t *TestFrostFS) SearchObjects(_ context.Context, prm PrmObjectSearch) (ResObjectSearch, error)
func (*TestFrostFS) SetContainer ¶ added in v0.30.0
func (t *TestFrostFS) SetContainer(cnrID cid.ID, cnr *container.Container)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package multipart implements MIME multipart parsing, as defined in RFC 2046.
|
Package multipart implements MIME multipart parsing, as defined in RFC 2046. |