oss

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

* @Author: liziwei01 * @Date: 2022-03-04 15:43:21 * @LastEditors: liziwei01 * @LastEditTime: 2023-11-01 11:19:13 * @Description: file content

* @Author: liziwei01 * @Date: 2022-03-04 13:52:11 * @LastEditors: liziwei01 * @LastEditTime: 2022-03-20 19:41:46 * @Description: file content

* @Author: liziwei01 * @Date: 2022-03-04 15:42:58 * @LastEditors: liziwei01 * @LastEditTime: 2022-03-20 19:43:15 * @Description: file content

* @Author: liziwei01 * @Date: 2022-03-20 18:17:39 * @LastEditors: liziwei01 * @LastEditTime: 2023-11-01 11:19:42 * @Description: file content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// objectName 对应的阿里云中的文件地址
	// fileHeader 文件
	Get(ctx context.Context, bucket string, objectKey string) (*bytes.Reader, error)
	// Put
	Put(ctx context.Context, bucket string, objectKey string, fileReader *bytes.Reader) error
	// Del
	Del(ctx context.Context, bucket string, objectKey string) error
	// Users could access the object directly with this URL without getting the AK.
	GetURL(ctx context.Context, bucket string, objectKey string) (string, error)
	// contains filtered or unexported methods
}

func GetClient

func GetClient(ctx context.Context, serviceName string) (Client, error)

*

  • @description:
  • @param {context.Context} ctx
  • @param {string} serviceName
  • @return {*}

func New

func New(config *Config) Client

type Config

type Config struct {
	// Service的名字, 必选
	Name string

	OSS struct {
		Endpoint        string
		AccessKeyID     string
		AccessKeySecret string
	}
}

Config 配置

Jump to

Keyboard shortcuts

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