Documentation
¶
Index ¶
- Constants
- Variables
- func MakeInternalError(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func NewListEndpoint(s Service) goa.Endpoint
- func NewVersionsByIDEndpoint(s Service) goa.Endpoint
- func NewViewedResourceVersions(res *ResourceVersions, view string) *resourceviews.ResourceVersions
- func NewViewedResources(res *Resources, view string) *resourceviews.Resources
- type Catalog
- type Category
- type Client
- type Endpoints
- type Platform
- type ResourceData
- type ResourceDataCollection
- type ResourceVersionData
- type ResourceVersions
- type Resources
- type Service
- type Tag
- type Versions
- type VersionsByIDPayload
Constants ¶
const ServiceName = "resource"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [2]string{"List", "VersionsByID"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeInternalError ¶
func MakeInternalError(err error) *goa.ServiceError
MakeInternalError builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "List" of service "resource".
func NewVersionsByIDEndpoint ¶
NewVersionsByIDEndpoint returns an endpoint function that calls the method "VersionsByID" of service "resource".
func NewViewedResourceVersions ¶
func NewViewedResourceVersions(res *ResourceVersions, view string) *resourceviews.ResourceVersions
NewViewedResourceVersions initializes viewed result type ResourceVersions from result type ResourceVersions using the given view.
func NewViewedResources ¶
func NewViewedResources(res *Resources, view string) *resourceviews.Resources
NewViewedResources initializes viewed result type Resources from result type Resources using the given view.
Types ¶
type Client ¶
Client is the "resource" service client.
func (*Client) VersionsByID ¶
func (c *Client) VersionsByID(ctx context.Context, p *VersionsByIDPayload) (res *ResourceVersions, err error)
VersionsByID calls the "VersionsByID" endpoint of the "resource" service.
type Endpoints ¶
Endpoints wraps the "resource" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "resource" service with endpoints.
type ResourceData ¶
type ResourceData struct {
// ID is the unique id of the resource
ID uint
// Name of resource
Name string
// Type of catalog to which resource belongs
Catalog *Catalog
// Categories related to resource
Categories []*Category
// Kind of resource
Kind string
// Url path of the resource in hub
HubURLPath string
// Latest version of resource
LatestVersion *ResourceVersionData
// Tags related to resource
Tags []*Tag
// Platforms related to resource
Platforms []*Platform
// Rating of resource
Rating float64
// List of all versions of a resource
Versions []*ResourceVersionData
}
The resource type describes resource information.
type ResourceDataCollection ¶
type ResourceDataCollection []*ResourceData
type ResourceVersionData ¶
type ResourceVersionData struct {
// ID is the unique id of resource's version
ID uint
// Version of resource
Version string
// Display name of version
DisplayName string
// Deprecation status of a version
Deprecated *bool
// Description of version
Description string
// Minimum pipelines version the resource's version is compatible with
MinPipelinesVersion string
// Raw URL of resource's yaml file of the version
RawURL string
// Web URL of resource's yaml file of the version
WebURL string
// Timestamp when version was last updated
UpdatedAt string
// Platforms related to resource version
Platforms []*Platform
// Url path of the resource in hub
HubURLPath string
// Resource to which the version belongs
Resource *ResourceData
}
The Version result type describes resource's version information.
type ResourceVersions ¶
type ResourceVersions struct {
Data *Versions
}
ResourceVersions is the result type of the resource service VersionsByID method.
func NewResourceVersions ¶
func NewResourceVersions(vres *resourceviews.ResourceVersions) *ResourceVersions
NewResourceVersions initializes result type ResourceVersions from viewed result type ResourceVersions.
type Resources ¶
type Resources struct {
Data ResourceDataCollection
}
Resources is the result type of the resource service List method.
func NewResources ¶
func NewResources(vres *resourceviews.Resources) *Resources
NewResources initializes result type Resources from viewed result type Resources.
type Service ¶
type Service interface {
// List all resources sorted by rating and name
List(context.Context) (res *Resources, err error)
// Find all versions of a resource by its id
VersionsByID(context.Context, *VersionsByIDPayload) (res *ResourceVersions, err error)
}
The resource service provides details about all kind of resources
type Versions ¶
type Versions struct {
// Latest Version of resource
Latest *ResourceVersionData
// List of all versions of resource
Versions []*ResourceVersionData
}
The Versions type describes response for versions by resource id API.
type VersionsByIDPayload ¶
type VersionsByIDPayload struct {
// ID of a resource
ID uint
}
VersionsByIDPayload is the payload type of the resource service VersionsByID method.