model

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OperationAdded is for adding a new requirement
	OperationAdded = Operation(mono_models.CommitChangeEditableOperationAdded)
	// OperationUpdated is for updating an existing requirement
	OperationUpdated = Operation(mono_models.CommitChangeEditableOperationUpdated)
	// OperationRemoved is for removing an existing requirement
	OperationRemoved = Operation(mono_models.CommitChangeEditableOperationRemoved)
)
View Source
const (
	// NamespacePlatformMatch is the namespace used for platform requirements
	NamespacePlatformMatch NamespaceMatchable = `^platform$`

	// NamespaceLanguageMatch is the namespace used for language requirements
	NamespaceLanguageMatch = `^language$`

	// NamespacePackageMatch is the namespace used for language package requirements
	NamespacePackageMatch = `^language\/(\w+)$`

	// NamespacePackageMatch is the namespace used for language package requirements
	NamespaceBuilderMatch = `^builder(-lib){0,1}$`

	// NamespaceBundlesMatch is the namespace used for bundle package requirements
	NamespaceBundlesMatch = `^bundles\/(\w+)$`

	// NamespacePrePlatformMatch is the namespace used for pre-platform bits
	NamespacePrePlatformMatch = `^pre-platform-installer$`

	// NamespaceCamelFlagsMatch is the namespace used for passing camel flags
	NamespaceCamelFlagsMatch = `^camel-flags$`

	// NamespaceOrgMatch is the namespace used for org specific requirements
	NamespaceOrgMatch = `^org\/`

	// NamespaceBuildFlagsMatch is the namespace used for passing build flags
	NamespaceBuildFlagsMatch = `^build-flags$`
)
View Source
const (
	// TrackingNotify represents the notify tracking type for branches and will
	// notify the project owner of upstream changes
	TrackingNotify TrackingType = TrackingType(mono_models.BranchEditableTrackingTypeNotify)
	// TrackingIgnore represents the ignore tracking type for branches and will
	// ignore upstream changes
	TrackingIgnore = TrackingType(mono_models.BranchEditableTrackingTypeIgnore)
	// TrackingAutoUpdate represents the auto update tracking type for branches and will
	// auto update the branch with any upstream changes
	TrackingAutoUpdate = TrackingType(mono_models.BranchEditableTrackingTypeAutoUpdate)
)

Variables

View Source
var (
	ErrCommitCountUnknowable = errs.New("Commit count is unknowable")

	ErrMergeFastForward = errs.New("No merge required")

	ErrMergeCommitInHistory = errs.New("Can't merge commit thats already in target commits history")

	ErrCommitNotInHistory = errs.New("Target commit is not in history")
)
View Source
var (
	NamespacePackage  = NamespaceType{"package", "language", NamespacePackageMatch} // these values should match the namespace prefix
	NamespaceBundle   = NamespaceType{"bundle", "bundles", NamespaceBundlesMatch}
	NamespaceLanguage = NamespaceType{"language", "", NamespaceLanguageMatch}
	NamespacePlatform = NamespaceType{"platform", "", NamespacePlatformMatch}
	NamespaceOrg      = NamespaceType{"org", "org", NamespaceOrgMatch}
	NamespaceRaw      = NamespaceType{"raw", "", ""}
	NamespaceBlank    = NamespaceType{"", "", ""}
)
View Source
var ErrMemberNotFound = errs.New("member not found")
View Source
var (
	ErrNoData = errs.New("no data")
)
View Source
var ErrOrderForbidden = errs.New("no permission to retrieve order")
View Source
var HostPlatform string

HostPlatform stores a reference to current platform

View Source
var SvcTimeoutMinimal = time.Millisecond * 500

Functions

func AddBranch

func AddBranch(projectID strfmt.UUID, label string, auth *authentication.Auth) (strfmt.UUID, error)

func AddRevertCommit

func AddRevertCommit(commit *mono_models.Commit, auth *authentication.Auth) (*mono_models.Commit, error)

func BranchCommitID

func BranchCommitID(ownerName, projectName, branchName string) (*strfmt.UUID, error)

BranchCommitID returns the latest commit id by owner and project names. It is possible for a nil commit id to be returned without failure.

func BranchForProjectByName

