client

package
v0.0.0-...-cd9cbe6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New() *Client

func NewWithJwtToken

func NewWithJwtToken(host string, jwt string) *Client

func NewWithKeySecret

func NewWithKeySecret(host string, apiKey, apiSecret string) *Client

func (*Client) AddPin

func (c *Client) AddPin(pin *model.Pin) (pr *PinResp, err error)

func (*Client) GenerateApiKey

func (c *Client) GenerateApiKey(ki *model.KeyInfo) (kr *KeyResp, err error)

func (*Client) GetPin

func (c *Client) GetPin(requestId string) (pr *PinResp, err error)

func (*Client) ListPin

func (c *Client) ListPin(param *model.SearchPinParam) (lpr *ListPinResp, err error)

func (*Client) PinFileFromFS

func (c *Client) PinFileFromFS(path string, name ...string) (pfr *PinFileResp, err error)

func (*Client) PinFileFromStream

func (c *Client) PinFileFromStream(file io.Reader, param *model.UploadParam) (pfr *PinFileResp, err error)

func (*Client) PinnedDataTotal

func (c *Client) PinnedDataTotal() (ptr *PinnedTotalResp, err error)

func (*Client) RemovePin

func (c *Client) RemovePin(requestId string) (res *ResultBase, err error)

func (*Client) ReplacePin

func (c *Client) ReplacePin(requestId string, pin *model.Pin) (pr *PinResp, err error)

func (*Client) RevokeApiKey

func (c *Client) RevokeApiKey(apiKey string) (res *ResultBase, err error)

func (*Client) SetHost

func (c *Client) SetHost(host string)

func (*Client) SetJwtToken

func (c *Client) SetJwtToken(jwt string)

func (*Client) SetKeySecret

func (c *Client) SetKeySecret(apiKey, apiSecret string)

func (*Client) SetLanguage

func (c *Client) SetLanguage(lang XLanguage)

func (*Client) SetPinMeta

func (c *Client) SetPinMeta(requestId string, meta *model.MetaData) (res *ResultBase, err error)

func (*Client) SetPinPolicy

func (c *Client) SetPinPolicy(requestId string, param *model.PolicyParam) (res *ResultBase, err error)

func (*Client) SetUserPinPolicy

func (c *Client) SetUserPinPolicy(param *model.PolicyParam) (res *ResultBase, err error)

type KeyResp

type KeyResp struct {
	ResultBase
	Data *model.ApiKey
}

func (*KeyResp) CreateData

func (r *KeyResp) CreateData() interface{}

type ListPinResp

type ListPinResp struct {
	ResultBase
	Data *model.PinResults
}

func (*ListPinResp) CreateData

func (r *ListPinResp) CreateData() interface{}

type PinFileResp

type PinFileResp struct {
	ResultBase
	Data *model.PinFileResponse
}

func (*PinFileResp) CreateData

func (r *PinFileResp) CreateData() interface{}

type PinResp

type PinResp struct {
	ResultBase
	Data *model.PinStatus
}

func (*PinResp) CreateData

func (r *PinResp) CreateData() interface{}

type PinnedTotalResp

type PinnedTotalResp struct {
	ResultBase
	Data *model.PinnedTotal
}

func (*PinnedTotalResp) CreateData

func (r *PinnedTotalResp) CreateData() interface{}

type Responder

type Responder interface {
	SetCode(code int)
	CreateFailure() *model.Failure
	CreateData() interface{}
}

type ResultBase

type ResultBase struct {
	Code    int
	Failure *model.Failure
}

func (*ResultBase) CreateData

func (rb *ResultBase) CreateData() interface{}

func (*ResultBase) CreateFailure

func (rb *ResultBase) CreateFailure() *model.Failure

func (*ResultBase) SetCode

func (rb *ResultBase) SetCode(code int)

type UploadTokenResp

type UploadTokenResp struct {
	ResultBase
	Data *model.UploadResponse
}

func (*UploadTokenResp) CreateData

func (r *UploadTokenResp) CreateData() interface{}

type XLanguage

type XLanguage string
const (
	ZH XLanguage = "zh"
	EN XLanguage = "en"
)

Jump to

Keyboard shortcuts

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