本文整理汇总了Golang中github.com/aws/amazon-ecs-agent/agent/engine.TaskEngine.Version方法的典型用法代码示例。如果您正苦于以下问题:Golang TaskEngine.Version方法的具体用法?Golang TaskEngine.Version怎么用?Golang TaskEngine.Version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/amazon-ecs-agent/agent/engine.TaskEngine
的用法示例。
在下文中一共展示了TaskEngine.Version方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AcsWsUrl
// AcsWsUrl returns the websocket url for ACS given the endpoint.
func AcsWsUrl(endpoint, cluster, containerInstanceArn string, taskEngine engine.TaskEngine) string {
acsUrl := endpoint
if endpoint[len(endpoint)-1] != '/' {
acsUrl += "/"
}
acsUrl += "ws"
query := url.Values{}
query.Set("clusterArn", cluster)
query.Set("containerInstanceArn", containerInstanceArn)
query.Set("agentHash", version.GitHashString())
query.Set("agentVersion", version.Version)
query.Set("seqNum", strconv.FormatInt(SequenceNumber.Get(), 10))
if dockerVersion, err := taskEngine.Version(); err == nil {
query.Set("dockerVersion", dockerVersion)
}
return acsUrl + "?" + query.Encode()
}
示例2: acsWsURL
// acsWsURL returns the websocket url for ACS given the endpoint
func acsWsURL(endpoint, cluster, containerInstanceArn string, taskEngine engine.TaskEngine, acsSessionState sessionState) string {
acsUrl := endpoint
if endpoint[len(endpoint)-1] != '/' {
acsUrl += "/"
}
acsUrl += "ws"
query := url.Values{}
query.Set("clusterArn", cluster)
query.Set("containerInstanceArn", containerInstanceArn)
query.Set("agentHash", version.GitHashString())
query.Set("agentVersion", version.Version)
query.Set("seqNum", "1")
if dockerVersion, err := taskEngine.Version(); err == nil {
query.Set("dockerVersion", dockerVersion)
}
query.Set(sendCredentialsURLParameterName, acsSessionState.getSendCredentialsURLParameter())
return acsUrl + "?" + query.Encode()
}