func BranchForProjectByName(pj *mono_models.Project, name string) (*mono_models.Branch, error)

BranchForProjectByName retrieves the named branch for the given project

func BranchForProjectNameByName

func BranchForProjectNameByName(owner, name, branch string) (*mono_models.Branch, error)

BranchForProjectNameByName retrieves the named branch for the given project org/name

func BranchNamesForProjectFiltered

func BranchNamesForProjectFiltered(owner, name string, excludes ...string) ([]string, error)

func BranchesForProject

func BranchesForProject(owner, name string) ([]*mono_models.Branch, error)

func CheckpointToCamelFlags

func CheckpointToCamelFlags(checkpoint Checkpoint) []string

CheckpointToCamelFlags converts a checkpoint to camel flags

func CheckpointToPlatforms

func CheckpointToPlatforms(requirements []*gqlModel.Requirement) []strfmt.UUID

CheckpointToPlatforms strips platforms from a checkpoint

func CheckpointToRequirements

func CheckpointToRequirements(checkpoint Checkpoint) []*inventory_models.OrderRequirement

CheckpointToRequirements converts a checkpoint to a list of requirements for use with the head-chef

func CommitBelongsToBranch

func CommitBelongsToBranch(ownerName, projectName, branchName string, commitID strfmt.UUID, auth *authentication.Auth) (bool, error)

func CommitHistory

func CommitHistory(ownerName, projectName, branchName string, auth *authentication.Auth) ([]*mono_models.Commit, error)

CommitHistory will return the commit history for the given owner / project

func CommitHistoryFromID

func CommitHistoryFromID(commitID strfmt.UUID, auth *authentication.Auth) ([]*mono_models.Commit, error)

CommitHistoryFromID will return the commit history from the given commitID

func CommitHistoryPaged

func CommitHistoryPaged(commitID strfmt.UUID, offset, limit int64, auth *authentication.Auth) (*mono_models.CommitHistoryInfo, error)

CommitHistoryPaged will return the commit history for the given owner / project

func CommitInitial

func CommitInitial(hostPlatform string, langName, langVersion string, auth *authentication.Auth) (strfmt.UUID, error)

CommitInitial creates a root commit for a new branch

func CommitWithinCommitHistory

func CommitWithinCommitHistory(latestCommitID, searchCommitID strfmt.UUID, auth *authentication.Auth) (bool, error)

func CommitsBehind

func CommitsBehind(latestCID, currentCommitID strfmt.UUID, auth *authentication.Auth) (int, error)

CommitsBehind compares the provided commit id with the latest commit id and returns the count of commits it is behind. A negative return value indicates the provided commit id is ahead of the latest commit id (that is, there are local commits).

func CommonParent

func CommonParent(commit1, commit2 *strfmt.UUID, auth *authentication.Auth) (*strfmt.UUID, error)

CommonParent returns the first commit id which both provided commit id histories have in common.

func CreateCopy

func CreateCopy(sourceOwner, sourceName, targetOwner, targetName string, makePrivate bool, auth *authentication.Auth) (*mono_models.Project, error)

func CreateEmptyProject

func CreateEmptyProject(owner, name string, private bool, auth *authentication.Auth) (*mono_models.Project, error)

CreateEmptyProject will create the project on the platform

func DefaultBranchForProject

func DefaultBranchForProject(pj *mono_models.Project) (*mono_models.Branch, error)

DefaultBranchForProject retrieves the default branch for the given project

func DefaultBranchForProjectName

func DefaultBranchForProjectName(owner, name string) (*mono_models.Branch, error)

DefaultBranchForProjectName retrieves the default branch for the given project owner/name.

func DeleteBranch

func DeleteBranch(branchID strfmt.UUID, auth *authentication.Auth) error

func DeleteProject

func DeleteProject(owner, project string, auth *authentication.Auth) error

func EditProject

func EditProject(owner, name string, project *mono_models.ProjectEditable, auth *authentication.Auth) error

func FetchCheckpointForCommit

func FetchCheckpointForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]*gqlModel.Requirement, strfmt.DateTime, error)

FetchCheckpointForCommit fetches the checkpoint for the given commit

func FetchCommitVulnerabilities

