core

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupName             = "BACKUP_NAME"
	CollectionRenameSuffix = "COLLECTION_RENAME_SUFFIX"
	RPS                    = 1000
)
View Source
const (
	HELLO_API          = "/hello"
	CREATE_BACKUP_API  = "/create"
	LIST_BACKUPS_API   = "/list"
	GET_BACKUP_API     = "/get_backup"
	DELETE_BACKUP_API  = "/delete"
	RESTORE_BACKUP_API = "/restore"
	GET_RESTORE_API    = "/get_restore"

	API_V1_PREFIX = "/api/v1"

	DOCS_API = "/docs/*any"

	CHECK_API = "/check"
)

Variables

This section is empty.

Functions

func CreateGrpcClient added in v0.5.0

func CreateGrpcClient(params *paramtable.BackupParams) (milvus.Grpc, error)

func CreateRestfulClient added in v0.5.0

func CreateRestfulClient(params *paramtable.BackupParams) (milvus.Restful, error)

Types

type Backup

type Backup interface {
	// Create backuppb
	CreateBackup(context.Context, *backuppb.CreateBackupRequest) *backuppb.BackupInfoResponse
	// Get backuppb with the chosen name
	GetBackup(context.Context, *backuppb.GetBackupRequest) *backuppb.BackupInfoResponse
	// List backups that contains the given collection name, if collection is not given, return all backups in the cluster
	ListBackups(context.Context, *backuppb.ListBackupsRequest) *backuppb.ListBackupsResponse
	// Delete backuppb by given backuppb name
	DeleteBackup(context.Context, *backuppb.DeleteBackupRequest) *backuppb.DeleteBackupResponse
	// Restore the backup data into milvus
	RestoreBackup(context.Context, *backuppb.RestoreBackupRequest) *backuppb.RestoreBackupResponse
	// Get restore state by given id
	GetRestore(context.Context, *backuppb.GetRestoreStateRequest) *backuppb.RestoreBackupResponse
}

type BackupConfig

type BackupConfig struct {
	// contains filtered or unexported fields
}

BackupConfig for setting params used by backup context and server.

type BackupContext

type BackupContext struct {
	// contains filtered or unexported fields
}

func CreateBackupContext

func CreateBackupContext(ctx context.Context, params *paramtable.BackupParams) *BackupContext

func (*BackupContext) Check

func (b *BackupContext) Check(ctx context.Context) string

func (*BackupContext) Close

func (b *BackupContext) Close() error

func (*BackupContext) CreateBackup

func (*BackupContext) DeleteBackup

func (*BackupContext) GetBackup

func (*BackupContext) GetRestore

func (*BackupContext) ListBackups

func (*BackupContext) RestoreBackup

func (*BackupContext) Start

func (b *BackupContext) Start() error

type BackupOption

type BackupOption func(*BackupConfig)

BackupOption is used to config the retry function.

func Port

func Port(port string) BackupOption

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

func NewHandlers

func NewHandlers(backupContext *BackupContext) *Handlers

NewHandlers creates a new Handlers

func (*Handlers) RegisterRoutesTo

func (h *Handlers) RegisterRoutesTo(router gin.IRouter)

RegisterRouters registers routes to given router

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the Backup Server

func NewServer

func NewServer(ctx context.Context, params *paramtable.BackupParams, opts ...BackupOption) (*Server, error)

func (*Server) Init

func (s *Server) Init()

func (*Server) Start

func (s *Server) Start()

type Task added in v0.5.6

type Task interface {
	// Execute the task, can take long time
	Execute(ctx context.Context) error
}

Directories

Path Synopsis
client
proto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL