Documentation ¶
Index ¶
- Constants
- func EolProductName(name string) bool
- func EolProductVersion(product string, v ProductVersion) bool
- func FilterList[T comparable](s []T, filter func(T) bool) []T
- func FilterProductList[T comparable](s []T, product string, filter func(string, T) bool) []T
- func FilterProductsForFreeTrial[T comparable](s []T, filter func(T) bool) []T
- func NewConstraint(i string) version.Constraints
- func OsProductName(name string) bool
- func OsProductVersion(name string, v ProductVersion) bool
- func ProductsForFreeTrial(name string) bool
- func SelectList[T comparable](s []T, filter func(T) bool) []T
- func SupportedVersion(product string) string
- func ValidateRequest(p *RequestParams, flags RequestParamsFlags) *clients.Request
- type ArchList
- type ContainsValidator
- type Context
- type DynamoServices
- func (svc *DynamoServices) FetchLatestOsVersion(params *RequestParams) (string, error)
- func (svc *DynamoServices) GetFilename(params *RequestParams) (string, error)
- func (svc *DynamoServices) GetRelatedProducts(params *RequestParams) (*models.RelatedProducts, error)
- func (svc *DynamoServices) Platforms(platforms PlatformList) PlatformList
- func (svc *DynamoServices) ProductDownload(params *RequestParams) (string, error)
- func (svc *DynamoServices) ProductMetadata(params *RequestParams) (PackageMetadata, error)
- func (svc *DynamoServices) ProductPackages(params *RequestParams) (PackageList, error)
- func (svc *DynamoServices) Products(products []string, eol string) []string
- func (svc *DynamoServices) VersionAll(params *RequestParams) ([]ProductVersion, error)
- func (svc *DynamoServices) VersionLatest(params *RequestParams) (ProductVersion, error)
- type EolVersionValidator
- type FiberContext
- type ItemList
- type Omnitruck
- func (ot *Omnitruck) Architectures() *clients.Request
- func (ot *Omnitruck) Get(url string) *clients.Request
- func (ot *Omnitruck) LatestVersion(p *RequestParams) *clients.Request
- func (ot *Omnitruck) Platforms() *clients.Request
- func (ot *Omnitruck) ProductDownload(p *RequestParams) *clients.Request
- func (ot *Omnitruck) ProductMetadata(p *RequestParams) *clients.Request
- func (ot *Omnitruck) ProductPackages(p *RequestParams) *clients.Request
- func (ot *Omnitruck) ProductVersions(p *RequestParams) *clients.Request
- func (ot *Omnitruck) Products(p *RequestParams, data clients.RequestDataInterface) *clients.Request
- type OsVersionValidator
- type PackageList
- type PackageListUpdater
- type PackageMetadata
- type PlatformList
- type PlatformServices
- func (r *PlatformServices) PlatformFilename(req *RequestParams, serverMode int) (string, error)
- func (r *PlatformServices) PlatformMetadata(req *RequestParams, serverMode int) (PackageMetadata, error)
- func (r *PlatformServices) PlatformPackages(req *RequestParams, serverMode int) (PackageList, error)
- func (r *PlatformServices) PlatformVersionLatest(req *RequestParams, serverMode int) (ProductVersion, error)
- func (r *PlatformServices) PlatformVersionsAll(req *RequestParams, serverMode int) ([]ProductVersion, error)
- type PlatformVersionList
- type Product
- type ProductVersion
- type RequestParams
- type RequestParamsFlags
- type RequestValidator
- type ValidationError
- type ValidatorFunc
- type ValidatorInterface
Constants ¶
View Source
const ( DOWNLOAD_URL = `https://packages.chef.io/files/%s/%s/%s/%s` CHEF_AUTOMATE_CLI = "chef-automate-cli" AUTOMATE_CLI_VERSION = "latest" AUTOMATE_CHANNEL = "current" AUTOMATE_PRODUCT = "automate" HABITAT_PRODUCT = "habitat" )
Variables ¶
This section is empty.
Functions ¶
func EolProductName ¶
func EolProductVersion ¶
func EolProductVersion(product string, v ProductVersion) bool
func FilterList ¶
func FilterList[T comparable](s []T, filter func(T) bool) []T
func FilterProductList ¶
func FilterProductList[T comparable](s []T, product string, filter func(string, T) bool) []T
func FilterProductsForFreeTrial ¶
func FilterProductsForFreeTrial[T comparable](s []T, filter func(T) bool) []T
func NewConstraint ¶
func NewConstraint(i string) version.Constraints
func OsProductName ¶
func OsProductVersion ¶
func OsProductVersion(name string, v ProductVersion) bool
func ProductsForFreeTrial ¶
func SelectList ¶
func SelectList[T comparable](s []T, filter func(T) bool) []T
func SupportedVersion ¶
func ValidateRequest ¶
func ValidateRequest(p *RequestParams, flags RequestParamsFlags) *clients.Request
Types ¶
type ArchList ¶
type ArchList map[string]PackageMetadata
type ContainsValidator ¶
type ContainsValidator struct { Field string Values []string Code int AllowEmpty bool Skip func(c Context) bool }
func (*ContainsValidator) GetCode ¶
func (fv *ContainsValidator) GetCode() int
func (*ContainsValidator) GetField ¶
func (fv *ContainsValidator) GetField() string
func (*ContainsValidator) GetValues ¶
func (fv *ContainsValidator) GetValues() interface{}
func (*ContainsValidator) Validate ¶
func (fv *ContainsValidator) Validate(p *RequestParams, c Context) *ValidationError
type DynamoServices ¶
type DynamoServices struct {
// contains filtered or unexported fields
}
func NewDynamoServices ¶
func NewDynamoServices(db dboperations.IDbOperations, log *log.Entry) DynamoServices
func (*DynamoServices) FetchLatestOsVersion ¶
func (svc *DynamoServices) FetchLatestOsVersion(params *RequestParams) (string, error)
func (*DynamoServices) GetFilename ¶
func (svc *DynamoServices) GetFilename(params *RequestParams) (string, error)
func (*DynamoServices) GetRelatedProducts ¶
func (svc *DynamoServices) GetRelatedProducts(params *RequestParams) (*models.RelatedProducts, error)
func (*DynamoServices) Platforms ¶
func (svc *DynamoServices) Platforms(platforms PlatformList) PlatformList
func (*DynamoServices) ProductDownload ¶
func (svc *DynamoServices) ProductDownload(params *RequestParams) (string, error)
func (*DynamoServices) ProductMetadata ¶
func (svc *DynamoServices) ProductMetadata(params *RequestParams) (PackageMetadata, error)
func (*DynamoServices) ProductPackages ¶
func (svc *DynamoServices) ProductPackages(params *RequestParams) (PackageList, error)
func (*DynamoServices) Products ¶
func (svc *DynamoServices) Products(products []string, eol string) []string
func (*DynamoServices) VersionAll ¶
func (svc *DynamoServices) VersionAll(params *RequestParams) ([]ProductVersion, error)
func (*DynamoServices) VersionLatest ¶
func (svc *DynamoServices) VersionLatest(params *RequestParams) (ProductVersion, error)
type EolVersionValidator ¶
type EolVersionValidator struct {
Code int
}
func (*EolVersionValidator) GetCode ¶
func (fv *EolVersionValidator) GetCode() int
func (*EolVersionValidator) GetField ¶
func (fv *EolVersionValidator) GetField() string
func (*EolVersionValidator) GetValues ¶
func (fv *EolVersionValidator) GetValues() interface{}
func (*EolVersionValidator) Validate ¶
func (fv *EolVersionValidator) Validate(p *RequestParams, c Context) *ValidationError
type FiberContext ¶
type Omnitruck ¶
type Omnitruck struct {
// contains filtered or unexported fields
}
func (*Omnitruck) Architectures ¶
func (*Omnitruck) LatestVersion ¶
func (ot *Omnitruck) LatestVersion(p *RequestParams) *clients.Request
func (*Omnitruck) ProductDownload ¶
func (ot *Omnitruck) ProductDownload(p *RequestParams) *clients.Request
Product Download needs to fetch the metadata record instead of the Omnitruck download API The Omnitruck API normall redirects the user to the download URL and we need to do this ourselves.
func (*Omnitruck) ProductMetadata ¶
func (ot *Omnitruck) ProductMetadata(p *RequestParams) *clients.Request
func (*Omnitruck) ProductPackages ¶
func (ot *Omnitruck) ProductPackages(p *RequestParams) *clients.Request
func (*Omnitruck) ProductVersions ¶
func (ot *Omnitruck) ProductVersions(p *RequestParams) *clients.Request
func (*Omnitruck) Products ¶
func (ot *Omnitruck) Products(p *RequestParams, data clients.RequestDataInterface) *clients.Request
type OsVersionValidator ¶
type OsVersionValidator struct {
Code int
}
func (*OsVersionValidator) GetCode ¶
func (fv *OsVersionValidator) GetCode() int
func (*OsVersionValidator) GetField ¶
func (fv *OsVersionValidator) GetField() string
func (*OsVersionValidator) GetValues ¶
func (fv *OsVersionValidator) GetValues() interface{}
func (*OsVersionValidator) Validate ¶
func (fv *OsVersionValidator) Validate(p *RequestParams, c Context) *ValidationError
type PackageList ¶
type PackageList map[string]PlatformVersionList
func (PackageList) UpdatePackages ¶
func (pl PackageList) UpdatePackages(fn PackageListUpdater)
type PackageListUpdater ¶
type PackageListUpdater func(platform string, platformVersion string, arch string, meta PackageMetadata) PackageMetadata
type PackageMetadata ¶
type PlatformList ¶
type PlatformServices ¶
func NewPlatformServices ¶
func NewPlatformServices(logger logger.Logger) PlatformServices
func (*PlatformServices) PlatformFilename ¶
func (r *PlatformServices) PlatformFilename(req *RequestParams, serverMode int) (string, error)
func (*PlatformServices) PlatformMetadata ¶
func (r *PlatformServices) PlatformMetadata(req *RequestParams, serverMode int) (PackageMetadata, error)
func (*PlatformServices) PlatformPackages ¶
func (r *PlatformServices) PlatformPackages(req *RequestParams, serverMode int) (PackageList, error)
func (*PlatformServices) PlatformVersionLatest ¶
func (r *PlatformServices) PlatformVersionLatest(req *RequestParams, serverMode int) (ProductVersion, error)
func (*PlatformServices) PlatformVersionsAll ¶
func (r *PlatformServices) PlatformVersionsAll(req *RequestParams, serverMode int) ([]ProductVersion, error)
type PlatformVersionList ¶
type Product ¶
type Product struct { Name string ProductName string SupportedVersion version.Constraints OpensourceVersion version.Constraints }
type ProductVersion ¶
type ProductVersion string
type RequestParams ¶
type RequestParams struct { Channel string Product string Version string Platform string PlatformVersion string Architecture string Eol string LicenseId string BOM string }
func (*RequestParams) UrlParams ¶
func (rp *RequestParams) UrlParams() url.Values
type RequestParamsFlags ¶
type RequestValidator ¶
type RequestValidator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() RequestValidator
func (*RequestValidator) Add ¶
func (rv *RequestValidator) Add(f ValidatorInterface)
func (*RequestValidator) ErrorMessages ¶
func (o *RequestValidator) ErrorMessages(errors []*ValidationError) (string, int)
func (*RequestValidator) GetValidators ¶
func (rv *RequestValidator) GetValidators() []ValidatorInterface
func (*RequestValidator) Params ¶
func (o *RequestValidator) Params(params *RequestParams, c Context) []*ValidationError
type ValidationError ¶
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type ValidatorFunc ¶
type ValidatorFunc func(string, ValidatorInterface) bool
type ValidatorInterface ¶
type ValidatorInterface interface { GetCode() int Validate(*RequestParams, Context) *ValidationError }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.