kodofs

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 13 Imported by: 1

README

kodofs - http.FileSystem for kodo (qiniu object storage)

Build Status Go Report Card GitHub release Coverage Status GoDoc

Documentation

Index

Constants

View Source
const (
	DbgFlagNetwork = kodo.DbgFlagNetwork
	DbgFlagAll     = kodo.DbgFlagAll
)
View Source
const (
	Scheme = kodoutil.Scheme
)

Variables

This section is empty.

Functions

func Open added in v0.9.0

func Open(ctx context.Context, url string) (_ http.FileSystem, _ fsx.Closer, err error)

Open a kodofs file system by url in form of "kodo:<bucketName>?<token>".

func Register added in v0.9.0

func Register(bucketHostPairs ...string)

Register registers (bucket, host) pairs for kodofs.

func SetDebug

func SetDebug(dbgFlags int)

Types

type Bucket

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

func New

func New(accessKey, secretKey string, bucket string, host string, prepare PrepareOpen) *Bucket

func (*Bucket) Open

func (b *Bucket) Open(name string) (f http.File, err error)

Open implements net/http.FileSystem.Open (https://pkg.go.dev/net/http#FileSystem).

func (*Bucket) ReaddirContext

func (b *Bucket) ReaddirContext(ctx context.Context, dir string) (fis []fs.FileInfo, err error)

type Credentials

type Credentials kodo.Credentials

func NewCredentials

func NewCredentials(accessKey, secretKey string) *Credentials

func (*Credentials) NewBucket

func (mac *Credentials) NewBucket(bucket string, host string, prepare PrepareOpen) *Bucket

type PrepareOpen

type PrepareOpen = func(name string) (ctx context.Context, opener xfs.HttpOpener)

Directories

Path Synopsis
internal
kodo/log
Package log只是SDK本身自己使用,用来调试代码使用,比如输出HTTP请求和响应信息
Package log只是SDK本身自己使用,用来调试代码使用,比如输出HTTP请求和响应信息

Jump to

Keyboard shortcuts

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