Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CreateRepository(repository Repository) (*Repository, error)
- func (c *Client) GetBaseURL() (*url2.URL, error)
- func (c *Client) GetRepositoryByName(name string) (*Repository, error)
- func (c *Client) GetRepositoryByURL(url string) (*Repository, error)
- func (c *Client) GetRepositoryByUUID(uuid string) (*Repository, error)
- func (c *Client) ListRepositories(requestParams ListRepositoriesParams, filters ListRepositoriesFilters) (*ListRepositoriesResponse, error)
- func (c *Client) SearchContentPackage(packageName string, listUrls []string) (*[]SearchPackageResponse, error)
- type ClientInterface
- type ContentRepositoriesResponse
- type ContentSearchPayload
- type ListRepositoriesFilters
- type ListRepositoriesMeta
- type ListRepositoriesParams
- type ListRepositoriesResponse
- type PackageRequestError
- type Repository
- type SearchPackageResponse
Constants ¶
const APIPath = "/api/content-sources"
APIPath The content-sources base api path
const APIVersion = "v1"
APIVersion The content-sources api version
const DefaultContentType = "rpm"
DefaultContentType The default repositories content-type
const DefaultLimit = 20
DefaultLimit The default data list Limit to be returned
const DefaultOrigin = "external"
DefaultOrigin The default repositories origin
Variables ¶
var APIPackagePath = "rpms/names"
APIPackagePath The api repositories path
var APIRepositoriesPath = "repositories"
APIRepositoriesPath The api repositories path
var ErrParsingRawURL = errors.New("error occurred while parsing raw url")
var ErrRepositoryNameIsMandatory = errors.New("repository name is mandatory")
var ErrRepositoryNotFound = errors.New("repository not found")
var ErrRepositoryRequestResponse = errors.New("repository request error response")
var ErrRepositoryURLIsMandatory = errors.New("repository url is mandatory")
var ErrRepositoryUUIDIsMandatory = errors.New("repository uuid is mandatory")
var IOReadAll = io.ReadAll
IOReadAll The io body reader
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 ¶
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 ListRepositoriesFilters ¶
func NewListRepositoryFilters ¶
func NewListRepositoryFilters() ListRepositoriesFilters
func (ListRepositoriesFilters) Add ¶
func (filters ListRepositoriesFilters) Add(name, value string)
type ListRepositoriesMeta ¶
type ListRepositoriesParams ¶
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 ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_repositories is a generated GoMock package.
|
Package mock_repositories is a generated GoMock package. |