xqiniu

package
v0.0.0-...-5aa174a Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BucketImolaStatic Bucket = 1
	BucketNestStatic  Bucket = 2
	BucketNestPhoto   Bucket = 3

	BucketNameImolaStatic BucketName = "zhuke-static"
	BucketNameNestStatic  BucketName = "dome-static"
	BucketNameNestPhoto   BucketName = "nestciao-photo"

	BucketDomainImolaStatic BucketDomain = "static.imolacn.com"
	BucketDomainNestStatic  BucketDomain = "static.zc0901.com"
	BucketDomainNestPhoto   BucketDomain = "img.imolacn.com"
)
View Source
const (
	ReturnBody = `` /* 498-byte string literal not displayed */

)

Variables

View Source
var BucketImageStyle = map[int64]*ImageStyle{
	BucketImolaStatic.Int64(): {
		Url:            "!wxa.pic",
		ShareUrl:       "!wxa.pic",
		DownloadUrl:    "",
		OriginalUrl:    "!wxa.pic",
		ImageSearchUrl: "!wxa.pic",
	},
	BucketNestPhoto.Int64(): {
		Url:            "~500x.jpg",
		ShareUrl:       "~500x.jpg",
		DownloadUrl:    "~jpg",
		OriginalUrl:    "~1200x1200.jpg",
		ImageSearchUrl: "~736x.jpg",
	},
}

Functions

func ImageView2

func ImageView2(scheme string, bucket Bucket, key string, options ...ImageView2Option) string

ImageView2 七牛图片基本处理 官方文档:https://developer.qiniu.com/dora/1279/basic-processing-images-imageview2

func NewMac

func NewMac(ak, sk string) *auth.Credentials

func UploadToken

func UploadToken(ak, sk string, bucket Bucket, expires ...uint64) string

Types

type Bucket

type Bucket int64

Bucket 标志七牛的存储空间

func (Bucket) Domain

func (bucket Bucket) Domain() string

func (Bucket) Host

func (bucket Bucket) Host(schemes ...string) string

func (Bucket) Int64

func (bucket Bucket) Int64() int64

func (Bucket) Name

func (bucket Bucket) Name() string

type BucketDomain

type BucketDomain string

BucketDomain 标志七牛存储空间的域名

func (BucketDomain) String

func (bucketDomain BucketDomain) String() string

type BucketName

type BucketName string

BucketName 标志七牛存储空间的名称

func (BucketName) String

func (bucketName BucketName) String() string

type ImageStyle

type ImageStyle struct {
	Url            string `json:"url"`
	ShareUrl       string `json:"share_url"`
	DownloadUrl    string `json:"download_url"`
	OriginalUrl    string `json:"original_url"`
	ImageSearchUrl string `json:"image_search_url"`
}

type ImageView2Option

type ImageView2Option func(params *ImageView2Params)

func ImageView2Colors

func ImageView2Colors(value int64) ImageView2Option

func ImageView2Format

func ImageView2Format(value string) ImageView2Option

func ImageView2Height

func ImageView2Height(value int64) ImageView2Option

func ImageView2IgnoreErr

func ImageView2IgnoreErr(value int64) ImageView2Option

func ImageView2Interlace

func ImageView2Interlace(value string) ImageView2Option

func ImageView2Mode

func ImageView2Mode(value int64) ImageView2Option

func ImageView2Quality

func ImageView2Quality(value int64) ImageView2Option

func ImageView2Watermark

func ImageView2Watermark(value string) ImageView2Option

func ImageView2Width

func ImageView2Width(value int64) ImageView2Option

type ImageView2Params

type ImageView2Params struct {
	Mode      int64
	Width     int64
	Height    int64
	Format    string
	Interlace string
	Colors    int64
	Quality   int64
	IgnoreErr int64
	Watermark string
}

type QBox

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

func NewQBox

func NewQBox(ak, sk string) *QBox

func (*QBox) Fetch

func (box *QBox) Fetch(url string, bucket Bucket, keys ...string) (storage.FetchRet, error)

func (*QBox) Pfop

func (box *QBox) Pfop(bucket Bucket, key string, fops []string, pipeline, notifyUrl string, force bool) (string, error)

Pfop 持久化数据处理

func (*QBox) PutFile

func (box *QBox) PutFile(p string, bucket Bucket, keyPrefix ...string) (*UploadedRet, error)

func (*QBox) UploadToken

func (box *QBox) UploadToken(bucket Bucket, expires ...uint64) string

type UploadedRet

type UploadedRet struct {
	Key           string `json:"key"`
	Size          int64  `json:"size"`
	Type          string `json:"type"`
	Hash          string `json:"hash"`
	Width         int64  `json:"width"`
	Height        int64  `json:"height"`
	Orientation   string `json:"orientation"`
	Color         string `json:"color"`
	VideoRotate   string `json:"videoRotate"`
	VideoWidth    int64  `json:"videoWidth"`
	VideoHeight   int64  `json:"videoHeight"`
	VideoDuration string `json:"videoDuration"`
	Url           string `json:"url"`
	OriginalUrl   string `json:"originalUrl"`
}

func PutFile

func PutFile(ak, sk, p string, bucket Bucket, keyPrefix ...string) (*UploadedRet, error)

Jump to

Keyboard shortcuts

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