func FetchCommitVulnerabilities(auth *authentication.Auth, commitID string) (*model.CommitVulnerabilities, error)

FetchCommitVulnerabilities returns the vulnerability information of a project

func FetchIngredient

func FetchIngredient(ingredientID *strfmt.UUID, auth *authentication.Auth) (*inventory_models.Ingredient, error)

func FetchIngredientVersion

func FetchIngredientVersion(ingredientID *strfmt.UUID, versionID *strfmt.UUID, allowUnstable bool, atTime *strfmt.DateTime, auth *authentication.Auth) (*inventory_models.FullIngredientVersion, error)

func FetchIngredientVersions

func FetchIngredientVersions(ingredientID *strfmt.UUID, auth *authentication.Auth) ([]*inventory_models.IngredientVersion, error)

func FetchLanguageVersions

func FetchLanguageVersions(name string, auth *authentication.Auth) ([]string, error)

func FetchLatestRevisionTimeStamp

func FetchLatestRevisionTimeStamp(auth *authentication.Auth) (time.Time, error)

FetchLatestRevisionTimeStamp fetches the time of the last inventory change from the Hasura inventory service. This is not the same as FetchLatestTimeStamp.

func FetchLatestTimeStamp

func FetchLatestTimeStamp(auth *authentication.Auth) (time.Time, error)

FetchLatestTimeStamp fetches the latest timestamp from the inventory service. This is not the same as FetchLatestRevisionTimeStamp.

func FetchNormalizedName

func FetchNormalizedName(namespace Namespace, name string, auth *authentication.Auth) (string, error)

func FetchOrgByURLName

func FetchOrgByURLName(urlName string, auth *authentication.Auth) (*mono_models.Organization, error)

FetchOrgByURLName fetches an organization accessible to the current user by it's URL Name.

func FetchOrgMember

func FetchOrgMember(orgName, name string, auth *authentication.Auth) (*mono_models.Member, error)

FetchOrgMember fetches the member of an organization accessible to the current user by it's URL Name.

func FetchOrgMembers

func FetchOrgMembers(urlName string, auth *authentication.Auth) ([]*mono_models.Member, error)

FetchOrgMembers fetches the members of an organization accessible to the current user by it's URL Name.

func FetchOrganizationLimits

func FetchOrganizationLimits(orgName string, auth *authentication.Auth) (*mono_models.Limits, error)

FetchOrganizationLimits returns the limits for an organization

func FetchOrganizationProjects

func FetchOrganizationProjects(orgName string, auth *authentication.Auth) ([]*mono_models.Project, error)

FetchOrganizationProjects fetches the projects for an organization

func FetchOrganizations

func FetchOrganizations(auth *authentication.Auth) ([]*mono_models.Organization, error)

FetchOrganizations fetches all organizations for the current user.

func FetchOrganizationsByIDs

func FetchOrganizationsByIDs(ids []strfmt.UUID, auth *authentication.Auth) ([]model.Organization, error)

FetchOrganizationsByIDs fetches organizations by their IDs

func FetchPlatformsMap

func FetchPlatformsMap(auth *authentication.Auth) (map[strfmt.UUID]*Platform, error)

func FetchProjectByName

func FetchProjectByName(orgName string, projectName string, auth *authentication.Auth) (*mono_models.Project, error)

FetchProjectByName fetches a project for an organization.

func FetchProjectVulnerabilities

func FetchProjectVulnerabilities(auth *authentication.Auth, org, project string) (*model.ProjectVulnerabilities, error)

FetchProjectVulnerabilities returns the vulnerability information of a project

func FetchSupportedLanguages

func FetchSupportedLanguages(osPlatformName string) ([]model.SupportedLanguage, error)

FetchSupportedLanguages returns the list of languages that the Platform supports or the given OS platform name ATM

func FetchTiers

func FetchTiers(auth *authentication.Auth) ([]*mono_models.Tier, error)

FetchTiers fetachs the tier for the given organization

func FetchTimeStampForCommit

func FetchTimeStampForCommit(commitID strfmt.UUID, auth *authentication.Auth) (*time.Time, error)

func FilterCheckpointNamespace

