system

package
v0.0.0-...-fee78ac Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nanosecond  time.Duration = 1
	Microsecond               = 1000 * Nanosecond
	Millisecond               = 1000 * Microsecond
	Second                    = 1000 * Millisecond
	Minute                    = 60 * Second
	Hour                      = 60 * Minute
	Day                       = 24 * Hour

	TIME_UNIT_NANOSECOND  TimeUnit = "ns"
	TIME_UNIT_MICROSECOND TimeUnit = "us"
	TIME_UNIT_MILLISECOND TimeUnit = "ms"
	TIME_UNIT_SECOND      TimeUnit = "s"
	TIME_UNIT_MINUTE      TimeUnit = "m"
	TIME_UNIT_HOUR        TimeUnit = "h"
	TIME_UNIT_DAY         TimeUnit = "d"
)

Variables

This section is empty.

Functions

func CheckRestoreTime

func CheckRestoreTime(dataURI, logURI string, scn int64) (err error)

func CopyDirs

func CopyDirs(src, dest string) (err error)

func CopyFile

func CopyFile(src, dest string) error

func ExecCommand

func ExecCommand(command string) (string, error)

func GetAddressList

func GetAddressList() ([]string, error)

func GetAllAddressList

func GetAllAddressList() ([]string, error)

func GetBinaryVersion

func GetBinaryVersion(path string) (string, error)

func GetFsId

func GetFsId(path string) (string, syscall.Fsid, error)

func GetResourceType

func GetResourceType(uri string) (t string, err error)

func IsDirEmpty

func IsDirEmpty(path string) (bool, error)

func IsFileExist

func IsFileExist(path string) bool

func ParseTime

func ParseTime(s string) (duration time.Duration, err error)

func ParseTimeWithRange

func ParseTimeWithRange(s string, minUnit, maxUnit time.Duration) (duration time.Duration, err error)

func RemoveDuplicates

func RemoveDuplicates(items []string) []string

Types

type ArchiveInfo

type ArchiveInfo struct {
	Key           TenantKey `json:"key"`
	StartSCN      SCN       `json:"start_scn"`
	CheckPointSCN SCN       `json:"checkpoint_scn"`
}

ArchiveInfo contains the information of archive log, which only contains the key, start scn and checkpoint scn but not the display time of scn.

type BackupSet

type BackupSet struct {
	TenantKey
	BackupSetID         int  `json:"backup_set_id"`
	PlusArchivelog      bool `json:"plus_archivelog"`
	PrevFullBackupSetID int  `json:"prev_full_backup_set_id"`
	PrevIncBackupSetID  int  `json:"prev_inc_backup_set_id"`
	StartReplaySCN      SCN  `json:"start_replay_scn"`
	MinRestoreSCN       SCN  `json:"min_restore_scn"`
}

type BaseConf

type BaseConf struct {
	BucketName string
	ObjectKey  string
	Host       string
	AccessID   string
	AccessKey  string
	DeleteMode string
}

type COSConfig

type COSConfig struct {
	BaseConf
	AppID string
}

func (*COSConfig) CheckWritePermission

func (c *COSConfig) CheckWritePermission() error

func (*COSConfig) GenerateQueryParams

func (c *COSConfig) GenerateQueryParams() string

func (*COSConfig) GenerateURI

func (c *COSConfig) GenerateURI() (res string)

func (*COSConfig) GenerateURIWhitoutParams

func (c *COSConfig) GenerateURIWhitoutParams() string

func (*COSConfig) GenerateURIWithoutSecret

func (c *COSConfig) GenerateURIWithoutSecret() (res string)

func (*COSConfig) GetResourceType

func (c *COSConfig) GetResourceType() string

func (*COSConfig) NewWithObjectKey

func (c *COSConfig) NewWithObjectKey(subpath string) StorageInterface

type DiskInfo

type DiskInfo struct {
	Fsid               string `json:"fsid"`
	Path               string `json:"path"`
	TotalSizeBytes     uint64 `json:"totalSizeBytes"`     // total size in bytes
	UsedSizeBytes      uint64 `json:"usedSizeBytes"`      // used size in bytes
	AvailableSizeBytes uint64 `json:"availableSizeBytes"` // available size in bytes
	FreeSizeBytes      uint64 `json:"freeSizeBytes"`      // free size in bytes
}

