Documentation
¶
Index ¶
- Constants
- Variables
- func MakeInternalError(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func NewByCatalogKindNameEndpoint(s Service) goa.Endpoint
- func NewByCatalogKindNameVersionEndpoint(s Service) goa.Endpoint
- func NewByIDEndpoint(s Service) goa.Endpoint
- func NewByVersionIDEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewQueryEndpoint(s Service) goa.Endpoint
- func NewVersionsByIDEndpoint(s Service) goa.Endpoint
- func NewViewedResources(res *Resources, view string) *resourceviews.Resources
- type ByCatalogKindNamePayload
- type ByCatalogKindNameResult
- type ByCatalogKindNameVersionPayload
- type ByCatalogKindNameVersionResult
- type ByIDPayload
- type ByIDResult
- type ByVersionIDPayload
- type ByVersionIDResult
- type Catalog
- type Category
- type Client
- func (c *Client) ByCatalogKindName(ctx context.Context, p *ByCatalogKindNamePayload) (res *ByCatalogKindNameResult, err error)
- func (c *Client) ByCatalogKindNameVersion(ctx context.Context, p *ByCatalogKindNameVersionPayload) (res *ByCatalogKindNameVersionResult, err error)
- func (c *Client) ByID(ctx context.Context, p *ByIDPayload) (res *ByIDResult, err error)
- func (c *Client) ByVersionID(ctx context.Context, p *ByVersionIDPayload) (res *ByVersionIDResult, err error)
- func (c *Client) List(ctx context.Context) (res *Resources, err error)
- func (c *Client) Query(ctx context.Context, p *QueryPayload) (res *QueryResult, err error)
- func (c *Client) VersionsByID(ctx context.Context, p *VersionsByIDPayload) (res *VersionsByIDResult, err error)
- type Endpoints
- type Platform
- type QueryPayload
- type QueryResult
- type ResourceData
- type ResourceDataCollection
- type ResourceVersionData
- type Resources
- type Service
- type Tag
- type VersionsByIDPayload
- type VersionsByIDResult
Constants ¶
const APIName = "hub"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0"
APIVersion is the version of the API as defined in the design.
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 = [7]string{"Query", "List", "VersionsByID", "ByCatalogKindNameVersion", "ByVersionId", "ByCatalogKindName", "ById"}
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 NewByCatalogKindNameEndpoint ¶ added in v1.7.2
NewByCatalogKindNameEndpoint returns an endpoint function that calls the method "ByCatalogKindName" of service "resource".
func NewByCatalogKindNameVersionEndpoint ¶ added in v1.7.2
NewByCatalogKindNameVersionEndpoint returns an endpoint function that calls the method "ByCatalogKindNameVersion" of service "resource".
func NewByIDEndpoint ¶ added in v1.7.2
NewByIDEndpoint returns an endpoint function that calls the method "ById" of service "resource".
func NewByVersionIDEndpoint ¶ added in v1.7.2
NewByVersionIDEndpoint returns an endpoint function that calls the method "ByVersionId" of service "resource".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "List" of service "resource".
func NewQueryEndpoint ¶ added in v1.7.2
NewQueryEndpoint returns an endpoint function that calls the method "Query" of service "resource".
func NewVersionsByIDEndpoint ¶
NewVersionsByIDEndpoint returns an endpoint function that calls the method "VersionsByID" of service "resource".
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 ByCatalogKindNamePayload ¶ added in v1.7.2
type ByCatalogKindNamePayload struct { // name of catalog Catalog string // kind of resource Kind string // Name of resource Name string // To find resource compatible with a Tekton pipelines version, use this param Pipelinesversion *string }
ByCatalogKindNamePayload is the payload type of the resource service ByCatalogKindName method.
type ByCatalogKindNameResult ¶ added in v1.7.2
type ByCatalogKindNameResult struct { // Redirect URL Location string }
ByCatalogKindNameResult is the result type of the resource service ByCatalogKindName method.
type ByCatalogKindNameVersionPayload ¶ added in v1.7.2
type ByCatalogKindNameVersionPayload struct { // name of catalog Catalog string // kind of resource Kind string // name of resource Name string // version of resource Version string }
ByCatalogKindNameVersionPayload is the payload type of the resource service ByCatalogKindNameVersion method.
type ByCatalogKindNameVersionResult ¶ added in v1.7.2
type ByCatalogKindNameVersionResult struct { // Redirect URL Location string }
ByCatalogKindNameVersionResult is the result type of the resource service ByCatalogKindNameVersion method.
type ByIDPayload ¶ added in v1.7.2
type ByIDPayload struct { // ID of a resource ID uint }
ByIDPayload is the payload type of the resource service ById method.
type ByIDResult ¶ added in v1.7.2
type ByIDResult struct { // Redirect URL Location string }
ByIDResult is the result type of the resource service ById method.
type ByVersionIDPayload ¶ added in v1.7.2
type ByVersionIDPayload struct { // Version ID of a resource's version VersionID uint }
ByVersionIDPayload is the payload type of the resource service ByVersionId method.
type ByVersionIDResult ¶ added in v1.7.2
type ByVersionIDResult struct { // Redirect URL Location string }
ByVersionIDResult is the result type of the resource service ByVersionId method.
type Client ¶
type Client struct { QueryEndpoint goa.Endpoint ListEndpoint goa.Endpoint VersionsByIDEndpoint goa.Endpoint ByCatalogKindNameVersionEndpoint goa.Endpoint ByVersionIDEndpoint goa.Endpoint ByCatalogKindNameEndpoint goa.Endpoint ByIDEndpoint goa.Endpoint }
Client is the "resource" service client.
func NewClient ¶
func NewClient(query, list, versionsByID, byCatalogKindNameVersion, byVersionID, byCatalogKindName, byID goa.Endpoint) *Client
NewClient initializes a "resource" service client given the endpoints.
func (*Client) ByCatalogKindName ¶ added in v1.7.2
func (c *Client) ByCatalogKindName(ctx context.Context, p *ByCatalogKindNamePayload) (res *ByCatalogKindNameResult, err error)
ByCatalogKindName calls the "ByCatalogKindName" endpoint of the "resource" service. ByCatalogKindName may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) ByCatalogKindNameVersion ¶ added in v1.7.2
func (c *Client) ByCatalogKindNameVersion(ctx context.Context, p *ByCatalogKindNameVersionPayload) (res *ByCatalogKindNameVersionResult, err error)
ByCatalogKindNameVersion calls the "ByCatalogKindNameVersion" endpoint of the "resource" service. ByCatalogKindNameVersion may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) ByID ¶ added in v1.7.2
func (c *Client) ByID(ctx context.Context, p *ByIDPayload) (res *ByIDResult, err error)
ByID calls the "ById" endpoint of the "resource" service. ByID may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) ByVersionID ¶ added in v1.7.2
func (c *Client) ByVersionID(ctx context.Context, p *ByVersionIDPayload) (res *ByVersionIDResult, err error)
ByVersionID calls the "ByVersionId" endpoint of the "resource" service. ByVersionID may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) List ¶
List calls the "List" endpoint of the "resource" service. List may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) Query ¶ added in v1.7.2
func (c *Client) Query(ctx context.Context, p *QueryPayload) (res *QueryResult, err error)
Query calls the "Query" endpoint of the "resource" service. Query may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
func (*Client) VersionsByID ¶
func (c *Client) VersionsByID(ctx context.Context, p *VersionsByIDPayload) (res *VersionsByIDResult, err error)
VersionsByID calls the "VersionsByID" endpoint of the "resource" service. VersionsByID may return the following errors:
- "internal-error" (type *goa.ServiceError): Internal Server Error
- "not-found" (type *goa.ServiceError): Resource Not Found Error
- error: internal error
type Endpoints ¶
type Endpoints struct { Query goa.Endpoint List goa.Endpoint VersionsByID goa.Endpoint ByCatalogKindNameVersion goa.Endpoint ByVersionID goa.Endpoint ByCatalogKindName goa.Endpoint ByID goa.Endpoint }
Endpoints wraps the "resource" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "resource" service with endpoints.
type QueryPayload ¶ added in v1.7.2
type QueryPayload struct { // Name of resource Name string // Catalogs of resource to filter by Catalogs []string // Kinds of resource to filter by Kinds []string // Category associated with a resource to filter by Categories []string // Tags associated with a resource to filter by Tags []string // Platforms associated with a resource to filter by Platforms []string // Maximum number of resources to be returned Limit uint // Strategy used to find matching resources Match string }
QueryPayload is the payload type of the resource service Query method.
type QueryResult ¶ added in v1.7.2
type QueryResult struct { // Redirect URL Location string }
QueryResult is the result type of the resource service Query method.
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 // Path of the api to get the raw yaml of resource from hub apiserver HubRawURLPath 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 // Path of the api to get the raw yaml of resource from hub apiserver HubRawURLPath 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 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 { // Find resources by a combination of name, kind, catalog, categories, // platforms and tags Query(context.Context, *QueryPayload) (res *QueryResult, err error) // 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 *VersionsByIDResult, err error) // Find resource using name of catalog & name, kind and version of resource ByCatalogKindNameVersion(context.Context, *ByCatalogKindNameVersionPayload) (res *ByCatalogKindNameVersionResult, err error) // Find a resource using its version's id ByVersionID(context.Context, *ByVersionIDPayload) (res *ByVersionIDResult, err error) // Find resources using name of catalog, resource name and kind of resource ByCatalogKindName(context.Context, *ByCatalogKindNamePayload) (res *ByCatalogKindNameResult, err error) // Find a resource using it's id ByID(context.Context, *ByIDPayload) (res *ByIDResult, err error) }
The resource service provides details about all kind of resources
type VersionsByIDPayload ¶
type VersionsByIDPayload struct { // ID of a resource ID uint }
VersionsByIDPayload is the payload type of the resource service VersionsByID method.
type VersionsByIDResult ¶ added in v1.7.2
type VersionsByIDResult struct { // Redirect URL Location string }
VersionsByIDResult is the result type of the resource service VersionsByID method.