func FilterCheckpointNamespace(chkPt []*gqlModel.Requirement, nsType ...NamespaceType) []*gqlModel.Requirement

FilterCheckpointNamespace filters a Checkpoint removing requirements that do not match the given namespace.

func FilterCurrentPlatform

func FilterCurrentPlatform(hostPlatform string, platforms []strfmt.UUID, cfg Configurable, auth *authentication.Auth) (strfmt.UUID, error)

func GetBranchChildren

func GetBranchChildren(branch *mono_models.Branch, branches mono_models.Branches) mono_models.Branches

GetBranchChildren returns the direct children of the given branch

func GetCommit

func GetCommit(commitID strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)

func GetCommitWithinCommitHistory

func GetCommitWithinCommitHistory(currentCommitID, targetCommitID strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)

func GetIngredientByNameAndVersion

func GetIngredientByNameAndVersion(namespace string, name string, version string, ts *time.Time, auth *authentication.Auth) (*inventory_models.FullIngredientVersion, error)

func GetRequirement

func GetRequirement(commitID strfmt.UUID, namespace Namespace, requirement string, auth *authentication.Auth) (*gqlModel.Requirement, error)

GetRequirement searches a commit for a requirement by name.

func GetRevertCommit

func GetRevertCommit(from, to strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)

func GetRootBranches

func GetRootBranches(branches mono_models.Branches) mono_models.Branches

func GqlReqVersionConstraintsString

func GqlReqVersionConstraintsString(requirement *gqlModel.Requirement) string

func GqlReqsToMonoCheckpoint

func GqlReqsToMonoCheckpoint(requirements []*gqlModel.Requirement) []*mono_models.Checkpoint

func HostPlatformToKernelName

func HostPlatformToKernelName(os string) string

func InventoryRequirementsToString

func InventoryRequirementsToString(requirements inventory_models.Requirements) string

func InviteUserToOrg

func InviteUserToOrg(orgName string, asOwner bool, email string, auth *authentication.Auth) (*mono_models.Invitation, error)

InviteUserToOrg invites a single user (via email address) to a given organization.

The invited user can be added as an owner or a member

Note: This method only returns the invitation for the new user, not existing users.

func LanguageFromNamespace

func LanguageFromNamespace(ns string) string

func LegacyFetchProjectByName

func LegacyFetchProjectByName(orgName string, projectName string) (*mono_models.Project, error)

LegacyFetchProjectByName is intended for legacy code which still relies on localised errors, do NOT use it for new code.

func MakeProjectPrivate

func MakeProjectPrivate(owner, name string, auth *authentication.Auth) error

MakeProjectPrivate turns the given project private

func MergeCommit

func MergeCommit(commitReceiving, commitWithChanges strfmt.UUID) (*mono_models.MergeStrategies, error)

func MergeRequired

func MergeRequired(commitReceiving, commitWithChanges strfmt.UUID) (bool, error)

func MonoConstraintsToString

func MonoConstraintsToString(monoConstraints mono_models.Constraints) string

func MoveProject

func MoveProject(owner, project, newOwner string, auth *authentication.Auth) error

func NamespaceMatch

func NamespaceMatch(query string, namespace NamespaceMatchable) bool

NamespaceMatch Checks if the given namespace query matches the given namespace

func PlatformNameToPlatformID

func PlatformNameToPlatformID(name string) (string, error)

func ProjectURL

func ProjectURL(owner, name, commitID string) string

ProjectURL creates a valid platform URL for the given project parameters

func RequestBuild

func RequestBuild(auth *authentication.Auth, recipeID, commitID strfmt.UUID, owner, project string) (headchef.BuildStatusEnum, *headchef_models.V1BuildStatusResponse, error)

func ResolveRequirementNameAndVersion

func ResolveRequirementNameAndVersion(name, version string, word int, namespace Namespace, auth *authentication.Auth) (string, string, error)

func RevertCommit

func RevertCommit(from, to, latest strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)

func RevertCommitWithinHistory

func RevertCommitWithinHistory(from, to, latest strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)

func TrackBranch

func TrackBranch(source, target *mono_models.Project, auth *authentication.Auth) error

func UpdateBranchCommit

func UpdateBranchCommit(branchID strfmt.UUID, commitID strfmt.UUID, auth *authentication.Auth) error

