goalioss

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Aliyun oss 封装

基于库 github.com/aliyun/aliyun-oss-go-sdk/oss

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKeyId     string `json:"access_key_id" yaml:"access_key_id"`
	AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
	Endpoint        string `json:"endpoint" yaml:"endpoint"`
	Bucket          string `json:"bucket" yaml:"bucket"`
	Domain          string `json:"domain" yaml:"domain"`
}

type GoOss

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

func Init

func Init(conf Config) *GoOss

func (*GoOss) Client

func (g *GoOss) Client() *oss.Client

func (*GoOss) ContentType

func (g *GoOss) ContentType(value string) *Uploader

func (*GoOss) Options

func (g *GoOss) Options(opts ...oss.Option) *Uploader

func (*GoOss) Upload

func (g *GoOss) Upload(filename string, body []byte) (string, error)

type Uploader

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

func New

func New(conf Config) (*Uploader, error)

func (*Uploader) ContentType

func (o *Uploader) ContentType(value string) *Uploader

func (*Uploader) Options

func (o *Uploader) Options(opts ...oss.Option) *Uploader

func (*Uploader) Upload

func (o *Uploader) Upload(filename string, body []byte) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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