p3

package
v0.0.0-...-33b9a68 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReqDateMissing = errors.New("request date missing")
	ErrReqDateTooOld  = errors.New("request date too old")
)

Functions

func AddAuthHeader

func AddAuthHeader(
	r *http.Request,
	bucket string,
	key string,
	accessKey string,
	sk []byte,
) error

Types

type P3

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

func New

func New() *P3

func NewWith

func NewWith(
	endpoint string,
	accessKeyID string,
	accessKeySecret string,
) *P3

func (*P3) DeleteObject

func (p *P3) DeleteObject(bucket string, key string) error

func (*P3) DeleteObjectByCID

func (p *P3) DeleteObjectByCID(cid string) error

func (*P3) GetObject

func (p *P3) GetObject(
	bucket string,
	key string,
) ([]byte, error)

func (*P3) GetObjectByCID

func (p *P3) GetObjectByCID(cid string) ([]byte, error)

func (*P3) PutObject

func (p *P3) PutObject(
	bucket string,
	key string,
	data []byte,
) (string, error)

type PutObjectResp

type PutObjectResp struct {
	CID string `json:"cid"`
}

Jump to

Keyboard shortcuts

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