oss

package
v0.0.4-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOss

type IOss interface {
	UploadWithContent(ctx context.Context, name string, content []byte, option *Option) (*UploadResult, error)
	UploadWithURL(ctx context.Context, name string, targetUrl string, option *Option) (*UploadResult, error)
	UploadWithPath(ctx context.Context, name string, filePath string, option *Option) (*UploadResult, error)
}

type Option

type Option struct {
	Type string `json:"type,omitempty"` // http content type

}

type Oss

type Oss struct{}

func NewOss

func NewOss() *Oss

func (*Oss) UploadWithContent

func (f *Oss) UploadWithContent(ctx context.Context, name string, content []byte, option *Option) (*UploadResult, error)

func (*Oss) UploadWithPath

func (f *Oss) UploadWithPath(ctx context.Context, name string, filePath string, option *Option) (*UploadResult, error)

func (*Oss) UploadWithURL

func (f *Oss) UploadWithURL(ctx context.Context, name string, targetUrl string, option *Option) (*UploadResult, error)

type UploadResult

type UploadResult struct {
	URL string `json:"url,omitempty"`
}

Jump to

Keyboard shortcuts

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