UpdateBranchCommit updates the commit that a branch is pointed at

func UpdateBranchForProject

func UpdateBranchForProject(pj ProjectInfo, commitID strfmt.UUID, auth *authentication.Auth) error

func UpdateBranchTracking

func UpdateBranchTracking(branchID, commitID, trackingBranchID strfmt.UUID, trackingType TrackingType, auth *authentication.Auth) error

UpdateBranchTracking updates the tracking information for the given branch

func UpdateProjectBranchCommit

func UpdateProjectBranchCommit(pj ProjectInfo, commitID strfmt.UUID, auth *authentication.Auth) error

UpdateProjectBranchCommitByName updates the vcs branch for a project given by its namespace with a new commitID

func UpdateProjectBranchCommitWithModel

func UpdateProjectBranchCommitWithModel(pjm *mono_models.Project, branchName string, commitID strfmt.UUID, auth *authentication.Auth) error

UpdateProjectBranchCommitByName updates the vcs branch for a project given by its namespace with a new commitID

func VersionStringToRequirements

func VersionStringToRequirements(version string) ([]bpModel.VersionRequirement, error)

Types

type Authors

type Authors []*inventory_models.Author

Authors is a collection of inventory Author data.

func FetchAuthors

func FetchAuthors(ingredID, ingredVersionID *strfmt.UUID, auth *authentication.Auth) (Authors, error)

FetchAuthors obtains author info for an ingredient at a particular version.

type BuildEngine

type BuildEngine int

BuildEngine describes the build engine that was used to build the runtime

const (
	// UnknownEngine represents an engine unknown to the runtime.
	UnknownEngine BuildEngine = iota

	// Camel is the legacy build engine, that builds Active{Python,Perl,Tcl}
	// distributions
	Camel

	// Alternative is the new alternative build orchestration framework
	Alternative
)

func ParseBuildEngine

func ParseBuildEngine(be string) BuildEngine

func (BuildEngine) String

func (be BuildEngine) String() string

type BuildPlanner

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

func NewBuildPlannerModel

func NewBuildPlannerModel(auth *authentication.Auth) *BuildPlanner

func (*BuildPlanner) BuildTarget

func (bp *BuildPlanner) BuildTarget(owner, project, commitID, target string) error

func (*BuildPlanner) CreateProject

func (bp *BuildPlanner) CreateProject(params *CreateProjectParams) (strfmt.UUID, error)

func (*BuildPlanner) FetchBuildResult

func (bp *BuildPlanner) FetchBuildResult(commitID strfmt.UUID, owner, project string, target *string) (*BuildResult, *model.Commit, error)

func (*BuildPlanner) GetBuildExpression

func (bp *BuildPlanner) GetBuildExpression(commitID string) (*buildexpression.BuildExpression, error)

func (*BuildPlanner) GetBuildExpressionAndTime

func (bp *BuildPlanner) GetBuildExpressionAndTime(commitID string) (*buildexpression.BuildExpression, *strfmt.DateTime, error)

func (*BuildPlanner) MergeCommit

func (bp *BuildPlanner) MergeCommit(params *MergeCommitParams) (strfmt.UUID, error)

func (*BuildPlanner) PollBuildStatus

func (bp *BuildPlanner) PollBuildStatus(commitID, owner, project, target string) error

func (*BuildPlanner) RevertCommit

func (bp *BuildPlanner) RevertCommit(organization, project, parentCommitID, commitID string) (strfmt.UUID, error)

func (*BuildPlanner) StageCommit

func (bp *BuildPlanner) StageCommit(params StageCommitParams) (strfmt.UUID, error)

type BuildResult

type BuildResult struct {
	BuildEngine         BuildEngine
	RecipeID            strfmt.UUID
	CommitID            strfmt.UUID
	Build               *bpModel.Build
	BuildStatusResponse *headchef_models.V1BuildStatusResponse
	BuildStatus         string
	BuildReady          bool
	BuildExpression     *buildexpression.BuildExpression
	AtTime              *strfmt.DateTime
}

BuildResult is the unified response of a Build request

func (*BuildResult) OrderedArtifacts

func (b *BuildResult) OrderedArtifacts() []artifact.ArtifactID

