resources

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUrl added in v0.1.0

func GenerateUrl(resource Resource, url string, args []string) (string, error)

func GetNumberOfVariablesNeeded added in v0.1.0

func GetNumberOfVariablesNeeded(url string) (int, error)

func GetPluralResourceNames added in v0.1.0

func GetPluralResourceNames() []string

func GetPluralResources added in v0.1.0

func GetPluralResources() map[string]Resource

func GetSingularResourceNames added in v0.1.0

func GetSingularResourceNames() []string

func GetTypesOfVariablesNeeded added in v0.5.0

func GetTypesOfVariablesNeeded(url string) ([]string, error)

Types

type CrudEntityAttribute

type CrudEntityAttribute struct {
	// The name of the attribute
	Key string

	// The type of the attribute
	Type string `yaml:"type"`
}

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

func GetResourceByName(name string) (Resource, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL