Documentation
¶
Index ¶
- func GenerateUrl(resource Resource, url string, args []string) (string, error)
- func GetNumberOfVariablesNeeded(url string) (int, error)
- func GetPluralResourceNames() []string
- func GetPluralResources() map[string]Resource
- func GetSingularResourceNames() []string
- func GetTypesOfVariablesNeeded(url string) ([]string, error)
- type CrudEntityAttribute
- type CrudEntityInfo
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateUrl ¶ added in v0.1.0
func GetNumberOfVariablesNeeded ¶ added in v0.1.0
func GetPluralResourceNames ¶ added in v0.1.0
func GetPluralResourceNames() []string
func GetPluralResources ¶ added in v0.1.0
func GetSingularResourceNames ¶ added in v0.1.0
func GetSingularResourceNames() []string
func GetTypesOfVariablesNeeded ¶ added in v0.5.0
Types ¶
type CrudEntityAttribute ¶
type CrudEntityInfo ¶
type CrudEntityInfo struct {
// A link to the docs specific for the Crud operation in EPCC.
Docs string `yaml:"docs"`
// The Url we should use when invoking this method.
Url string `yaml:"url"`
// Content type to send
ContentType string `yaml:"content-type"`
// A list of valid query parameters
QueryParameters string `yaml:"query"`
}
type Resource ¶
type Resource struct {
// The type as far as the EPCC CLI is concerned.
Type string
// A link to the generic documentation page about a type in the EPCC API
Docs string `yaml:"docs"`
// The type that should be used in the JSON API.
JsonApiType string `yaml:"json-api-type"`
// Some resources (e.g., PCM, accelerator svc, bury most attributes under the attributes key). This is considered "compliant", other services just bury attributes under data, this is "legacy.
JsonApiFormat string `yaml:"json-api-format"`
// Information about how to get a collection
GetCollectionInfo *CrudEntityInfo `yaml:"get-collection"`
// Information about how to get a single object.
GetEntityInfo *CrudEntityInfo `yaml:"get-entity"`
// Information about how to create an entity.
CreateEntityInfo *CrudEntityInfo `yaml:"create-entity"`
// Information about how to update an entity.
UpdateEntityInfo *CrudEntityInfo `yaml:"update-entity"`
// Information about how to delete an entity.
DeleteEntityInfo *CrudEntityInfo `yaml:"delete-entity"`
Attributes map[string]*CrudEntityAttribute `yaml:"attributes"`
// If true, don't wrap json in a data tag
NoWrapping bool `yaml:"no-wrapping"`
// The singular name version of the resource.
SingularName string `yaml:"singular-name"`
PluralName string
}
func GetResourceByName ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.