config

package
v1.8.75 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	AccessKey string `json:"acsKey"`
	SecretKey string `json:"secret"`
	EndPoint  string `json:"endpoint"`
	Region    string `json:"region"`
}

type Base

type Base struct {
	Dir    string
	Key    string
	Bucket string
}

type BucketInfo

type BucketInfo struct {
	Name             string `json:"name"`
	Host             string `json:"host"`
	DefaultUploadDir string `json:"defaultUploadDir"`
	AllowExt         string `json:"allowExt"`
}

type Chunk

type Chunk struct {
	Number int   `json:"number"` // Chunk number
	Offset int64 `json:"offset"` // Chunk offset
	Size   int64 `json:"size"`   // Chunk size.
}

type ChunkResult

type ChunkResult struct {
	Key    string  `json:"key,omitempty"`
	Chunks []Chunk `json:"chunks"`
}

type Config

type Config struct {
	Access
	TokenCallbackUrl string `json:"tokenCallbackUrl"`
	Expires          int64  `json:"expires"`  //TOKEN 过期秒
	UseHTTPS         bool   `json:"useHttps"` //是否使用https域名
	UseCdn           bool   `json:"useCdn"`   //上传是否使用CDN上传加速
	MinChunkSize     int64  `json:"minChunkSize"`
	Cdn              string `json:"fileCdn"`
	TmpPath          string `json:"tmpPath"` //本地的临时文件
}

type File

type File struct {
	Info        FileInfo `yaml:"info,omitempty" json:"info,omitempty"`
	Source      string   `yaml:"src,omitempty" json:"src,omitempty"`
	Destination string   `yaml:"dst,omitempty" json:"dst,omitempty"`
	StripParent bool     `yaml:"strip_parent,omitempty" json:"strip_parent,omitempty"`
	Default     bool     `yaml:"-" json:"-"`
}

File is a file inside an archive.

func (*File) Unmarshal

func (f *File) Unmarshal(unmarshal func(interface{}) error) error

Unmarshal is a custom unmarshaler that wraps strings in arrays.

type FileInfo

type FileInfo struct {
	Mode        os.FileMode `yaml:"mode,omitempty" json:"mode,omitempty"`
	Owner       string      `yaml:"owner,omitempty" json:"owner,omitempty"`
	Group       string      `yaml:"group,omitempty" json:"group,omitempty"`
	MTime       string      `yaml:"mtime,omitempty" json:"mtime,omitempty"`
	ParsedMTime time.Time   `yaml:"-" json:"-"`
}

FileInfo is the file info of a file.

type Name

type Name struct {
	Base
	Name string
}

Name 文件名

type Path

type Path struct {
	Id        string `json:"id"`      //作品ID: vid-nums, 其它id
	Product   string `json:"product"` //产品名
	Biz       string `json:"biz"`     //业务名
	Type      string `json:"type"`    //类型
	Name      string `json:"name"`    //原始文件名
	Ext       string `json:"ext"`
	Md5       string `json:"md5"`
	SaveType  int32  `json:"saveType"`
	ProductId int64  `json:"productId"` //产品
	BizId     int64  `json:"bizId"`     //业务
	Source    int32  `json:"source"`    //`来源
	Size      int64  `json:"size"`
}

type ReaderStream added in v1.8.75

type ReaderStream interface {
	OnReader(r io.ReadSeeker)
}

type ReaderStreamFunc added in v1.8.75

type ReaderStreamFunc func(r io.ReadSeeker)

func (ReaderStreamFunc) OnReader added in v1.8.75

func (s ReaderStreamFunc) OnReader(r io.ReadSeeker)

type Result

type Result struct {
	TaskId   string      `json:"taskId,omitempty"`
	Id       string      `json:"id,omitempty"` //断点续传=UploadId
	Key      string      `json:"key"`
	Url      string      `json:"url"`
	Name     string      `json:"name"`
	Path     string      `json:"-"` //本地文件路径
	SaveType int32       `json:"saveType"`
	Duration int64       `json:"duration"`           //豪秒
	Business interface{} `json:"business,omitempty"` //业务定义数据
}

type Results

type Results struct {
	Results []Result `json:"results"`
}

type Stream

type Stream struct {
	Base
	Seeker io.Seeker
	Reader io.Reader
	Size   int64
}

Stream 文件流

func (*Stream) Seek

func (sm *Stream) Seek(offset int64, whence int) (int64, error)

type WriteStream added in v1.8.75

type WriteStream interface {
	OnWriter(r io.WriteSeeker)
}

type WriterStreamFunc added in v1.8.75

type WriterStreamFunc func(r io.WriteSeeker)

func (WriterStreamFunc) OnWriter added in v1.8.75

func (s WriterStreamFunc) OnWriter(r io.WriteSeeker)

Jump to

Keyboard shortcuts

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