func GetDiskInfo

func GetDiskInfo(path string) (*DiskInfo, error)

type NFSConfig

type NFSConfig struct {
	Path string
}

func (*NFSConfig) CheckWritePermission

func (c *NFSConfig) CheckWritePermission() error

func (*NFSConfig) GenerateQueryParams

func (c *NFSConfig) GenerateQueryParams() string

func (*NFSConfig) GenerateURI

func (c *NFSConfig) GenerateURI() (res string)

func (*NFSConfig) GenerateURIWhitoutParams

func (c *NFSConfig) GenerateURIWhitoutParams() string

func (*NFSConfig) GenerateURIWithoutSecret

func (c *NFSConfig) GenerateURIWithoutSecret() (res string)

func (*NFSConfig) GetResourceType

func (c *NFSConfig) GetResourceType() string

func (*NFSConfig) NewWithObjectKey

func (c *NFSConfig) NewWithObjectKey(subpath string) StorageInterface

type OSSConfig

type OSSConfig struct {
	BaseConf
}

func (*OSSConfig) CheckWritePermission

func (c *OSSConfig) CheckWritePermission() error

func (*OSSConfig) GenerateQueryParams

func (c *OSSConfig) GenerateQueryParams() string

func (*OSSConfig) GenerateURI

func (c *OSSConfig) GenerateURI() (res string)

func (*OSSConfig) GenerateURIWhitoutParams

func (c *OSSConfig) GenerateURIWhitoutParams() string

func (*OSSConfig) GenerateURIWithoutSecret

func (c *OSSConfig) GenerateURIWithoutSecret() (res string)

func (*OSSConfig) GetResourceType

func (c *OSSConfig) GetResourceType() string

func (*OSSConfig) NewWithObjectKey

func (c *OSSConfig) NewWithObjectKey(subpath string) StorageInterface

type RestoreWindow

type RestoreWindow struct {
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
}

type RestoreWindows

type RestoreWindows struct {
	Windows []RestoreWindow `json:"restore_windows"`
}

func GetRestoreWindows

func GetRestoreWindows(dataURI, logURI string) (*RestoreWindows, error)

type S3Config

type S3Config struct {
	BaseConf
	S3Region string
}

func (*S3Config) CheckWritePermission

func (c *S3Config) CheckWritePermission() (err error)

func (*S3Config) GenerateQueryParams

func (c *S3Config) GenerateQueryParams() string

func (*S3Config) GenerateURI

func (c *S3Config) GenerateURI() (res string)

func (*S3Config) GenerateURIWhitoutParams

func (c *S3Config) GenerateURIWhitoutParams() string

func (*S3Config) GenerateURIWithoutSecret

func (c *S3Config) GenerateURIWithoutSecret() (res string)

func (*S3Config) GetResourceType

func (c *S3Config) GetResourceType() string

func (*S3Config) NewWithObjectKey

func (c *S3Config) NewWithObjectKey(subpath string) StorageInterface

type SCN

type SCN struct {
	Val int64 `json:"val"`
}

type StorageInterface

type StorageInterface interface {
	GenerateURI() string
	GenerateURIWithoutSecret() string
	GenerateURIWhitoutParams() string
	GenerateQueryParams() string
	GetResourceType() string
	CheckWritePermission() error
	NewWithObjectKey(string) StorageInterface
}

func GetCOSStorage

func GetCOSStorage(url string) (StorageInterface, error)

func GetNFSStorage

func GetNFSStorage(url string) (StorageInterface, error)

func GetOSSStorage

func GetOSSStorage(url string) (StorageInterface, error)

func GetS3Storage

func GetS3Storage(url string) (StorageInterface, error)

func GetStorageInterfaceByURI

func GetStorageInterfaceByURI(uri string) (StorageInterface, error)

type TenantKey

type TenantKey struct {
	TenantId int `json:"tenant_id"`
}

type TimeUnit

type TimeUnit string

Jump to

Keyboard shortcuts

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