Files
open-im-server/pkg/common/storage/database/object.go
T

35 lines
1.4 KiB
Go
Raw Normal View History

2023-07-04 11:15:20 +08:00
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package database
2023-06-30 09:45:02 +08:00
import (
"context"
2024-07-16 10:46:21 +08:00
"time"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
2023-06-30 09:45:02 +08:00
)
type ObjectInfo interface {
SetObject(ctx context.Context, obj *model.Object) error
Take(ctx context.Context, engine string, name string) (*model.Object, error)
2024-12-20 15:45:37 +08:00
Delete(ctx context.Context, engine string, name []string) error
FindExpirationObject(ctx context.Context, engine string, expiration time.Time, needDelType []string, count int64) ([]*model.Object, error)
GetKeyCount(ctx context.Context, engine string, key string) (int64, error)
2025-01-02 17:15:38 +08:00
GetEngineCount(ctx context.Context, engine string) (int64, error)
GetEngineInfo(ctx context.Context, engine string, limit int, skip int) ([]*model.Object, error)
UpdateEngine(ctx context.Context, oldEngine, oldName string, newEngine string) error
2023-06-30 09:45:02 +08:00
}