model

package
v0.0.0-...-b6fc690 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: BSD-3-Clause Imports: 54 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)
)
View Source
const OrgNamespacePrefix = "private/"

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 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 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 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() (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, preferredLibcVersion string) (strfmt.UUID, error)

func FilterPlatformIDs

func FilterPlatformIDs(hostPlatform, hostArch string, platformIDs []strfmt.UUID, preferredLibcVersion string) ([]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 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 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

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 Configurable interface {
	GetString(key string) 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 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 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) (*Platform, error)

func FetchPlatforms

func FetchPlatforms() ([]*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 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) GetJWT

func (m *SvcModel) GetJWT(ctx context.Context) (*mono_models.JWT, error)

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 (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