request

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package request is the request of service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToQueryMap

func ToQueryMap(req Common) (map[string]string, error)

ToQueryMap will convert a request to string map

Types

type Common

type Common interface {
	GetAction() string
	SetAction(string) error

	GetRegion() string
	SetRegion(string) error

	GetProjectId() string
	SetProjectId(string) error

	GetZone() string
	SetZone(string) error

	SetRetryCount(int)
	GetRetryCount() int

	WithRetry(int)
	GetMaxretries() int

	WithTimeout(time.Duration)
	GetTimeout() time.Duration

	SetRequestTime(time.Time)
	GetRequestTime() time.Time

	SetRetryable(retryable bool)
	GetRetryable() bool
}

Common is the common request

type CommonBase

type CommonBase struct {
	Action    *string
	Region    *string
	Zone      *string
	ProjectId *string
	// contains filtered or unexported fields
}

CommonBase is the base struct of common request

func (*CommonBase) GetAction

func (c *CommonBase) GetAction() string

GetAction will return action of request

func (*CommonBase) GetMaxretries

func (c *CommonBase) GetMaxretries() int

GetMaxretries will return max retry count of request

func (*CommonBase) GetProjectId

func (c *CommonBase) GetProjectId() string

GetProjectId will get project id of request

func (*CommonBase) GetRegion

func (c *CommonBase) GetRegion() string

GetRegion will return region of request

func (*CommonBase) GetRequestTime

func (c *CommonBase) GetRequestTime() time.Time

GetRequestTime will get timeout of request

func (*CommonBase) GetRetryCount

func (c *CommonBase) GetRetryCount() int

GetRetryCount will return retry count of request

func (*CommonBase) GetRetryable

func (c *CommonBase) GetRetryable() bool

GetRetryable will return if the request is retryable

func (*CommonBase) GetTimeout

func (c *CommonBase) GetTimeout() time.Duration

GetTimeout will get timeout of request

func (*CommonBase) GetZone added in v0.6.3

func (c *CommonBase) GetZone() string

GetZone will return zone of request

func (*CommonBase) SetAction

func (c *CommonBase) SetAction(val string) error

SetAction will set action of request

func (*CommonBase) SetProjectId

func (c *CommonBase) SetProjectId(val string) error

SetProjectId will set project id of request

func (*CommonBase) SetRegion

func (c *CommonBase) SetRegion(val string) error

SetRegion will set region of request

func (*CommonBase) SetRequestTime

func (c *CommonBase) SetRequestTime(requestTime time.Time)

SetRequestTime will set timeout of request

func (*CommonBase) SetRetryCount

func (c *CommonBase) SetRetryCount(retryCount int)

SetRetryCount will set retry count of request

func (*CommonBase) SetRetryable

func (c *CommonBase) SetRetryable(retryable bool)

SetRetryable will set if the request is retryable

func (*CommonBase) SetZone added in v0.6.3

func (c *CommonBase) SetZone(val string) error

SetZone will set zone of request

func (*CommonBase) WithRetry

func (c *CommonBase) WithRetry(maxRetries int)

WithRetry will set max retry count of request

func (*CommonBase) WithTimeout

func (c *CommonBase) WithTimeout(timeout time.Duration)

WithTimeout will set timeout of request

Jump to

Keyboard shortcuts

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