hwobs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 19 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 Open

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

func ParseConfig

func ParseConfig(s string) (interface{}, error)

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

Types

type Config

type Config struct {
	Endpoint     string
	Ak           string //*** Provide your Access Key ***
	Sk           string //*** Provide your Secret Key ***
	BucketName   string //bucket-test
	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
	SslEnable    bool
}

func NewConfig

func NewConfig() Config

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

type HwObs

type HwObs struct {
	backend.Layout
	// contains filtered or unexported fields
}

func (*HwObs) Close

func (h *HwObs) Close() error

func (*HwObs) Delete

func (h *HwObs) Delete(ctx context.Context) error

func (*HwObs) Hasher

func (h *HwObs) Hasher() hash.Hash

func (*HwObs) IsAccessDenied

func (h *HwObs) IsAccessDenied(err error) bool

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

func (*HwObs) IsNotExist

func (h *HwObs) IsNotExist(err error) bool

func (*HwObs) Join

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

Join combines path components with slashes.

func (*HwObs) List

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

func (*HwObs) Load

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

func (*HwObs) Location

func (h *HwObs) Location() string

func (*HwObs) ReadDir

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

func (*HwObs) Remove

func (h *HwObs) Remove(ctx context.Context, handle restic.Handle) error

func (*HwObs) Save

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

func (*HwObs) Stat

func (h *HwObs) Stat(ctx context.Context, handle restic.Handle) (restic.FileInfo, error)

func (*HwObs) Test

func (h *HwObs) Test(ctx context.Context, handle restic.Handle) (bool, error)

Jump to

Keyboard shortcuts

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