poseidon_oss

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

dayu_poseidon_oss

dayu's oss client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnInitClient

func ConnInitClient() *resty.Client

*

  • @Author Assassin
  • @Date 2021/12/24 16:41
  • @Description 初始化clent *

func CreateMd5

func CreateMd5(signParam string) (sign string)

*

  • @Author 陈磊
  • @Date 2021/9/22 11:00
  • @Description md5加密 *

Types

type AuthVersionType

type AuthVersionType string
const (
	// AuthV1 v1
	AuthV1 AuthVersionType = "v1"
	// AuthV2 v2
	AuthV2 AuthVersionType = "v2"
)

type Client

type Client struct {
	Config *Config // OSS client configuration
	Conn   *Conn   // Send HTTP request
}

Client OSS client

func New

func New(accessKey, accessSecret string, BucketId int64, serviceUrl string, options ...ClientOption) (*Client, error)

*

  • @Author Assassin
  • @Date 2021/12/24 14:21
  • @Description 创建新的oss *

func (Client) UploadFile

func (client Client) UploadFile(file multipart.File, filename string) (res *UploadFileResponse, err error)

*

  • @Author Assassin
  • @Date 2021/12/24 14:31
  • @Description 上传文件 *

type ClientOption

type ClientOption func(*Client)

ClientOption client option such as UseCname, Timeout, SecurityToken.

type Config

type Config struct {
	AccessKey    string          // AccessKey
	AccessSecret string          // AccessSecret
	BucketId     int64           // Bucket
	AuthVersion  AuthVersionType //  v1 or v2 signature,default is v1
}

type Conn

type Conn struct {
	Url string
	// contains filtered or unexported fields
}

func (*Conn) NewHttp

func (this *Conn) NewHttp() (httpRequest *resty.Request)

*

  • @Author Assassin
  • @Date 2021/12/24 16:41
  • @Description 新建http *

type UploadFileResponse

type UploadFileResponse struct {
	ErrNo   int64  `json:"err_no"`
	Message string `json:"message"`
	Data    data
}

*

  • @Author Assassin
  • @Date 2021/12/24 16:18
  • @Description 上传文件返回值 *

Jump to

Keyboard shortcuts

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