resource

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

func NewListEndpoint(s Service) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "List" of service "resource".

func NewVersionsByIDEndpoint

func NewVersionsByIDEndpoint(s Service) goa.Endpoint

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 Catalog

type Catalog struct {
	// ID is the unique id of the catalog
	ID uint
	// Name of catalog
	Name string
	// Type of catalog
	Type string
	// URL of catalog
	URL string
	// Provider of catalog
	Provider string
}

type Category

type Category struct {
	// ID is the unique id of the category
	ID uint
	// Name of category
	Name string
}

type Client

type Client struct {
	ListEndpoint         goa.Endpoint
	VersionsByIDEndpoint goa.Endpoint
}

Client is the "resource" service client.

func NewClient

func NewClient(list, versionsByID goa.Endpoint) *Client

NewClient initializes a "resource" service client given the endpoints.

func (*Client) List

func (c *Client) List(ctx context.Context) (res *Resources, err error)

List calls the "List" endpoint of the "resource" service.

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

type Endpoints struct {
	List         goa.Endpoint
	VersionsByID goa.Endpoint
}

Endpoints wraps the "resource" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "resource" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "resource" service endpoints.

type Platform

type Platform struct {
	// ID is the unique id of platform
	ID uint
	// Name of platform
	Name string
}

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 Tag

type Tag struct {
	// ID is the unique id of tag
	ID uint
	// Name of tag
	Name string
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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