mirror of
https://github.com/rancher/norman.git
synced 2025-09-02 07:44:51 +00:00
Change ById to ByID
This commit is contained in:
@@ -258,8 +258,8 @@ func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, upda
|
||||
return a.Ops.DoUpdate(schemaType, existing, updates, respObject)
|
||||
}
|
||||
|
||||
func (a *APIBaseClient) ById(schemaType string, id string, respObject interface{}) error {
|
||||
return a.Ops.DoById(schemaType, id, respObject)
|
||||
func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error {
|
||||
return a.Ops.DoByID(schemaType, id, respObject)
|
||||
}
|
||||
|
||||
func (a *APIBaseClient) Delete(existing *types.Resource) error {
|
||||
|
@@ -212,7 +212,7 @@ func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, up
|
||||
return a.DoModify("PUT", selfUrl, updates, respObject)
|
||||
}
|
||||
|
||||
func (a *APIOperations) DoById(schemaType string, id string, respObject interface{}) error {
|
||||
func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error {
|
||||
schema, ok := a.Types[schemaType]
|
||||
if !ok {
|
||||
return errors.New("Unknown schema type [" + schemaType + "]")
|
||||
|
@@ -39,7 +39,7 @@ type {{.schema.CodeName}}Operations interface {
|
||||
List(opts *types.ListOpts) (*{{.schema.CodeName}}Collection, error)
|
||||
Create(opts *{{.schema.CodeName}}) (*{{.schema.CodeName}}, error)
|
||||
Update(existing *{{.schema.CodeName}}, updates interface{}) (*{{.schema.CodeName}}, error)
|
||||
ById(id string) (*{{.schema.CodeName}}, error)
|
||||
ByID(id string) (*{{.schema.CodeName}}, error)
|
||||
Delete(container *{{.schema.CodeName}}) error{{range $key, $value := .resourceActions}}
|
||||
{{if eq $value.Input "" }}
|
||||
Action{{$key | capitalize}} (*{{$.schema.CodeName}}) (*{{.Output | capitalize}}, error)
|
||||
@@ -83,9 +83,9 @@ func (cc *{{.schema.CodeName}}Collection) Next() (*{{.schema.CodeName}}Collectio
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *{{.schema.CodeName}}Client) ById(id string) (*{{.schema.CodeName}}, error) {
|
||||
func (c *{{.schema.CodeName}}Client) ByID(id string) (*{{.schema.CodeName}}, error) {
|
||||
resp := &{{.schema.CodeName}}{}
|
||||
err := c.apiClient.Ops.DoById({{.schema.CodeName}}Type, id, resp)
|
||||
err := c.apiClient.Ops.DoByID({{.schema.CodeName}}Type, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user