repositories

package
v0.0.0-...-744405a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const APIPath = "/api/content-sources"

APIPath The content-sources base api path

View Source
const APIVersion = "v1"

APIVersion The content-sources api version

View Source
const DefaultContentType = "rpm"

DefaultContentType The default repositories content-type

View Source
const DefaultLimit = 20

DefaultLimit The default data list Limit to be returned

View Source
const DefaultOrigin = "external"

DefaultOrigin The default repositories origin

Variables

View Source
var APIPackagePath = "rpms/names"

APIPackagePath The api repositories path

View Source
var APIRepositoriesPath = "repositories"

APIRepositoriesPath The api repositories path

View Source
var ErrParsingRawURL = errors.New("error occurred while parsing raw url")
View Source
var ErrRepositoryNameIsMandatory = errors.New("repository name is mandatory")
View Source
var ErrRepositoryNotFound = errors.New("repository not found")
View Source
var ErrRepositoryRequestResponse = errors.New("repository request error response")
View Source
var ErrRepositoryURLIsMandatory = errors.New("repository url is mandatory")
View Source
var ErrRepositoryUUIDIsMandatory = errors.New("repository uuid is mandatory")
View Source
var IOReadAll = io.ReadAll

IOReadAll The io body reader

View Source
var NewJSONEncoder = json.NewEncoder

NewJSONEncoder create a new json encoder

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the implementation of an ClientInterface

func InitClient

func InitClient(ctx context.Context, log log.FieldLogger) *Client

InitClient initializes the client for Content source repositories

func (*Client) CreateRepository

func (c *Client) CreateRepository(repository Repository) (*Repository, error)

func (*Client) GetBaseURL

func (c *Client) GetBaseURL() (*url2.URL, error)

GetBaseURL return the base url of content sources service

func (*Client) GetRepositoryByName

func (c *Client) GetRepositoryByName(name string) (*Repository, error)

GetRepositoryByName return the content-sources repository filtering by name

func (*Client) GetRepositoryByURL

func (c *Client) GetRepositoryByURL(url string) (*Repository, error)

GetRepositoryByURL return the content-sources repository filtering by its URL

func (*Client) GetRepositoryByUUID

func (c *Client) GetRepositoryByUUID(uuid string) (*Repository, error)

GetRepositoryByUUID return the content-sources repository by its UUID

func (*Client) ListRepositories

func (c *Client) ListRepositories(requestParams ListRepositoriesParams, filters ListRepositoriesFilters) (*ListRepositoriesResponse, error)

ListRepositories return the list of content source repositories

func (*Client) SearchContentPackage

func (c *Client) SearchContentPackage(packageName string, listUrls []string) (*[]SearchPackageResponse, error)

type ClientInterface

type ClientInterface interface {
	GetBaseURL() (*url2.URL, error)
	GetRepositoryByName(name string) (*Repository, error)
	GetRepositoryByURL(url string) (*Repository, error)
	GetRepositoryByUUID(uuid string) (*Repository, error)
	ListRepositories(requestParams ListRepositoriesParams, filters ListRepositoriesFilters) (*ListRepositoriesResponse, error)
	SearchContentPackage(packageName string, URLS []string) (*[]SearchPackageResponse, error)
	CreateRepository(repository Repository) (*Repository, error)
}

ClientInterface is an Interface to make request to content sources repositories

type ContentRepositoriesResponse

type ContentRepositoriesResponse struct {
	Data *[]SearchPackageResponse `json:"Data"`
}

type ContentSearchPayload

type ContentSearchPayload struct {
	URLS   []string `json:"urls"`
	Search string   `json:"search"`
}

type ListRepositoriesFilters

type ListRepositoriesFilters map[string]string

func NewListRepositoryFilters

func NewListRepositoryFilters() ListRepositoriesFilters

func (ListRepositoriesFilters) Add

func (filters ListRepositoriesFilters) Add(name, value string)

type ListRepositoriesMeta

type ListRepositoriesMeta struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
	Count  int `json:"count"`
}

type ListRepositoriesParams

type ListRepositoriesParams struct {
	Limit    int
	Offset   int
	SortBy   string
	SortType string
}

type ListRepositoriesResponse

type ListRepositoriesResponse struct {
	Data []Repository         `json:"data"`
	Meta ListRepositoriesMeta `json:"meta"`
}

type PackageRequestError

type PackageRequestError struct{}

PackageRequestError indicates request search packages from content-source

func (*PackageRequestError) Error

func (e *PackageRequestError) Error() string

type Repository

type Repository struct {
	UUID                         uuid.UUID `json:"uuid"`
	Name                         string    `json:"name"`
	URL                          string    `json:"url"`
	DistributionVersions         []string  `json:"distribution_versions"`
	DistributionArch             string    `json:"distribution_arch"`
	AccountID                    string    `json:"account_id"`
	OrgID                        string    `json:"org_id"`
	LastIntrospectionTime        string    `json:"last_introspection_time"`
	LastSuccessIntrospectionTime string    `json:"last_success_introspection_time"`
	LastUpdateIntrospectionTime  string    `json:"last_update_introspection_time"`
	LastIntrospectionError       string    `json:"last_introspection_error"`
	PackageCount                 int       `json:"package_count"`
	Status                       string    `json:"status"`
	GpgKey                       string    `json:"gpg_key"`
	MetadataVerification         bool      `json:"metadata_verification"`
}

type SearchPackageResponse

type SearchPackageResponse struct {
	PackageName string `json:"package_name"`
	Summary     string `json:"summary"`
}

Directories

Path Synopsis
Package mock_repositories is a generated GoMock package.
Package mock_repositories is a generated GoMock package.

Jump to

Keyboard shortcuts

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