This is an automated email from the ASF dual-hosted git repository. dangogh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit e3e2c05aa1aa80ac9c80c43a5c80fd669fb6dbac Author: Dewayne Richardson <dewr...@apache.org> AuthorDate: Wed Feb 21 11:26:14 2018 -0700 updated to support the GetID() interface change and the Inserter to Creator interface rename --- traffic_ops/traffic_ops_golang/asn/asns.go | 4 ++-- .../traffic_ops_golang/deliveryservice/deliveryservices_test.go | 4 ++-- traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go | 6 +++--- .../traffic_ops_golang/deliveryservice/request/requests_test.go | 4 ++-- traffic_ops/traffic_ops_golang/division/divisions.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/asn/asns.go b/traffic_ops/traffic_ops_golang/asn/asns.go index 59ea4cc..b2a129f 100644 --- a/traffic_ops/traffic_ops_golang/asn/asns.go +++ b/traffic_ops/traffic_ops_golang/asn/asns.go @@ -47,8 +47,8 @@ func GetRefType() *TOASN { } //Implementation of the Identifier, Validator interface functions -func (asn *TOASN) GetID() int { - return asn.ID +func (asn *TOASN) GetID() (int, bool) { + return asn.ID, true } func (asn *TOASN) GetAuditName() string { diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices_test.go b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices_test.go index 55dd62e..28c50ce 100644 --- a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices_test.go +++ b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices_test.go @@ -32,8 +32,8 @@ func getInterface(req *TODeliveryService) interface{} { func TestInterfaces(t *testing.T) { r := getInterface(&TODeliveryService{}) - if _, ok := r.(api.Inserter); !ok { - t.Errorf("DeliveryService must be Inserter") + if _, ok := r.(api.Creator); !ok { + t.Errorf("DeliveryService must be Creator") } // TODO: uncomment when ds.Reader interface is implemented /*if _, ok := r.(api.Reader); !ok { diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go index 6770be9..aff4678 100644 --- a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go +++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go @@ -267,14 +267,14 @@ func (req *TODeliveryServiceRequest) Update(db *sqlx.DB, user auth.CurrentUser) return nil, tc.NoError } -// Insert implements the tc.Inserter interface -//all implementations of Inserter should use transactions and return the proper errorType +// Creator implements the tc.Creator interface +//all implementations of Creator should use transactions and return the proper errorType //ParsePQUniqueConstraintError is used to determine if a request with conflicting values exists //if so, it will return an errorType of DataConflict and the type should be appended to the //generic error message returned //The insert sql returns the id and lastUpdated values of the newly inserted request and have //to be added to the struct -func (req *TODeliveryServiceRequest) Insert(db *sqlx.DB, user auth.CurrentUser) (error, tc.ApiErrorType) { +func (req *TODeliveryServiceRequest) Create(db *sqlx.DB, user auth.CurrentUser) (error, tc.ApiErrorType) { if req == nil { return errors.New("nil deliveryservice_request"), tc.SystemError } diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests_test.go b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests_test.go index 103a9c6..e038f69 100644 --- a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests_test.go +++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests_test.go @@ -32,8 +32,8 @@ func TestInterfaces(t *testing.T) { var i interface{} i = &TODeliveryServiceRequest{} - if _, ok := i.(api.Inserter); !ok { - t.Errorf("DeliveryServiceRequest must be Inserter") + if _, ok := i.(api.Creator); !ok { + t.Errorf("DeliveryServiceRequest must be Creator") } if _, ok := i.(api.Reader); !ok { t.Errorf("DeliveryServiceRequest must be Reader") diff --git a/traffic_ops/traffic_ops_golang/division/divisions.go b/traffic_ops/traffic_ops_golang/division/divisions.go index 881e7c0..176c256 100644 --- a/traffic_ops/traffic_ops_golang/division/divisions.go +++ b/traffic_ops/traffic_ops_golang/division/divisions.go @@ -47,8 +47,8 @@ func (division *TODivision) GetAuditName() string { } //Implementation of the Identifier, Validator interface functions -func (division *TODivision) GetID() int { - return division.ID +func (division *TODivision) GetID() (int, bool) { + return division.ID, true } func (division *TODivision) SetID(i int) { division.ID = i -- To stop receiving notification emails like this one, please contact dang...@apache.org.