type Changeset

type Changeset = []*mono_models.CommitChangeEditable

Changeset aliases for eased usage and to act as a disconnect from the underlying dep.

func ChangesetFromRequirements

func ChangesetFromRequirements(op Operation, reqs []*gqlModel.Requirement) Changeset

type Checkpoint

type Checkpoint []*mono_models.Checkpoint

Checkpoint represents a collection of requirements

type Configurable

type Configurable interface {
	GetString(key string) string
}

type CreateProjectParams

type CreateProjectParams struct {
	Owner       string
	Project     string
	PlatformID  strfmt.UUID
	Language    string
	Version     string
	Private     bool
	Description string
	Expr        *buildexpression.BuildExpression
}

CreateProjectParams contains information for the project to create. When creating a project from scratch, the PlatformID, Language, Version, and Timestamp fields are used to create a buildexpression to use. When creating a project based off of another one, the Expr field is used (PlatformID, Language, Version, and Timestamp are ignored).

type ErrFailedArtifacts

type ErrFailedArtifacts struct {
	Artifacts map[strfmt.UUID]*bpModel.Artifact
}

func (ErrFailedArtifacts) Error

func (e ErrFailedArtifacts) Error() string

type ErrNoMatchingPlatform

type ErrNoMatchingPlatform struct {
	HostPlatform string
	HostArch     string
	LibcVersion  string
}

func (ErrNoMatchingPlatform) Error

func (e ErrNoMatchingPlatform) Error() string

type ErrProjectNotFound

type ErrProjectNotFound struct {
	Organization string
	Project      string
}

func (*ErrProjectNotFound) Error

func (e *ErrProjectNotFound) Error() string

type ErrSearch404

type ErrSearch404 struct{ *locale.LocalizedError }

type ErrTooManyMatches

type ErrTooManyMatches struct {
	*locale.LocalizedError
	Query string
}

type ErrUpdateBranchAuth

type ErrUpdateBranchAuth struct{ *locale.LocalizedError }

type IngredientAndVersion

type IngredientAndVersion struct {
	*inventory_models.SearchIngredientsResponseItem
	Version string
}

IngredientAndVersion is a sane version of whatever the hell it is go-swagger thinks it's doing

func FilterSupportedIngredients

func FilterSupportedIngredients(supported []model.SupportedLanguage, ingredients []*IngredientAndVersion) ([]*IngredientAndVersion, error)

FilterSupportedIngredients filters a list of ingredients, returning only those that are currently supported (such that they can be built) by the Platform

func SearchIngredients

func SearchIngredients(namespace string, name string, includeVersions bool, ts *time.Time, auth *authentication.Auth) ([]*IngredientAndVersion, error)

SearchIngredients will return all ingredients+ingredientVersions that fuzzily match the ingredient name.

func SearchIngredientsLatest

func SearchIngredientsLatest(namespace string, name string, includeVersions bool, ts *time.Time, auth *authentication.Auth) ([]*IngredientAndVersion, error)

SearchIngredientsLatest will return all ingredients+ingredientVersions that fuzzily match the ingredient name, but only the latest version of each ingredient.

func SearchIngredientsLatestStrict

func SearchIngredientsLatestStrict(namespace string, name string, caseSensitive bool, includeVersions bool, ts *time.Time, auth *authentication.Auth) ([]*IngredientAndVersion, error)

SearchIngredientsLatestStrict will return all ingredients+ingredientVersions that strictly match the ingredient name, but only the latest version of each ingredient.

func SearchIngredientsStrict

func SearchIngredientsStrict(namespace string, name string, caseSensitive bool, includeVersions bool, ts *time.Time, auth *authentication.Auth) ([]*IngredientAndVersion, error)

SearchIngredientsStrict will return all ingredients+ingredientVersions that strictly match the ingredient name.

type IngredientName

type IngredientName string

type Language

type Language struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Language represents a language requirement

func CheckpointToLanguage

func CheckpointToLanguage(requirements []*gqlModel.Requirement, auth *authentication.Auth) (*Language, error)

CheckpointToLanguage returns the language from a checkpoint

func FetchLanguageByDetails

