Documentation ¶
Index ¶
- type Client
- func NewClient() (client *Client, err error)
- func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)
- func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error)
- func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error)
- func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error)
- func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)
- func NewClientWithRamRoleArnAndPolicy(regionId string, ...) (client *Client, err error)
- func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)
- func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)
- func (client *Client) TranslateText(request *TranslateTextRequest) (response *TranslateTextResponse, err error)
- func (client *Client) TranslateTextWithCallback(request *TranslateTextRequest, ...) <-chan int
- func (client *Client) TranslateTextWithChan(request *TranslateTextRequest) (<-chan *TranslateTextResponse, <-chan error)
- type Data
- type TranslateTextRequest
- type TranslateTextResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the sdk client struct, each func corresponds to an OpenAPI
func NewClientWithAccessKey ¶
func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)
NewClientWithAccessKey is a shortcut to create sdk client with accesskey usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithEcsRamRole ¶
NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithOptions ¶
func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error)
NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential this is the common api to create a sdk client
func NewClientWithProvider ¶
func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error)
NewClientWithProvider creates a sdk client with providers usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithRamRoleArn ¶
func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)
NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithRamRoleArnAndPolicy ¶
func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error)
NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithRsaKeyPair ¶
func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)
NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithStsToken ¶
func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)
NewClientWithStsToken is a shortcut to create sdk client with sts token usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func (*Client) TranslateText ¶
func (client *Client) TranslateText(request *TranslateTextRequest) (response *TranslateTextResponse, err error)
TranslateText invokes the hiknoengine.TranslateText API synchronously api document: https://help.aliyun.com/api/hiknoengine/translatetext.html
func (*Client) TranslateTextWithCallback ¶
func (client *Client) TranslateTextWithCallback(request *TranslateTextRequest, callback func(response *TranslateTextResponse, err error)) <-chan int
TranslateTextWithCallback invokes the hiknoengine.TranslateText API asynchronously api document: https://help.aliyun.com/api/hiknoengine/translatetext.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (*Client) TranslateTextWithChan ¶
func (client *Client) TranslateTextWithChan(request *TranslateTextRequest) (<-chan *TranslateTextResponse, <-chan error)
TranslateTextWithChan invokes the hiknoengine.TranslateText API asynchronously api document: https://help.aliyun.com/api/hiknoengine/translatetext.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
type Data ¶
type Data struct {
Text string `json:"Text" xml:"Text"`
}
Data is a nested struct in hiknoengine response
type TranslateTextRequest ¶
type TranslateTextRequest struct { *requests.RpcRequest FromLang string `position:"Body" name:"FromLang"` ToLang string `position:"Body" name:"ToLang"` Text string `position:"Body" name:"Text"` }
TranslateTextRequest is the request struct for api TranslateText
func CreateTranslateTextRequest ¶
func CreateTranslateTextRequest() (request *TranslateTextRequest)
CreateTranslateTextRequest creates a request to invoke TranslateText API
type TranslateTextResponse ¶
type TranslateTextResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Code string `json:"Code" xml:"Code"` Message string `json:"Message" xml:"Message"` Data Data `json:"Data" xml:"Data"` }
TranslateTextResponse is the response struct for api TranslateText
func CreateTranslateTextResponse ¶
func CreateTranslateTextResponse() (response *TranslateTextResponse)
CreateTranslateTextResponse creates a response to parse from TranslateText response