openyouku

package module
v0.0.0-...-820c6a4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Method string
	// contains filtered or unexported fields
}

type Response

type Response struct {
	Error ResponseError `json:"e"`
	Cost  float64       `json:"cost"`
	Data  interface{}   `json:"data"`
}

type ResponseError

type ResponseError struct {
	Code     int    `json:"code"`
	Provider string `json:"provider"`
	Desc     string `json:"desc"`
}

type SDK

type SDK struct {
	ClientID     string
	ClientSecret string
	AccessToken  string
	User         string
	Password     string
}

func (*SDK) Get

func (sdk *SDK) Get(action string, params map[string]string) (*Response, error)

func (*SDK) GetUploader

func (sdk *SDK) GetUploader(name string, content []byte) *Uploader

func (*SDK) Post

func (sdk *SDK) Post(action string, params map[string]interface{}) *Response

type SysParams

type SysParams struct {
	Action      string `json:"action"`
	ClientID    string `json:"client_id"`
	AccessToken string `json:"access_token"`
	Format      string `json:"format"`
	Timestamp   string `json:"timestamp"`
	Version     string `json:"version"`
	Sign        string `json:"sign"`
}

SysParams API定义的系统级别参数

func (*SysParams) SignParm

func (p *SysParams) SignParm(clientSecret string, param map[string]string) map[string]string

SignParm is a method to sign this request

func (*SysParams) String

func (p *SysParams) String() (string, error)

type Uploader

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

func NewUploader

func NewUploader(sdk *SDK, name string, content []byte) *Uploader

func (*Uploader) Set

func (uploader *Uploader) Set(k, v string)

func (*Uploader) Start

func (uploader *Uploader) Start() (map[string]interface{}, error)

type UploaderParam

type UploaderParam struct {
	Title      string        `json:"title"`
	Tags       string        `json:"tags"`
	Desc       string        `json:"desc"`
	IP         string        `json:"ip"`
	CategoryID int64         `json:"category_id"`
	UserID     string        `json:"user_id"`
	AttrValues []interface{} `json:"attr_values"`
	MD5        string        `json:"md5"`
	FileSize   int64         `json:"file_size"`
	FileFormat string        `json:"file_format"`
}

Jump to

Keyboard shortcuts

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