Documentation ¶
Index ¶
- Constants
- Variables
- func AddBranch(projectID strfmt.UUID, label string, auth *authentication.Auth) (strfmt.UUID, error)
- func AddRevertCommit(commit *mono_models.Commit, auth *authentication.Auth) (*mono_models.Commit, error)
- func BranchCommitID(ownerName, projectName, branchName string) (*strfmt.UUID, error)
- func BranchForProjectByName(pj *mono_models.Project, name string) (*mono_models.Branch, error)
- func BranchForProjectNameByName(owner, name, branch string) (*mono_models.Branch, error)
- func BranchNamesForProjectFiltered(owner, name string, excludes ...string) ([]string, error)
- func BranchesForProject(owner, name string) ([]*mono_models.Branch, error)
- func BuildPlannerVersionConstraintsToString(requirements []types.VersionRequirement) string
- func CheckpointToCamelFlags(checkpoint Checkpoint) []string
- func CheckpointToPlatforms(requirements []*gqlModel.Requirement) []strfmt.UUID
- func CheckpointToRequirements(checkpoint Checkpoint) []*inventory_models.OrderRequirement
- func CommitBelongsToBranch(ownerName, projectName, branchName string, commitID strfmt.UUID, ...) (bool, error)
- func CommitHistory(ownerName, projectName, branchName string, auth *authentication.Auth) ([]*mono_models.Commit, error)
- func CommitHistoryFromID(commitID strfmt.UUID, auth *authentication.Auth) ([]*mono_models.Commit, error)
- func CommitHistoryPaged(commitID strfmt.UUID, offset, limit int64, auth *authentication.Auth) (*mono_models.CommitHistoryInfo, error)
- func CommitInitial(hostPlatform string, langName, langVersion string, auth *authentication.Auth) (strfmt.UUID, error)
- func CommitWithinCommitHistory(latestCommitID, searchCommitID strfmt.UUID, auth *authentication.Auth) (bool, error)
- func CommitsBehind(latestCID, currentCommitID strfmt.UUID, auth *authentication.Auth) (int, error)
- func CommonParent(commit1, commit2 *strfmt.UUID, auth *authentication.Auth) (*strfmt.UUID, error)
- func CreateCopy(sourceOwner, sourceName, targetOwner, targetName string, makePrivate bool, ...) (*mono_models.Project, error)
- func CreateEmptyProject(owner, name string, private bool, auth *authentication.Auth) (*mono_models.Project, error)
- func DefaultBranchForProject(pj *mono_models.Project) (*mono_models.Branch, error)
- func DefaultBranchForProjectName(owner, name string) (*mono_models.Branch, error)
- func DeleteBranch(branchID strfmt.UUID, auth *authentication.Auth) error
- func DeleteProject(owner, project string, auth *authentication.Auth) error
- func EditProject(owner, name string, project *mono_models.ProjectEditable, ...) error
- func FetchCheckpointForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]*gqlModel.Requirement, strfmt.DateTime, error)
- func FetchCommitVulnerabilities(auth *authentication.Auth, commitID string) (*model.CommitVulnerabilities, error)
- func FetchIngredient(ingredientID *strfmt.UUID, auth *authentication.Auth) (*inventory_models.Ingredient, error)
- func FetchIngredientVersion(ingredientID *strfmt.UUID, versionID *strfmt.UUID, allowUnstable bool, ...) (*inventory_models.FullIngredientVersion, error)
- func FetchIngredientVersions(ingredientID *strfmt.UUID, auth *authentication.Auth) ([]*inventory_models.IngredientVersion, error)
- func FetchLanguageVersions(name string, auth *authentication.Auth) ([]string, error)
- func FetchLatestRevisionTimeStamp(auth *authentication.Auth) (time.Time, error)
- func FetchLatestTimeStamp(auth *authentication.Auth) (time.Time, error)
- func FetchNormalizedName(namespace Namespace, name string, auth *authentication.Auth) (string, error)
- func FetchOrgByURLName(urlName string, auth *authentication.Auth) (*mono_models.Organization, error)
- func FetchOrgMember(orgName, name string, auth *authentication.Auth) (*mono_models.Member, error)
- func FetchOrgMembers(urlName string, auth *authentication.Auth) ([]*mono_models.Member, error)
- func FetchOrganizationLimits(orgName string, auth *authentication.Auth) (*mono_models.Limits, error)
- func FetchOrganizationProjects(orgName string, auth *authentication.Auth) ([]*mono_models.Project, error)
- func FetchOrganizations(auth *authentication.Auth) ([]*mono_models.Organization, error)
- func FetchOrganizationsByIDs(ids []strfmt.UUID, auth *authentication.Auth) ([]model.Organization, error)
- func FetchPlatformsMap() (map[strfmt.UUID]*Platform, error)
- func FetchProjectByName(orgName string, projectName string, auth *authentication.Auth) (*mono_models.Project, error)
- func FetchProjectVulnerabilities(auth *authentication.Auth, org, project string) (*model.ProjectVulnerabilities, error)
- func FetchSupportedLanguages(osPlatformName string) ([]model.SupportedLanguage, error)
- func FetchTiers(auth *authentication.Auth) ([]*mono_models.Tier, error)
- func FetchTimeStampForCommit(commitID strfmt.UUID, auth *authentication.Auth) (*time.Time, error)
- func FilterCheckpointNamespace(chkPt []*gqlModel.Requirement, nsType ...NamespaceType) []*gqlModel.Requirement
- func FilterCurrentPlatform(hostPlatform string, platforms []strfmt.UUID, preferredLibcVersion string) (strfmt.UUID, error)
- func FilterPlatformIDs(hostPlatform, hostArch string, platformIDs []strfmt.UUID, ...) ([]strfmt.UUID, error)
- func GetBranchChildren(branch *mono_models.Branch, branches mono_models.Branches) mono_models.Branches
- func GetCommit(commitID strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
- func GetCommitWithinCommitHistory(currentCommitID, targetCommitID strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
- func GetCommitWithinProjectHistory(commitID strfmt.UUID, owner, name string, localCommitID *strfmt.UUID, ...) (*mono_models.Commit, error)
- func GetIngredientByNameAndVersion(namespace string, name string, version string, ts *time.Time, ...) (*inventory_models.FullIngredientVersion, error)
- func GetRequirement(commitID strfmt.UUID, namespace Namespace, requirement string, ...) (*gqlModel.Requirement, error)
- func GetRevertCommit(from, to strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
- func GetRootBranches(branches mono_models.Branches) mono_models.Branches
- func GqlReqVersionConstraintsString(requirement *gqlModel.Requirement) string
- func GqlReqsToMonoCheckpoint(requirements []*gqlModel.Requirement) []*mono_models.Checkpoint
- func HostPlatformToKernelName(os string) string
- func InventoryRequirementsToString(requirements inventory_models.Requirements) string
- func InviteUserToOrg(orgName string, asOwner bool, email string, auth *authentication.Auth) (*mono_models.Invitation, error)
- func LanguageFromNamespace(ns string) string
- func LegacyFetchProjectByName(orgName string, projectName string) (*mono_models.Project, error)
- func MakeProjectPrivate(owner, name string, auth *authentication.Auth) error
- func MergeCommit(commitReceiving, commitWithChanges strfmt.UUID) (*mono_models.MergeStrategies, error)
- func MergeRequired(commitReceiving, commitWithChanges strfmt.UUID) (bool, error)
- func MonoConstraintsToString(monoConstraints mono_models.Constraints) string
- func MoveProject(owner, project, newOwner string, auth *authentication.Auth) error
- func NamespaceMatch(query string, namespace NamespaceMatchable) bool
- func PlatformNameToPlatformID(name string) (string, error)
- func ProjectURL(owner, name, commitID string) string
- func RequestBuild(auth *authentication.Auth, recipeID, commitID strfmt.UUID, ...) (headchef.BuildStatusEnum, *headchef_models.V1BuildStatusResponse, error)
- func ResolveRequirementNameAndVersion(name, version string, word int, namespace Namespace, auth *authentication.Auth) (string, string, error)
- func RevertCommit(from, to, latest strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
- func RevertCommitWithinHistory(from, to, latest strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
- func TrackBranch(source, target *mono_models.Project, auth *authentication.Auth) error
- func UpdateBranchCommit(branchID strfmt.UUID, commitID strfmt.UUID, auth *authentication.Auth) error
- func UpdateBranchForProject(pj ProjectInfo, commitID strfmt.UUID, auth *authentication.Auth) error
- func UpdateBranchTracking(branchID, commitID, trackingBranchID strfmt.UUID, trackingType TrackingType, ...) error
- func UpdateProjectBranchCommit(pj ProjectInfo, commitID strfmt.UUID, auth *authentication.Auth) error
- func UpdateProjectBranchCommitWithModel(pjm *mono_models.Project, branchName string, commitID strfmt.UUID, ...) error
- type Authors
- type Changeset
- type Checkpoint
- type Configurable
- type ErrNoMatchingPlatform
- type ErrProjectNotFound
- type ErrSearch404
- type ErrTooManyMatches
- type ErrUpdateBranchAuth
- type IngredientAndVersion
- func FilterSupportedIngredients(supported []model.SupportedLanguage, ingredients []*IngredientAndVersion) ([]*IngredientAndVersion, error)
- func SearchIngredients(namespace string, name string, includeVersions bool, ts *time.Time, ...) ([]*IngredientAndVersion, error)
- func SearchIngredientsLatest(namespace string, name string, includeVersions bool, ts *time.Time, ...) ([]*IngredientAndVersion, error)
- func SearchIngredientsLatestStrict(namespace string, name string, caseSensitive bool, includeVersions bool, ...) ([]*IngredientAndVersion, error)
- func SearchIngredientsStrict(namespace string, name string, caseSensitive bool, includeVersions bool, ...) ([]*IngredientAndVersion, error)
- type IngredientName
- type Language
- func FetchLanguageForCommit(commitID strfmt.UUID, auth *authentication.Auth) (*Language, error)
- func FetchLanguages(auth *authentication.Auth) ([]Language, error)
- func FetchLanguagesForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]Language, error)
- func LanguageByCommit(commitID strfmt.UUID, auth *authentication.Auth) (Language, error)
- type Namespace
- func NewBlankNamespace() Namespace
- func NewNamespaceBundle(language string) Namespace
- func NewNamespaceLanguage() Namespace
- func NewNamespacePackage(language string) Namespace
- func NewNamespacePkgOrBundle(language string, nstype NamespaceType) Namespace
- func NewNamespacePlatform() Namespace
- func NewOrgNamespace(orgName string) Namespace
- func NewRawNamespace(value string) Namespace
- type NamespaceMatchable
- type NamespaceType
- type Operation
- type PackageVulnerability
- type Platform
- func FetchPlatformByDetails(name, version string, word int, auth *authentication.Auth) (*Platform, error)
- func FetchPlatformByUID(uid strfmt.UUID) (*Platform, error)
- func FetchPlatforms() ([]*Platform, error)
- func FetchPlatformsForCommit(commitID strfmt.UUID, auth *authentication.Auth) ([]*Platform, error)
- type ProjectInfo
- type SvcModel
- func (m *SvcModel) AnalyticsEvent(ctx context.Context, category, action, source, label string, dimJson string) error
- func (m *SvcModel) CheckMessages(ctx context.Context, command string, flags []string) ([]*graph.MessageInfo, error)
- func (m *SvcModel) CheckUpdate(ctx context.Context, desiredChannel, desiredVersion string) (*graph.AvailableUpdate, error)
- func (m *SvcModel) ConfigChanged(ctx context.Context, key string) error
- func (m *SvcModel) EnableDebugLog()
- func (m *SvcModel) FetchLogTail(ctx context.Context) (string, error)
- func (m *SvcModel) GetJWT(ctx context.Context) (*mono_models.JWT, error)
- func (m *SvcModel) GetProcessesInUse(ctx context.Context, execDir string) ([]*graph.ProcessInfo, error)
- func (m *SvcModel) LocalProjects(ctx context.Context) ([]*graph.Project, error)
- func (m *SvcModel) Ping() error
- func (m *SvcModel) ReportRuntimeUsage(ctx context.Context, pid int, exec, source string, dimJson string) error
- func (m *SvcModel) StateVersion(ctx context.Context) (*graph.Version, error)
- type TrackingType
- type Vulnerabilities
- type Vulnerability
- type VulnerabilityIngredient
- type VulnerableIngredientByLevel
- type VulnerableIngredientsByLevel
- type VulnerableIngredientsByLevels
Constants ¶
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) )
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$` )
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) )
const OrgNamespacePrefix = "private/"
Variables ¶
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") )
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{"", "", ""} )
var ErrMemberNotFound = errs.New("member not found")
var (
ErrNoData = errs.New("no data")
)
var ErrOrderForbidden = errs.New("no permission to retrieve order")
var SvcTimeoutMinimal = time.Millisecond * 500
Functions ¶
func AddRevertCommit ¶
func AddRevertCommit(commit *mono_models.Commit, auth *authentication.Auth) (*mono_models.Commit, error)
func BranchCommitID ¶
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 BranchesForProject ¶
func BranchesForProject(owner, name string) ([]*mono_models.Branch, error)
func BuildPlannerVersionConstraintsToString ¶
func BuildPlannerVersionConstraintsToString(requirements []types.VersionRequirement) string
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 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 CommitsBehind ¶
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 ¶
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 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 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 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 FilterPlatformIDs ¶
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 GetCommitWithinProjectHistory ¶
func GetCommitWithinProjectHistory(commitID strfmt.UUID, owner, name string, localCommitID *strfmt.UUID, auth *authentication.Auth) (*mono_models.Commit, error)
GetCommitWithinProjectHistory searches for the a commit with the given commit ID in the given project (including all of its branch history) and returns it if found. Otherwise, it returns ErrCommitNotInHistory. It doesn't matter if the commit exists in multiple branches, as commits do not belong to branches. This function exists primarily as an existence check because the buildplanner API currently accepts a query for a org/project#commitID even if commitID does not belong to org/project. See DS-1705 (yes, DS, not DX).
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 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 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 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 ProjectURL ¶
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 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
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 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 ErrNoMatchingPlatform ¶
func (ErrNoMatchingPlatform) Error ¶
func (e ErrNoMatchingPlatform) Error() string
type ErrProjectNotFound ¶
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 ¶
Language represents a language requirement
func FetchLanguageForCommit ¶
func FetchLanguages ¶
func FetchLanguages(auth *authentication.Auth) ([]Language, error)
func FetchLanguagesForCommit ¶
FetchLanguagesForCommit fetches a list of language names for the given commit
func LanguageByCommit ¶
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 ¶
NewNamespaceBundle creates a new bundles namespace
func NewNamespaceLanguage ¶
func NewNamespaceLanguage() Namespace
NewNamespaceLanguage provides the base language namespace.
func NewNamespacePackage ¶
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 NewRawNamespace ¶
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 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 FetchPlatforms ¶
func FetchPlatformsForCommit ¶
type ProjectInfo ¶
type SvcModel ¶
type SvcModel struct {
// contains filtered or unexported fields
}
func NewSvcModel ¶
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 (*SvcModel) CheckMessages ¶
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 (*SvcModel) EnableDebugLog ¶
func (m *SvcModel) EnableDebugLog()
EnableDebugLog turns on debug logging
func (*SvcModel) FetchLogTail ¶
func (*SvcModel) GetJWT ¶
GetJWT grabs the JWT from the svc, if it exists. Note we respond with mono_models.JWT here for compatibility and to minimize the changeset at time of implementation. We can revisit this in the future.
func (*SvcModel) GetProcessesInUse ¶
func (*SvcModel) LocalProjects ¶
func (*SvcModel) ReportRuntimeUsage ¶
type TrackingType ¶
type TrackingType string
func (TrackingType) String ¶
func (t TrackingType) String() string
type Vulnerabilities ¶
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 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