mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
JSONrpc: implement removeObject RPC call
This commit is contained in:
parent
3a55d05eff
commit
3a8fff46f9
@ -52,6 +52,13 @@ type GetObjectURLArgs struct {
|
||||
ObjectName string `json:"objectName"`
|
||||
}
|
||||
|
||||
// RemoveObjectArgs - args to remove an object
|
||||
type RemoveObjectArgs struct {
|
||||
TargetHost string `json:"targetHost"`
|
||||
BucketName string `json:"bucketName"`
|
||||
ObjectName string `json:"objectName"`
|
||||
}
|
||||
|
||||
// BucketInfo container for list buckets metadata.
|
||||
type BucketInfo struct {
|
||||
// The name of the bucket.
|
||||
|
@ -214,6 +214,20 @@ func (web *WebAPI) GetObjectURL(r *http.Request, args *GetObjectURLArgs, reply *
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemoveObject - removes an object.
|
||||
func (web *WebAPI) RemoveObject(r *http.Request, args *RemoveObjectArgs, reply *int) error {
|
||||
if !isAuthenticated(r) {
|
||||
return errUnAuthorizedRequest
|
||||
}
|
||||
|
||||
e := web.Client.RemoveObject(args.BucketName, args.ObjectName)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
*reply = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// Login - user login handler.
|
||||
func (web *WebAPI) Login(r *http.Request, args *LoginArgs, reply *AuthToken) error {
|
||||
jwt := InitJWT()
|
||||
|
Loading…
Reference in New Issue
Block a user