oss

package
v1.1.3 Latest Latest
Warning

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

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

README

oss

import "github.com/ccheers/xpkg/oss"

Index

func IsErrNoMatchType

func IsErrNoMatchType(err error) bool

IsErrNoMatchType 错误断言 判断错误是否是: 未匹配 oss 错误

type Config

Config Oss 配置

type Config struct {
    AccessKey       string
    AccessKeySecret string
    EndPoint        string
}

type Oss

Oss 抽象接口

type Oss interface {
    Set(ctx context.Context, bucket string, key string, reader io.Reader) (err error)
    Get(ctx context.Context, bucket string, key string) (resp []byte, err error)
}
func Factory
func Factory(tp Type, config Config) (Oss, error)

Factory 工厂函数

type Type

Type Oss 类型

type Type string
const (
    // OssTypeHuaweiYun Oss 类型是华为云
    OssTypeHuaweiYun Type = "huaweiyun"
    // OssTypeAliYun Oss 类型是阿里云
    OssTypeAliYun Type = "aliyun"
)

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrNoMatchType

func IsErrNoMatchType(err error) bool

IsErrNoMatchType 错误断言 判断错误是否是: 未匹配 oss 错误

Types

type Config

type Config struct {
	AccessKey       string
	AccessKeySecret string
	EndPoint        string
}

Config Oss 配置

type Oss

type Oss interface {
	Set(ctx context.Context, bucket string, key string, reader io.Reader) (err error)
	Get(ctx context.Context, bucket string, key string) (resp []byte, err error)
}

Oss 抽象接口

func Factory

func Factory(tp Type, config Config) (Oss, error)

Factory 工厂函数

type Type

type Type string

Type Oss 类型

const (
	// OssTypeHuaweiYun Oss 类型是华为云
	OssTypeHuaweiYun Type = "huaweiyun"
	// OssTypeAliYun Oss 类型是阿里云
	OssTypeAliYun Type = "aliyun"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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