Documentation ¶
Index ¶
- Constants
- func IsObjectToken(token apiserver.Bearer) (bool, error)
- type BearerToken
- type PrmAPI
- type PrmAttributes
- type RestAPI
- func (a *RestAPI) Auth(ctx echo.Context, params apiserver.AuthParams) error
- func (a *RestAPI) DeleteContainer(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) DeleteObject(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) FormBinaryBearer(ctx echo.Context, params apiserver.FormBinaryBearerParams) error
- func (a *RestAPI) GetBalance(ctx echo.Context, address string) error
- func (a *RestAPI) GetByAttribute(ctx echo.Context, containerID apiserver.ContainerId, attrKey apiserver.AttrKey, ...) error
- func (a *RestAPI) GetContainer(ctx echo.Context, containerID apiserver.ContainerId) error
- func (a *RestAPI) GetContainerEACL(ctx echo.Context, containerID apiserver.ContainerId) error
- func (a *RestAPI) GetContainerObject(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) GetNetworkInfo(ctx echo.Context) error
- func (a *RestAPI) GetObjectInfo(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) HeadByAttribute(ctx echo.Context, containerID apiserver.ContainerId, attrKey apiserver.AttrKey, ...) error
- func (a *RestAPI) HeadContainerObject(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) ListContainers(ctx echo.Context, params apiserver.ListContainersParams) error
- func (a *RestAPI) OptionsAuth(ctx echo.Context) error
- func (a *RestAPI) OptionsAuthBearer(ctx echo.Context) error
- func (a *RestAPI) OptionsBalance(ctx echo.Context, _ string) error
- func (a *RestAPI) OptionsByAttribute(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.AttrKey, ...) error
- func (a *RestAPI) OptionsContainerObject(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.ObjectId) error
- func (a *RestAPI) OptionsContainersEACL(ctx echo.Context, _ apiserver.ContainerId) error
- func (a *RestAPI) OptionsContainersGetDelete(ctx echo.Context, _ apiserver.ContainerId) error
- func (a *RestAPI) OptionsContainersPutList(ctx echo.Context) error
- func (a *RestAPI) OptionsNetworkInfo(ctx echo.Context) error
- func (a *RestAPI) OptionsObjectsGetDelete(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.ObjectId) error
- func (a *RestAPI) OptionsObjectsPut(ctx echo.Context) error
- func (a *RestAPI) OptionsObjectsSearch(ctx echo.Context, _ string) error
- func (a *RestAPI) OptionsUploadContainerObject(ctx echo.Context, _ apiserver.ContainerId) error
- func (a *RestAPI) PutContainer(ctx echo.Context, params apiserver.PutContainerParams) error
- func (a *RestAPI) PutContainerEACL(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) PutObject(ctx echo.Context, params apiserver.PutObjectParams) error
- func (a *RestAPI) RunServices()
- func (a *RestAPI) SearchObjects(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- func (a *RestAPI) StartCallback()
- func (a *RestAPI) UploadContainerObject(ctx echo.Context, containerID apiserver.ContainerId, ...) error
- type SessionToken
Constants ¶
const ( SystemAttributePrefix = "__NEOFS__" ExpirationDurationAttr = SystemAttributePrefix + "EXPIRATION_DURATION" ExpirationTimestampAttr = SystemAttributePrefix + "EXPIRATION_TIMESTAMP" ExpirationRFC3339Attr = SystemAttributePrefix + "EXPIRATION_RFC3339" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BearerToken ¶
type PrmAPI ¶
type PrmAPI struct { Logger *zap.Logger Pool *pool.Pool Key *keys.PrivateKey DefaultTimestamp bool MaxObjectSize int64 GateMetric *metrics.GateMetrics PrometheusService *metrics.Service PprofService *metrics.Service ServiceShutdownTimeout time.Duration }
PrmAPI groups parameters to init rest API.
type PrmAttributes ¶
PrmAttributes groups parameters to form attributes from request headers.
type RestAPI ¶
type RestAPI struct {
// contains filtered or unexported fields
}
RestAPI is a REST v1 request handler.
func NewAPI ¶
NewAPI creates a new RestAPI using specified logger, connection pool and other parameters.
func (*RestAPI) Auth ¶
func (a *RestAPI) Auth(ctx echo.Context, params apiserver.AuthParams) error
Auth handler that forms bearer token to sign.
func (*RestAPI) DeleteContainer ¶
func (a *RestAPI) DeleteContainer(ctx echo.Context, containerID apiserver.ContainerId, params apiserver.DeleteContainerParams) error
DeleteContainer handler that returns container info.
func (*RestAPI) DeleteObject ¶
func (a *RestAPI) DeleteObject(ctx echo.Context, containerID apiserver.ContainerId, objectID apiserver.ObjectId, params apiserver.DeleteObjectParams) error
DeleteObject handler that removes object from NeoFS.
func (*RestAPI) FormBinaryBearer ¶
func (a *RestAPI) FormBinaryBearer(ctx echo.Context, params apiserver.FormBinaryBearerParams) error
FormBinaryBearer handler that forms binary bearer token using headers with body and signature.
func (*RestAPI) GetBalance ¶
GetBalance handler that get balance from NeoFS.
func (*RestAPI) GetByAttribute ¶
func (a *RestAPI) GetByAttribute(ctx echo.Context, containerID apiserver.ContainerId, attrKey apiserver.AttrKey, attrVal apiserver.AttrVal, params apiserver.GetByAttributeParams) error
GetByAttribute handler that returns object (payload and attributes) by a specific attribute.
func (*RestAPI) GetContainer ¶
func (a *RestAPI) GetContainer(ctx echo.Context, containerID apiserver.ContainerId) error
GetContainer handler that returns container info.
func (*RestAPI) GetContainerEACL ¶
func (a *RestAPI) GetContainerEACL(ctx echo.Context, containerID apiserver.ContainerId) error
GetContainerEACL handler that returns container eacl.
func (*RestAPI) GetContainerObject ¶
func (a *RestAPI) GetContainerObject(ctx echo.Context, containerID apiserver.ContainerId, objectID apiserver.ObjectId, params apiserver.GetContainerObjectParams) error
func (*RestAPI) GetNetworkInfo ¶
func (*RestAPI) GetObjectInfo ¶
func (a *RestAPI) GetObjectInfo(ctx echo.Context, containerID apiserver.ContainerId, objectID apiserver.ObjectId, params apiserver.GetObjectInfoParams) error
GetObjectInfo handler that get object info.
func (*RestAPI) HeadByAttribute ¶
func (a *RestAPI) HeadByAttribute(ctx echo.Context, containerID apiserver.ContainerId, attrKey apiserver.AttrKey, attrVal apiserver.AttrVal, params apiserver.HeadByAttributeParams) error
HeadByAttribute handler that returns object info (payload and attributes) by a specific attribute.
func (*RestAPI) HeadContainerObject ¶
func (a *RestAPI) HeadContainerObject(ctx echo.Context, containerID apiserver.ContainerId, objectID apiserver.ObjectId, params apiserver.HeadContainerObjectParams) error
HeadContainerObject handler that returns object info (using container ID and object ID).
func (*RestAPI) ListContainers ¶
func (a *RestAPI) ListContainers(ctx echo.Context, params apiserver.ListContainersParams) error
ListContainers handler that returns containers.
func (*RestAPI) OptionsAuth ¶
OptionsAuth handler for the auth options request.
func (*RestAPI) OptionsAuthBearer ¶
OptionsAuthBearer handler for the authBearer options request.
func (*RestAPI) OptionsBalance ¶
OptionsBalance handler for the balance options request.
func (*RestAPI) OptionsByAttribute ¶
func (a *RestAPI) OptionsByAttribute(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.AttrKey, _ apiserver.AttrVal) error
OptionsByAttribute handler for the byAttribute options request.
func (*RestAPI) OptionsContainerObject ¶
func (a *RestAPI) OptionsContainerObject(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.ObjectId) error
OptionsContainerObject handler for the containerObject options request.
func (*RestAPI) OptionsContainersEACL ¶
func (a *RestAPI) OptionsContainersEACL(ctx echo.Context, _ apiserver.ContainerId) error
OptionsContainersEACL handler for the containersEACL options request.
func (*RestAPI) OptionsContainersGetDelete ¶
func (a *RestAPI) OptionsContainersGetDelete(ctx echo.Context, _ apiserver.ContainerId) error
OptionsContainersGetDelete handler for the containersGetDelete options request.
func (*RestAPI) OptionsContainersPutList ¶
OptionsContainersPutList handler for the containersPutList options request.
func (*RestAPI) OptionsNetworkInfo ¶
OptionsNetworkInfo handler for the network options request.
func (*RestAPI) OptionsObjectsGetDelete ¶
func (a *RestAPI) OptionsObjectsGetDelete(ctx echo.Context, _ apiserver.ContainerId, _ apiserver.ObjectId) error
OptionsObjectsGetDelete handler for the objectsGetDelete options request.
func (*RestAPI) OptionsObjectsPut ¶
OptionsObjectsPut handler for the objectsPut options request.
func (*RestAPI) OptionsObjectsSearch ¶
OptionsObjectsSearch handler for the objectsSearch options request.
func (*RestAPI) OptionsUploadContainerObject ¶
func (a *RestAPI) OptionsUploadContainerObject(ctx echo.Context, _ apiserver.ContainerId) error
OptionsUploadContainerObject handler for the uploadContainerObject options request.
func (*RestAPI) PutContainer ¶
func (a *RestAPI) PutContainer(ctx echo.Context, params apiserver.PutContainerParams) error
PutContainer handler that creates container in NeoFS.
func (*RestAPI) PutContainerEACL ¶
func (a *RestAPI) PutContainerEACL(ctx echo.Context, containerID apiserver.ContainerId, params apiserver.PutContainerEACLParams) error
PutContainerEACL handler that update container eacl.
func (*RestAPI) PutObject ¶
func (a *RestAPI) PutObject(ctx echo.Context, params apiserver.PutObjectParams) error
PutObject handler that uploads object to NeoFS.
func (*RestAPI) RunServices ¶
func (a *RestAPI) RunServices()
func (*RestAPI) SearchObjects ¶
func (a *RestAPI) SearchObjects(ctx echo.Context, containerID apiserver.ContainerId, params apiserver.SearchObjectsParams) error
SearchObjects handler that searches object in NeoFS.
func (*RestAPI) StartCallback ¶
func (a *RestAPI) StartCallback()
func (*RestAPI) UploadContainerObject ¶
func (a *RestAPI) UploadContainerObject(ctx echo.Context, containerID apiserver.ContainerId, _ apiserver.UploadContainerObjectParams) error
UploadContainerObject handler that upload file as object with attributes to NeoFS.
type SessionToken ¶
type SessionToken struct { BearerToken Verb session.ContainerVerb }