txcos

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backend, error)

func NewFactory added in v1.2.0

func NewFactory() location.Factory

func Open

func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backend, error)

Types

type Config

type Config struct {
	Endpoint     string //https://examplebucket-appid.cos.COS_REGION.myqcloud.com
	SecretID     string //*** Provide your Access Key ***
	SecretKey    string //*** Provide your Secret Key ***
	StorageClass string `option:"storage-class" help:"set OBS storage class (STANDARD, WARM, COLD)"`
	Connections  uint
	Layout       string `option:"layout" help:"use this backend layout (default: auto-detect)"`
	Prefix       string
	EnableCRC    bool //CRC64 校验
}

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with the default values filled in.

func ParseConfig

func ParseConfig(s string) (*Config, error)

ParseConfig parses the string s and extracts the cos config. The two supported configuration formats are cos://host/bucketname/prefix and cos:host/bucketname/prefix. The host can also be a valid obs region

func (*Config) ApplyEnvironment added in v1.2.0

func (cfg *Config) ApplyEnvironment(prefix string)

type TxCos

type TxCos struct {
	layout.Layout
	// contains filtered or unexported fields
}

func (*TxCos) Close

func (t *TxCos) Close() error

func (*TxCos) Connections added in v1.2.0

func (t *TxCos) Connections() uint

func (*TxCos) Delete

func (t *TxCos) Delete(ctx context.Context) error

func (*TxCos) HasAtomicReplace added in v1.2.0

func (t *TxCos) HasAtomicReplace() bool

func (*TxCos) Hasher

func (t *TxCos) Hasher() hash.Hash

func (*TxCos) IsAccessDenied

func (t *TxCos) IsAccessDenied(err error) bool

IsAccessDenied returns true if the error is caused by Access Denied.

func (*TxCos) IsNotExist

func (t *TxCos) IsNotExist(err error) bool

func (*TxCos) Join

func (be *TxCos) Join(p ...string) string

Join combines path components with slashes.

func (*TxCos) List

func (t *TxCos) List(ctx context.Context, ty restic.FileType, fn func(restic.FileInfo) error) error

func (*TxCos) Load

func (t *TxCos) Load(ctx context.Context, handle restic.Handle, length int, offset int64, fn func(rd io.Reader) error) error

func (*TxCos) Location

func (t *TxCos) Location() string

func (*TxCos) ReadDir

func (t *TxCos) ReadDir(ctx context.Context, dir string) (list []os.FileInfo, err error)

func (*TxCos) Remove

func (t *TxCos) Remove(ctx context.Context, handle restic.Handle) error

func (*TxCos) Save

func (t *TxCos) Save(ctx context.Context, handle restic.Handle, rd restic.RewindReader) error

func (*TxCos) Stat

func (t *TxCos) Stat(ctx context.Context, handle restic.Handle) (restic.FileInfo, error)

Jump to

Keyboard shortcuts

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