func FetchLanguageByDetails(name, version string, auth *authentication.Auth) (*Language, error)

func FetchLanguageForCommit

func FetchLanguageForCommit(commitID strfmt.UUID, auth *authentication.Auth) (*Language, error)

func FetchLanguages

func FetchLanguages(auth *authentication.Auth) ([]Language, error)

func FetchLanguagesForCommit

func FetchLanguagesForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]Language, error)

FetchLanguagesForCommit fetches a list of language names for the given commit

func LanguageByCommit

func LanguageByCommit(commitID strfmt.UUID, auth *authentication.Auth) (Language, error)

type MergeCommitParams

type MergeCommitParams struct {
	Owner     string
	Project   string
	TargetRef string // the commit ID or branch name to merge into
	OtherRef  string // the commit ID or branch name to merge from
	Strategy  model.MergeStrategy
}

type Namespace

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

Namespace is the type used for communicating namespaces, mainly just allows for self documenting code

func NewBlankNamespace

func NewBlankNamespace() Namespace

func NewNamespaceBundle

func NewNamespaceBundle(language string) Namespace

NewNamespaceBundle creates a new bundles namespace

func NewNamespaceLanguage

func NewNamespaceLanguage() Namespace

NewNamespaceLanguage provides the base language namespace.

func NewNamespacePackage

func NewNamespacePackage(language string) Namespace

NewNamespacePackage creates a new package namespace

func NewNamespacePkgOrBundle

func NewNamespacePkgOrBundle(language string, nstype NamespaceType) Namespace

func NewNamespacePlatform

func NewNamespacePlatform() Namespace

NewNamespacePlatform provides the base platform namespace.

func NewOrgNamespace

func NewOrgNamespace(orgName string) Namespace

func NewRawNamespace

func NewRawNamespace(value string) Namespace

func (Namespace) IsValid

func (n Namespace) IsValid() bool

func (Namespace) String

func (n Namespace) String() string

func (Namespace) Type

func (n Namespace) Type() NamespaceType

type NamespaceMatchable

type NamespaceMatchable string

NamespaceMatchable represents regular expression strings used for defining matchable requirements.

type NamespaceType

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

func (NamespaceType) Matchable

func (t NamespaceType) Matchable() NamespaceMatchable

func (NamespaceType) Prefix

func (t NamespaceType) Prefix() string

func (NamespaceType) String

func (t NamespaceType) String() string

type Operation

type Operation string

Operation is the action to be taken in a commit

type PackageVulnerability

type PackageVulnerability struct {
	Name    string          `json:"name"`
	Version string          `json:"version"`
	Details []Vulnerability `json:"cves"`
}

func ExtractPackageVulnerabilities

func ExtractPackageVulnerabilities(sources []model.SourceVulnerability) []PackageVulnerability

type Platform

type Platform = inventory_models.Platform

Platform is a sane version of whatever the hell it is go-swagger thinks it's doing

func FetchPlatformByDetails

func FetchPlatformByDetails(name, version string, word int, auth *authentication.Auth) (*Platform, error)

func FetchPlatformByUID

func FetchPlatformByUID(uid strfmt.UUID, auth *authentication.Auth) (*Platform, error)

func FetchPlatforms

func FetchPlatforms(auth *authentication.Auth) ([]*Platform, error)

func FetchPlatformsForCommit

func FetchPlatformsForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]*Platform, error)

type ProjectInfo

type ProjectInfo interface {
	Owner() string
	Name() string
	CommitUUID() strfmt.UUID
	BranchName() string
}

type SolverError

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

func (*SolverError) Error

func (e *SolverError) Error() string

func (*SolverError) IsTransient

func (e *SolverError) IsTransient() bool

func (*SolverError) Unwrap

func (e *SolverError) Unwrap() error

func (*SolverError) ValidationErrors

func (e *SolverError) ValidationErrors() []string

type StageCommitParams

type StageCommitParams struct {
	Owner        string
	Project      string
	ParentCommit string
	Description  string
	// Commits can have either requirements (e.g. installing a package)...
	Requirements []StageCommitRequirement
	// ... or commits can have an expression (e.g. from pull). When pulling an expression, we do not
	// compute its changes into a series of above operations. Instead, we just pass the new
	// expression directly.
	Expression *buildexpression.BuildExpression
	TimeStamp  *time.Time
}

