Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a426790
add github ci action and get rid of travis (#524)
ShiChangkuo Jul 15, 2021
b154896
format: make ci happy (#525)
ShiChangkuo Jul 15, 2021
a4f462f
new apig throttling policy sdk supported (#527)
Lance52259 Jul 20, 2021
8a06439
dds: support update size, num and spec_code in flavor (#528)
Jason-Zhang9309 Jul 20, 2021
9c0ea4e
feat: support dli queue list method (#522)
hmbig2 Jul 20, 2021
d1f7597
feat: New APIG custom authorizers sdk supported (#526)
Lance52259 Jul 21, 2021
8d8eb4e
add special throttling policy to throttles sdk (#529)
Lance52259 Jul 21, 2021
4b36e0e
update the mrs v1.1 sdk (#479)
Lance52259 Jul 21, 2021
82d5668
feat: add cloudvolume and job APIs support (#530)
ShiChangkuo Jul 21, 2021
b458e03
identity: update format of custom policy statement (#533)
ShiChangkuo Jul 22, 2021
2c941d8
fix: untag omitempty for CreateOpts.ResourceMode of dli queeus (#532)
hmbig2 Jul 22, 2021
4039dc7
[ELB] Add certificate query list function in the ELB v2 service (#531)
chengxiangdong Jul 22, 2021
d50d015
Expose the real error message of Internal Server Error (#536)
niuzhenguo Jul 26, 2021
70989ca
support remove API in cce node (#534)
Jason-Zhang9309 Jul 26, 2021
a2f63cd
Add MoreHeaders for SCM APIs (#535)
chengxiangdong Jul 27, 2021
27f558d
feat: new mrs v2 cluster sdk supported (#537)
Lance52259 Jul 28, 2021
5a5bd07
The SMN topic support specified enterprise project (#540)
hmbig2 Jul 29, 2021
dd0ea90
support add in cce node (#539)
Jason-Zhang9309 Jul 29, 2021
d2cb9e3
update mrs v1 cluster sdk (#541)
Lance52259 Jul 29, 2021
85c6b7a
Add mysql proxy enlarge support (#538)
niuzhenguo Jul 29, 2021
e4c4c50
[dcs] support to get dcs v2 flavors (#542)
ShiChangkuo Jul 30, 2021
3c4a88a
feat: new mrs v2 job sdk supported (#543)
Lance52259 Aug 2, 2021
e8d3875
new rds database securities sdk support (#544)
Lance52259 Aug 5, 2021
9e77be8
trim response body for 403 error (#545)
ShiChangkuo Aug 5, 2021
ee9e149
support hibernate/awake in cce cluster (#546)
Jason-Zhang9309 Aug 6, 2021
cd91ae3
add new api sdk of apig service (#547)
Lance52259 Aug 9, 2021
56e12ce
update iam user result object (#550)
ShiChangkuo Aug 9, 2021
f7ad778
support dli queue scale (#549)
hmbig2 Aug 11, 2021
26588c1
feat(scm/waf): Add query policy list function (#551)
chengxiangdong Aug 11, 2021
655bb6d
refactor trigger and add update method (#552)
Lance52259 Aug 11, 2021
884339e
[WAF] Change the return value of the ListPolicy to pointer type (#553)
chengxiangdong Aug 13, 2021
b359838
mrs: update the description of password rules (#555)
Lance52259 Aug 16, 2021
914d195
feat: add ability to manage the dms kafka topics (#557)
ShiChangkuo Aug 17, 2021
df4367b
feat(waf/premium_instances): Add SDK for WAF premium instance (#559)
chengxiangdong Aug 19, 2021
3e00e5c
add query mrs hosts function (#561)
hmbig2 Aug 19, 2021
54ca43c
add validation of domain name in AKSK authentication (#564)
ShiChangkuo Aug 20, 2021
97be714
feat(waf/premium_domain): Add SDK for WAF premium domain (#563)
chengxiangdong Aug 23, 2021
013b572
ecs: change the map value of SubJob.Entities to interface
ShiChangkuo Aug 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This is a ci workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
# push:
# branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Setup environment
run: |
go get golang.org/x/crypto/ssh
go get golang.org/x/tools/cmd/goimports
go get github.com/wadey/gocovmerge
go get github.com/mattn/goveralls

- name: Run go vet
run: go vet ./...

- name: Run format check
run: |
./script/format

- name: Run unit tests
run: |
./script/unittest
./script/coverage

- uses: shogo82148/[email protected]
with:
path-to-profile: cover.out
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/*.swp
.idea
.vscode
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

25 changes: 22 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package golangsdk

import "fmt"
import (
"fmt"
"strings"
)

// BaseError is an error type that all other error types embed.
type BaseError struct {
Expand Down Expand Up @@ -118,9 +121,21 @@ func (e ErrDefault401) Error() string {
return "Authentication failed"
}
func (e ErrDefault403) Error() string {
var maxLength int = 200
var unAuthorized string = "Request not authorized"

messageBody := string(e.Body)
if len(messageBody) > maxLength {
if strings.Contains(messageBody, unAuthorized) {
messageBody = unAuthorized
} else {
messageBody = messageBody[:maxLength] + "\n..."
}
}

e.DefaultErrString = fmt.Sprintf(
"Action forbidden: [%s %s], error message: %s",
e.Method, e.URL, e.Body,
e.Method, e.URL, messageBody,
)
return e.choseErrString()
}
Expand All @@ -145,7 +160,11 @@ func (e ErrDefault429) Error() string {
return e.choseErrString()
}
func (e ErrDefault500) Error() string {
return "Internal Server Error"
e.DefaultErrString = fmt.Sprintf(
"Internal Server Error: [%s %s], error message: %s",
e.Method, e.URL, e.Body,
)
return e.choseErrString()
}
func (e ErrDefault503) Error() string {
return "The service is currently unable to handle the request due to a temporary" +
Expand Down
Loading