mirror of
https://github.com/rancher/norman.git
synced 2025-09-19 09:50:52 +00:00
Add action to url builder
This commit is contained in:
committed by
Darren Shepherd
parent
df13831994
commit
f26502f753
@@ -148,6 +148,7 @@ type URLBuilder interface {
|
|||||||
Sort(field string) string
|
Sort(field string) string
|
||||||
SetSubContext(subContext string)
|
SetSubContext(subContext string)
|
||||||
FilterLink(schema *Schema, fieldName string, value string) string
|
FilterLink(schema *Schema, fieldName string, value string) string
|
||||||
|
Action(action string, resource *RawResource) string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Store interface {
|
type Store interface {
|
||||||
|
@@ -254,3 +254,7 @@ func parseResponseURLBase(requestURL string, r *http.Request) (string, error) {
|
|||||||
|
|
||||||
return requestURL[0:index], nil
|
return requestURL[0:index], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *urlBuilder) Action(action string, resource *types.RawResource) string {
|
||||||
|
return u.constructBasicURL(resource.Schema.Version, resource.Schema.PluralName, resource.ID) + "?action=" + url.QueryEscape(action)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user