Documentation
¶
Index ¶
- Variables
- func ResponseError(r *fasthttp.RequestCtx, msg string, code int)
- type AppParams
- type BrowsePageData
- type Config
- type ContainerContract
- type ContainerResolver
- type FrostFS
- type GetObjectsResponse
- type Handler
- func (h *Handler) DownloadByAddressOrBucketName(req *fasthttp.RequestCtx)
- func (h *Handler) DownloadByAttribute(req *fasthttp.RequestCtx)
- func (h *Handler) DownloadTar(req *fasthttp.RequestCtx)
- func (h *Handler) DownloadZip(req *fasthttp.RequestCtx)
- func (h *Handler) HeadByAddressOrBucketName(req *fasthttp.RequestCtx)
- func (h *Handler) HeadByAttribute(req *fasthttp.RequestCtx)
- func (h *Handler) Preflight(req *fasthttp.RequestCtx)
- func (h *Handler) SetCORSHeaders(req *fasthttp.RequestCtx)
- func (h *Handler) Upload(req *fasthttp.RequestCtx)
- type ListFunc
- type Middleware
- type MiddlewareFunc
- type MiddlewareParam
- type MultipartFile
- type Object
- type ObjectHandlerFunc
- type PrmAuth
- type PrmContainer
- type PrmInitMultiObjectReader
- type PrmObjectCreate
- type PrmObjectGet
- type PrmObjectHead
- type PrmObjectRange
- type PrmObjectSearch
- type ResObjectSearch
- type ResponseObject
- type ResponseObjectExtended
- 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) GetContainerByID(cid cid.ID) (*container.Container, error)
- func (t *TestFrostFS) GetEpochDurations(context.Context) (*utils.EpochDurations, error)
- func (t *TestFrostFS) GetObject(_ context.Context, prm PrmObjectGet) (*Object, error)
- func (t *TestFrostFS) HeadObject(_ context.Context, prm PrmObjectHead) (*object.Object, error)
- func (t *TestFrostFS) InitMultiObjectReader(context.Context, PrmInitMultiObjectReader) (io.Reader, error)
- func (t *TestFrostFS) RangeObject(_ context.Context, prm PrmObjectRange) (io.ReadCloser, error)
- func (t *TestFrostFS) SearchObjects(_ context.Context, prm PrmObjectSearch) (ResObjectSearch, error)
- func (t *TestFrostFS) SetContainer(cnrID cid.ID, cnr *container.Container)
- func (t *TestFrostFS) SetObject(addr oid.Address, obj *object.Object)
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") // ErrQuotaLimitReached is returned from FrostFS in case of quota exceeded. ErrQuotaLimitReached = errors.New("quota limit reached") // ErrContainerNotFound is returned from FrostFS in case of container was not found. ErrContainerNotFound = errors.New("container not found") // ErrObjectNotFound is returned from FrostFS in case of object was not found. ErrObjectNotFound = errors.New("object not found") )
var (
ErrEmptyBrowsePage = errors.New("empty browse page")
)
Functions ¶
func ResponseError ¶ added in v0.33.0
func ResponseError(r *fasthttp.RequestCtx, msg string, code int)
Types ¶
type AppParams ¶ added in v0.30.0
type AppParams struct {
Logger *zap.Logger
FrostFS FrostFS
Owner *user.ID
Resolver ContainerResolver
Cache *cache.BucketCache
CORSCache *cache.CORSCache
}
type BrowsePageData ¶ added in v0.31.0
type Config ¶ added in v0.29.0
type Config interface {
DefaultTimestamp() bool
ArchiveCompression() bool
ClientCut() bool
IndexPageEnabled() bool
IndexPageTemplate() string
BufferMaxSizeForPut() uint64
MaxResponseAttributeSize() uint64
NamespaceHeader() string
EnableFilepathFallback() bool
EnableFilepathSlashFallback() bool
FormContainerZone(string) string
CORS() *data.CORSRule
CORSContainerID() *cid.ID
}
type ContainerContract ¶ added in v0.33.0
type ContainerResolver ¶ added in v0.30.0
type FrostFS ¶ added in v0.30.0
type FrostFS interface {
Container(context.Context, PrmContainer) (*container.Container, error)
HeadObject(context.Context, PrmObjectHead) (*object.Object, error)
GetObject(context.Context, PrmObjectGet) (*Object, error)
RangeObject(context.Context, PrmObjectRange) (io.ReadCloser, error)
CreateObject(context.Context, PrmObjectCreate) (oid.ID, error)
SearchObjects(context.Context, PrmObjectSearch) (ResObjectSearch, error)
InitMultiObjectReader(ctx context.Context, p PrmInitMultiObjectReader) (io.Reader, error)
utils.EpochInfoFetcher
}
FrostFS represents virtual connection to FrostFS network.
type GetObjectsResponse ¶ added in v0.31.0
type GetObjectsResponse struct {
// contains filtered or unexported fields
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) DownloadByAddressOrBucketName ¶
func (h *Handler) DownloadByAddressOrBucketName(req *fasthttp.RequestCtx)
DownloadByAddressOrBucketName handles download requests using simple cid/oid or bucketname/key format.
func (*Handler) DownloadByAttribute ¶
func (h *Handler) DownloadByAttribute(req *fasthttp.RequestCtx)
DownloadByAttribute handles attribute-based download requests.
func (*Handler) DownloadTar ¶ added in v0.33.0
func (h *Handler) DownloadTar(req *fasthttp.RequestCtx)
DownloadTar forms tar.gz from objects by prefix.
func (*Handler) DownloadZip ¶ added in v0.33.0
func (h *Handler) DownloadZip(req *fasthttp.RequestCtx)
DownloadZip handles zip by prefix requests.
func (*Handler) HeadByAddressOrBucketName ¶
func (h *Handler) HeadByAddressOrBucketName(req *fasthttp.RequestCtx)
HeadByAddressOrBucketName handles head requests using simple cid/oid or bucketname/key format.
func (*Handler) HeadByAttribute ¶
func (h *Handler) HeadByAttribute(req *fasthttp.RequestCtx)
HeadByAttribute handles attribute-based head requests.
func (*Handler) Preflight ¶ added in v0.33.0
func (h *Handler) Preflight(req *fasthttp.RequestCtx)
func (*Handler) SetCORSHeaders ¶ added in v0.33.0
func (h *Handler) SetCORSHeaders(req *fasthttp.RequestCtx)
func (*Handler) Upload ¶
func (h *Handler) Upload(req *fasthttp.RequestCtx)
Upload handles multipart upload request.
type ListFunc ¶ added in v0.33.0
type ListFunc func(ctx context.Context, bucketInfo *data.BucketInfo, prefix string) (*GetObjectsResponse, error)
type Middleware ¶ added in v0.33.0
type Middleware struct {
Func MiddlewareFunc
Enabled bool
}
type MiddlewareFunc ¶ added in v0.33.0
type MiddlewareFunc func(param MiddlewareParam) bool
type MiddlewareParam ¶ added in v0.33.0
type MiddlewareParam struct {
Context context.Context
Request *fasthttp.RequestCtx
BktInfo *data.BucketInfo
Path string
}
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 Object ¶ added in v0.30.3
type Object struct {
// Object header (doesn't contain payload).
Header object.Object
// Object payload part encapsulated in io.Reader primitive.
// Returns ErrAccessDenied on read access violation.
Payload io.ReadCloser
}
Object represents FrostFS object.
type ObjectHandlerFunc ¶ added in v0.33.0
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 PrmInitMultiObjectReader ¶ added in v0.30.3
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 PrmObjectGet ¶ added in v0.30.3
type PrmObjectGet struct {
// Authentication parameters.
PrmAuth
// Address to read the object header from.
Address oid.Address
}
PrmObjectGet groups parameters of FrostFS.GetObject operation.
type PrmObjectHead ¶ added in v0.30.3
type PrmObjectHead struct {
// Authentication parameters.
PrmAuth
// Address to read the object header from.
Address oid.Address
}
PrmObjectHead groups parameters of FrostFS.HeadObject operation.
type PrmObjectRange ¶ added in v0.30.3
type PrmObjectRange 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
}
PrmObjectRange groups parameters of FrostFS.RangeObject 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 ResponseObject ¶ added in v0.31.0
type ResponseObjectExtended ¶ added in v0.31.0
type ResponseObjectExtended struct {
Object ResponseObject
Error error
}
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) GetContainerByID ¶ added in v0.33.0
func (*TestFrostFS) GetEpochDurations ¶ added in v0.30.0
func (t *TestFrostFS) GetEpochDurations(context.Context) (*utils.EpochDurations, error)
func (*TestFrostFS) GetObject ¶ added in v0.30.3
func (t *TestFrostFS) GetObject(_ context.Context, prm PrmObjectGet) (*Object, error)
func (*TestFrostFS) HeadObject ¶ added in v0.30.3
func (t *TestFrostFS) HeadObject(_ context.Context, prm PrmObjectHead) (*object.Object, error)
func (*TestFrostFS) InitMultiObjectReader ¶ added in v0.30.3
func (t *TestFrostFS) InitMultiObjectReader(context.Context, PrmInitMultiObjectReader) (io.Reader, error)
func (*TestFrostFS) RangeObject ¶ added in v0.30.3
func (t *TestFrostFS) RangeObject(_ context.Context, prm PrmObjectRange) (io.ReadCloser, 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. |