-
Notifications
You must be signed in to change notification settings - Fork 351
Add Traffic Ops Golang Steering Targets #2803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Refer to this link for build results (access rights to CI server needed): |
dee4d61
to
72c3449
Compare
Refer to this link for build results (access rights to CI server needed): |
72c3449
to
822cf3d
Compare
Refer to this link for build results (access rights to CI server needed): |
822cf3d
to
4ccceea
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
retest this please |
Refer to this link for build results (access rights to CI server needed): |
@@ -47,9 +47,6 @@ type SteeringTargetNullable struct { | |||
|
|||
func (st SteeringTargetNullable) Validate(tx *sql.Tx) error { | |||
errs := []string{} | |||
if st.TargetID == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we putting validation rules on the struct instead of in the controller? Seems like our Business Rules will be scattered otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the validation applies to the object. Not sure what you mean by "controller". If you mean the "CRUDer" objects, only a small percentage of our endpoints are "CRUD", by making all Validate
funcs members of the real objects, we prevent them being scattered, and can keep them all in one place.
Putting it in lib/tc
also makes the validation accessible to external libraries, if it's useful to someone to do their own validation.
What does this PR do?
Add Traffic Ops Golang Steering Targets
Which TC components are affected by this PR?
What is the best way to verify this PR?
go test
,/api/1.2/steering/dsid/targets
Check all that apply