Files
open-im-server/internal/rpc/third/s3.go
T

38 lines
1.1 KiB
Go
Raw Normal View History

2023-03-01 15:32:26 +08:00
package third
2023-03-03 17:20:36 +08:00
import (
"context"
2023-03-16 10:46:06 +08:00
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third"
2023-03-06 16:40:57 +08:00
"time"
2023-03-03 17:20:36 +08:00
)
func (t *thirdServer) ApplyPut(ctx context.Context, req *third.ApplyPutReq) (*third.ApplyPutResp, error) {
return t.s3dataBase.ApplyPut(ctx, req)
}
func (t *thirdServer) GetPut(ctx context.Context, req *third.GetPutReq) (*third.GetPutResp, error) {
return t.s3dataBase.GetPut(ctx, req)
}
func (t *thirdServer) ConfirmPut(ctx context.Context, req *third.ConfirmPutReq) (*third.ConfirmPutResp, error) {
return t.s3dataBase.ConfirmPut(ctx, req)
}
2023-03-06 16:40:57 +08:00
2023-03-14 19:33:44 +08:00
func (t *thirdServer) GetUrl(ctx context.Context, req *third.GetUrlReq) (*third.GetUrlResp, error) {
2023-03-15 11:24:59 +08:00
if req.Expires <= 0 {
if err := tokenverify.CheckAdmin(ctx); err != nil {
return nil, err
}
}
2023-03-14 19:33:44 +08:00
return t.s3dataBase.GetUrl(ctx, req)
}
2023-03-29 18:33:02 +08:00
func (t *thirdServer) GetHashInfo(ctx context.Context, req *third.GetHashInfoReq) (*third.GetHashInfoResp, error) {
2023-03-29 18:41:30 +08:00
return t.s3dataBase.GetHashInfo(ctx, req)
2023-03-29 18:33:02 +08:00
}
2023-03-06 16:40:57 +08:00
func (t *thirdServer) CleanObject(ctx context.Context, now time.Time) {
2023-03-07 11:12:39 +08:00
t.s3dataBase.CleanExpirationObject(ctx, now)
2023-03-06 16:40:57 +08:00
}