httpdriver

package
v0.0.0-...-5fe3b72 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxAuthorization = "CTX_AUTHORIZATION"
	CtxTimeout       = "CTX_TIMEOUT"
)

Variables

This section is empty.

Functions

func AuthzFromCtx

func AuthzFromCtx(ctx context.Context) (*string, bool)

func CtxWithAuthz

func CtxWithAuthz(ctx context.Context, authz string) context.Context

func CtxWithTimeout

func CtxWithTimeout(ctx context.Context, timeout time.Duration) context.Context

func Delete

func Delete(c *http.Client, url string, u *stdurl.URL) error

func NewFileInfo

func NewFileInfo(name string, size int64) os.FileInfo

func NewObject

func NewObject(client *http.Client, url string, u *stdurl.URL, size int64) driver.Object

NewObject opens an HTTP URL as an Object. If size is negative, a HEAD request will be performed to determine the actual size.

func RegisterDefaultDriver

func RegisterDefaultDriver()

func Stat

func Stat(c *http.Client, url string) (int64, error)

func TimeoutFromCtx

func TimeoutFromCtx(ctx context.Context) (*time.Duration, bool)

Types

type Driver

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

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Open

func (d *Driver) Open(ctx context.Context, url string, size int64) (driver.Object, error)

func (*Driver) Remove

func (d *Driver) Remove(ctx context.Context, url string) error

func (*Driver) Stat

func (d *Driver) Stat(ctx context.Context, url string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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