goss

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContentTypes = make(map[string]string)

Functions

func GetFileName

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

func GetcontentType

func GetcontentType(fileName string) string

func SubStringBlackSlash

func SubStringBlackSlash(s string) string

Types

type CommonOss

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

func GetDefault

func GetDefault(c OssClient) (*CommonOss, error)

func NewDefault

func NewDefault(c OssClient) (*CommonOss, error)

func (CommonOss) GetNativeWithPrefixUrl

func (co CommonOss) GetNativeWithPrefixUrl(fileName string) string

type OssClient

type OssClient interface {
	NewDefaultClient() (OssClient, error)
	GetNativePrefix() string
	GetFullUrlWithSign(fileName string, expiredInSec int64) (string, error)
	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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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