type StageCommitRequirement

type StageCommitRequirement struct {
	Name      string
	Version   []bpModel.VersionRequirement
	Namespace Namespace
	Revision  *int
	Operation bpModel.Operation
}

type SvcModel

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

func NewSvcModel

func NewSvcModel(port string) *SvcModel

NewSvcModel returns a model for all client connections to a State Svc. This function returns an error if the State service is not yet ready to communicate.

func (*SvcModel) AnalyticsEvent

func (m *SvcModel) AnalyticsEvent(ctx context.Context, category, action, source, label string, dimJson string) error

func (*SvcModel) CheckMessages

func (m *SvcModel) CheckMessages(ctx context.Context, command string, flags []string) ([]*graph.MessageInfo, error)

func (*SvcModel) CheckUpdate

func (m *SvcModel) CheckUpdate(ctx context.Context, desiredChannel, desiredVersion string) (*graph.AvailableUpdate, error)

CheckUpdate returns cached update information. There is no guarantee that available information is immediately cached. For instance, if this info is requested shortly after the service is started up, the data may return empty for a little while.

func (*SvcModel) ConfigChanged

func (m *SvcModel) ConfigChanged(ctx context.Context, key string) error

func (*SvcModel) EnableDebugLog

func (m *SvcModel) EnableDebugLog()

EnableDebugLog turns on debug logging

func (*SvcModel) FetchLogTail

func (m *SvcModel) FetchLogTail(ctx context.Context) (string, error)

func (*SvcModel) GetProcessesInUse

func (m *SvcModel) GetProcessesInUse(ctx context.Context, execDir string) ([]*graph.ProcessInfo, error)

func (*SvcModel) LocalProjects

func (m *SvcModel) LocalProjects(ctx context.Context) ([]*graph.Project, error)

func (*SvcModel) Ping

func (m *SvcModel) Ping() error

func (*SvcModel) ReportRuntimeUsage

func (m *SvcModel) ReportRuntimeUsage(ctx context.Context, pid int, exec, source string, dimJson string) error

func (*SvcModel) StateVersion

func (m *SvcModel) StateVersion(ctx context.Context) (*graph.Version, error)

type TrackingType

type TrackingType string

func (TrackingType) String

func (t TrackingType) String() string

type Vulnerabilities

type Vulnerabilities struct {
	Critical []string
	High     []string
	Medium   []string
	Low      []string
}

func (*Vulnerabilities) Count

func (v *Vulnerabilities) Count() map[string]int

func (Vulnerabilities) Length

func (v Vulnerabilities) Length() int

type Vulnerability

type Vulnerability model.Vulnerability

type VulnerabilityIngredient

type VulnerabilityIngredient struct {
	Name             string
	PrimaryNamespace string
	Version          string
	Vulnerabilities  *Vulnerabilities
}

func FetchVulnerabilitiesForIngredient

func FetchVulnerabilitiesForIngredient(auth *authentication.Auth, ingredient *request.Ingredient) (*VulnerabilityIngredient, error)

func FetchVulnerabilitiesForIngredients

func FetchVulnerabilitiesForIngredients(auth *authentication.Auth, ingredients []*request.Ingredient) ([]*VulnerabilityIngredient, error)

type VulnerableIngredientByLevel

type VulnerableIngredientByLevel struct {
	IngredientName    string
	IngredientVersion string
	CVEIDs            []string
}

type VulnerableIngredientsByLevel

type VulnerableIngredientsByLevel struct {
	Count        int
	CountPrimary int
	Ingredients  map[IngredientName]VulnerableIngredientByLevel
}

type VulnerableIngredientsByLevels

type VulnerableIngredientsByLevels struct {
	Count        int
	CountPrimary int
	Critical     VulnerableIngredientsByLevel
	High         VulnerableIngredientsByLevel
	Medium       VulnerableIngredientsByLevel
	Low          VulnerableIngredientsByLevel
}

func CombineVulnerabilities

func CombineVulnerabilities(ingredients []*VulnerabilityIngredient, primaryIngredients ...string) VulnerableIngredientsByLevels

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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