oss

package
v0.0.0-...-0e6b51b Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_NOT_FOUND = 0x0001
View Source
const Type_Base64 = "base64"
View Source
const Type_Text = "text"
View Source
const Type_URL = "url"

Variables

This section is empty.

Functions

func AddSource

func AddSource(stype string, fn func(config interface{}) (ISource, error))

Types

type GetTask

type GetTask struct {
	Name    interface{} `json:"name,omitempty" name:"name" title:"配置名称"`
	Key     string      `json:"key" name:"key" title:"Key"`
	Type    interface{} `json:"type,omitempty" name:"type" title:"类型 默认 Type.Url"`
	Expires interface{} `json:"expires,omitempty" name:"expires" title:"超时时间(秒) 公开读不设置"`
	Header  interface{} `json:"header,omitempty" name:"header" title:"头 JSON 格式"`
}

func (*GetTask) GetName

func (T *GetTask) GetName() string

func (*GetTask) GetTitle

func (T *GetTask) GetTitle() string

type HasTask

type HasTask struct {
	Name interface{} `json:"name,omitempty" name:"name" title:"配置名称"`
	Key  string      `json:"key" name:"key" title:"Key"`
}

func (*HasTask) GetName

func (T *HasTask) GetName() string

func (*HasTask) GetTitle

func (T *HasTask) GetTitle() string

type ISource

type ISource interface {
	Get(key string, header map[string]string) ([]byte, error)
	GetURL(key string) string
	GetSignURL(key string, expires time.Duration, header map[string]string) (string, error)
	Put(key string, data []byte, header map[string]string) error
	PutSignURL(key string, expires time.Duration) (string, error)
	PostSignURL(key string, expires time.Duration) (string, map[string]string, error)
	Del(key string) error
	Has(key string) error
}

func GetSource

func GetSource(app micro.IContext, name string) (ISource, error)

func OpenSource

func OpenSource(stype string, config interface{}) (ISource, error)

type PostData

type PostData struct {
	Url  string      `json:"url" name:"url" title:"上传URL"`
	Data interface{} `json:"data,omitempty" name:"data" title:"上传 Form Data"`
}

type PostTask

type PostTask struct {
	Name    interface{} `json:"name,omitempty" name:"name" title:"配置名称"`
	Key     string      `json:"key" name:"key" title:"Key"`
	Expires interface{} `json:"expires,omitempty" name:"expires" title:"超时时间(秒) type == url 使用"`
}

func (*PostTask) GetName

func (T *PostTask) GetName() string

func (*PostTask) GetTitle

func (T *PostTask) GetTitle() string

type PutTask

type PutTask struct {
	Name    interface{} `json:"name,omitempty" name:"name" title:"配置名称"`
	Key     string      `json:"key" name:"key" title:"Key"`
	Type    interface{} `json:"type,omitempty" name:"type" title:"类型 默认 url"`
	Content interface{} `` /* 167-byte string literal not displayed */
	Expires interface{} `json:"expires,omitempty" name:"expires" title:"超时时间(秒) type == url 使用"`
}

func (*PutTask) GetName

func (T *PutTask) GetName() string

func (*PutTask) GetTitle

func (T *PutTask) GetTitle() string

type RmTask

type RmTask struct {
	Name interface{} `json:"name,omitempty" name:"name" title:"配置名称"`
	Key  string      `json:"key" name:"key" title:"Key"`
}

func (*RmTask) GetName

func (T *RmTask) GetName() string

func (*RmTask) GetTitle

func (T *RmTask) GetTitle() string

type Service

type Service struct {
}

func (*Service) Get

func (S *Service) Get(app micro.IContext, task *GetTask) (interface{}, error)

func (*Service) GetName

func (S *Service) GetName() string

func (*Service) GetTitle

func (S *Service) GetTitle() string

func (*Service) Has

func (S *Service) Has(app micro.IContext, task *HasTask) (interface{}, error)

func (*Service) Post

func (S *Service) Post(app micro.IContext, task *PostTask) (*PostData, error)

func (*Service) Put

func (S *Service) Put(app micro.IContext, task *PutTask) (interface{}, error)

func (*Service) Rm

func (S *Service) Rm(app micro.IContext, task *RmTask) (interface{}, error)

Jump to

Keyboard shortcuts

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