goss

package
v0.13.20 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AliOss                  OssType = "alioss"
	ZijieOss                OssType = "zijieoss"
	AliossSelfDomainHostKey         = "alioss.selfDomainHost"
	ZijieSelfDomainHostKey          = "zijie.oss.selfDomainHost"
	AliEndpointPublicKey            = "alioss.endpoint.public"
	ZijieEndpointPublicKey          = "zijie.oss.endpoint.public"
	AlinativePrefixKey              = "alioss.nativePrefix"
	ZijienativePrefixKey            = "zijie.oss.nativePrefix"
	DefaultAliPrefix                = "/alioss-core/"
	DefaultZijiePrefix              = "/zijie-core/"
	AlibucketNameKey                = "alioss.bucketName"
	ZijieBucketNameKey              = "zijie.oss.bucketName"
)

Variables

This section is empty.

Functions

func GetFileName

func GetFileName(fileName, nativePrefix, endpoint, bucketName, selfDomain string) string

func SubStringBlackSlash

func SubStringBlackSlash(s string) string

Types

type OssClient

type OssClient interface {
	NewDefaultClient() (OssClient, error)
	GetNativeWithPrefixUrl(fileName string) string
	GetNativePrefix() string
	GetFullUrlWithSign(fileName string, expiredInSec int64) (string, error)
	GetFullUrl(fileName string) string
	Upload(key string, reader io.Reader, isPrivate bool) (fileName string, err error)
	UploadFromUrl(urlStr string, isPrivate bool) (string, error)
	UploadOverwrite(key string, reader io.Reader, isPrivate bool) (fileName string, err error)
	UploadFile(fileName string, file *os.File, isPrivate bool) (string, error)
	GetBytes(fileName string) ([]byte, error)
	GetBase64(fileName string) (string, error)

	UploadFileBytes(fileName string, bs []byte, isPrivate bool) (string, error)
	UploadFileWithFullUrl(fileName string, file *os.File, isPrivate bool) (string, error)

	UploadFileBytesWithFullUrl(fileName string, bs []byte, isPrivate bool) (string, error)
	UploadFileBytesWithNativeFullUrl(fileName string, bs []byte, isPrivate bool) (string, error)

	UploadFileWithNativeFullUrl(fileName string, file *os.File, isPrivate bool) (string, error)

	DelObject(fileName string) (bool, error)
	IsObjectExist(key string) (bool, error)
}

func GetDefault

func GetDefault(c OssClient) (OssClient, error)

func NewDefault

func NewDefault(c OssClient) (OssClient, error)

type OssType added in v0.12.5

type OssType string

func GetOssTypeByFilePath added in v0.12.5

func GetOssTypeByFilePath(filePath string) (OssType, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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