resource

package
v0.0.0-...-520f1c6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FetchError    = fmt.Errorf("failed to fetch resources")
	NotFoundError = fmt.Errorf("resource not found")
)

Functions

This section is empty.

Types

type Request

type Request struct {
	Db         *gorm.DB
	Log        *log.Logger
	ID         uint
	Name       string
	Match      string
	Kinds      []string
	Catalogs   []string
	Categories []string
	Tags       []string
	Platforms  []string
	Limit      uint
	Version    string
	Kind       string
	Catalog    string
	VersionID  uint
}

func (*Request) AllResources

func (r *Request) AllResources() ([]model.Resource, error)

AllResources returns all resources in db sorted by rating and name Limit can be passed for limiting number of resources Field: Limit

func (*Request) AllVersions

func (r *Request) AllVersions() ([]model.ResourceVersion, error)

AllVersions returns all versions of a resource Fields: ID (Resource ID)

func (*Request) ByCatalogKindName

func (r *Request) ByCatalogKindName() (model.Resource, error)

ByCatalogKindName searches resource by catalog name, kind and resource name Fields: Catalog, Kind, Name

func (*Request) ByCatalogKindNameVersion

func (r *Request) ByCatalogKindNameVersion() (model.Resource, error)

ByCatalogKindNameVersion searches resource by catalog name, kind, resource name, and version Fields: Catalog, Kind, Name, Version

func (*Request) ByID

func (r *Request) ByID() (model.Resource, error)

ByID searches resource by its ID Field: ID

func (*Request) ByVersionID

func (r *Request) ByVersionID() (model.ResourceVersion, error)

ByVersionID searches resource version by its ID Field: VersionID

func (*Request) Query

func (r *Request) Query() ([]model.Resource, error)

Query resources based on name, kind, tags. Match is the type of search: 'exact' or 'contains' Fields: name, []kinds, []Catalogs, []Categories, []Tags, Match, Limit

Jump to

Keyboard shortcuts

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