oss

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct{}

func NewFile

func NewFile() *File

func (*File) UploadWithContent

func (f *File) UploadWithContent(name string, content []byte, option *Option) (*UploadResult, error)

func (*File) UploadWithPath

func (f *File) UploadWithPath(name string, filePath string, option *Option) (*UploadResult, error)

func (*File) UploadWithURL

func (f *File) UploadWithURL(name string, targetUrl string, option *Option) (*UploadResult, error)

type Option

type Option struct {
	Type   string `json:"type"`   // http content type
	Region string `json:"region"` // region of storage
}

type UploadResult

type UploadResult struct {
	ID  primitive.ObjectID `json:"id,omitempty"`
	URL string             `json:"url,omitempty"`
}

Jump to

Keyboard shortcuts

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