package
0.0.0-20250302012944-701c1ceec546
Repository: https://github.com/khulnasoft/devsecdb.git
Documentation: pkg.go.dev
# Functions
ConvertUnparsedApproval converts unparsed approval to parsed format.
ConvertUnparsedRisk converts unparsed risk to parsed format.
DefaultMigrationVersion returns the default migration version string.
No description provided by the author
EqualTable compares metadata for two tables.
ErrorCode unwraps an application error and returns its code.
Errorf is a helper function to create an Error with given code and formatted message.
No description provided by the author
FeatureFlag in dev build always returns true.
No description provided by the author
No description provided by the author
No description provided by the author
FormatDBErrorEmptyRowWithQuery formats database error that query returns empty row.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetBinlogAbsDir gets the binary log directory for an instance.
GetClassificationAndUserComment parses classification and user comment from the given comment.
GetCommentFromClassificationAndUserComment returns the comment from the given classification and user comment.
GetEnvironmentID returns the environment ID from a resource name.
GetGroupEmail returns the group email.
GetIdentityProviderID returns the identity provider ID from a resource name.
GetInstanceDatabaseChangelogUID returns the instance ID, database ID, and changelog UID from a resource name.
GetInstanceDatabaseID returns the instance ID and database ID from a resource name.
GetInstanceDatabaseIDChangeHistory returns the instance ID, database ID, and change history ID from a resource name.
GetInstanceDatabaseIDSecretName returns the instance ID, database ID, and secret name from a resource name.
GetInstanceDatabaseRevisionID returns the instance ID, database ID, and revision UID from a resource name.
GetInstanceID returns the instance ID from a resource name.
GetInstanceRoleID returns the instance ID and instance role name from a resource name.
GetIssueID returns the issue ID from a resource name.
GetNameParentTokens returns the tokens from a resource name.
GetPostgresSocketDir returns the postgres socket directory of Devsecdb.
GetProjectAndBranchID returns the project and branch ID from a resource name.
GetProjectID returns the project ID from a resource name.
No description provided by the author
GetProjectIDDatabaseGroupID returns the project ID and database group ID from a resource name.
No description provided by the author
GetProjectIDIssueUID returns the project ID and issue UID from the issue name.
GetProjectIDIssueUIDIssueCommentUID returns the project ID, issue UID and issue comment UID from the issue comment name.
GetProjectIDPlanID returns the project ID and plan ID from a resource name.
GetProjectIDPlanIDPlanCheckRunID returns the project ID, plan ID and plan check run ID from a resource name.
GetProjectIDRolloutID returns the project ID and rollout ID from a resource name.
GetProjectIDRolloutIDMaybeStageID returns the project ID, rollout ID, and maybe stage ID from a resource name.
GetProjectIDRolloutIDMaybeStageIDMaybeTaskID returns the project ID, rollout ID, and maybe stage ID and maybe task ID from a resource name.
GetProjectIDRolloutIDStageIDMaybeTaskID returns the project ID, rollout ID, and maybe stage ID and maybe task ID from a resource name.
GetProjectIDRolloutIDStageIDTaskID returns the project ID, rollout ID, stage ID, and task ID from a resource name.
GetProjectIDRolloutIDStageIDTaskIDTaskRunID returns the project ID, rollout ID, stage ID, task ID and task run ID from a resource name.
GetProjectIDWebhookID returns the project ID and webhook ID from a resource name.
No description provided by the author
No description provided by the author
GetProjectResourceIDSheetUID returns the project ID and sheet UID from a resource name.
GetProjectVCSConnectorID returns the workspace, project, and VCS connector ID from a resource name.
GetQueryExportFactors is used to get risk factors from query and export expressions.
GetResourceDir returns the resource directory of Devsecdb.
GetReviewConfigID returns the review config id from a resource name.
GetRiskID returns the risk ID from a resource name.
GetRoleID returns the role ID from a resource name.
GetSchemaTableName returns the schema and table names from a resource name.
No description provided by the author
GetSettingName returns the setting name from a resource name.
GetTaskID returns the task ID from a resource name.
GetUIDFromName returns the UID from a resource name.
GetUserEmail returns the user email from a resource name.
GetUserID returns the user ID from a resource name.
GetVCSProviderID returns the VCS provider ID from a resource name.
GetWorksheetUID returns the worksheet UID from a resource name.
GetWorkspaceProjectVCSConnectorID returns the workspace, project, and VCS connector ID from a resource name.
HasPrefixes returns true if the string s has any of the given prefixes.
No description provided by the author
NormalizeExternalURL will format the external url.
Obfuscate obfuscates a string with a seed string.
RandomString returns a random string with length n.
Retry uses exponential backoff with timeout.
SanitizeUTF8String returns a copy of the string s with each run of invalid or unprintable UTF-8 byte sequences replaced by its hexadecimal representation string.
TrimSuffix trims the suffix from the name and returns the trimmed name.
TrimSuffixAndGetInstanceDatabaseID trims the suffix from the name and returns the instance ID and database ID.
TrimSuffixAndGetProjectID trims the suffix from the name and returns the project ID.
TruncateString truncates the string to have a maximum length of `limit` characters.
TruncateStringWithDescription tries to truncate the string and append "..
Unobfuscate unobfuscates a string with a seed string.
ValidateGroupCELExpr validates group expr.
ValidateMaskingExceptionCELExpr validates masking exception expr.
ValidateMaskingRuleCELExpr validates masking rule expr.
ValidatePhone validates the phone number.
No description provided by the author
No description provided by the author
Wrap is a helper function to wrap an Error with given code.
Wrapf is a helper function to wrap an Error with given code and formatted message.
# Constants
nolint:revive.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
Application error codes.
nolint:revive.
nolint:revive.
101 ~ 199 db error.
Application error codes.
The maximum number of bytes for sql results in response body.
nolint:revive.
nolint:revive.
ExternalURLPlaceholder is the docs link to configure --external-url.
FeatureFlagNoop is a noop feature flag for demonstration purpose.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
Application error codes.
Application error codes.
nolint:revive.
nolint:revive.
nolint:revive.
MaximumAdvicePerStatus is the maximum number of advice that can be returned per status.
MaximumCommands is the maximum number of commands that can be executed in a single transaction.
No description provided by the author
MaxSheetCheckSize is the maximum size of a sheet for checking changes.
MaxSheetSize is the maximum size (2M) of a sheet for displaying.
nolint:revive.
Application error codes.
Application error codes.
Application error codes.
MigrationBaselineMissing is no longer used.
201 db migration error Db migration is a core feature, so we separate it from the db error.
MinimumCompletedPlanCheckRun is the minimum number required to generate approval flow.
Application error codes.
Application error codes.
Application error codes.
0 ~ 99 general error.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
PrincipalIDContextKey is the key name used to store principal id in the context.
nolint:revive.
ReleaseModeDev is the dev mode.
ReleaseModeProd is the prod mode.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
No description provided by the author
nolint:revive.
nolint:revive.
Application error codes.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
301 task error.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
Application error codes.
401 task sql type error.
nolint:revive.
UserContextKey is the key name used to store user message in the context.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
nolint:revive.
# Variables
ApprovalFactors are the variables when finding the approval template.
IAMPolicyConditionCELAttributes are the variables when evaluating IAM policy condition.
MaskingExceptionPolicyCELAttributes are the variables when evaluating masking exception.
MaskingRulePolicyCELAttributes are the variables when evaluating masking rule.
ProtojsonMarshaler is a global protojson marshaler with DiscardUnknown set to true.
RiskFactors are the variables when evaluating the risk level.
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
Error represents an application-specific error.
MockRoundTripper is a helper to mock http.RoundTripper.
QueryExportFactors is the factors for query and export.
No description provided by the author
# Type aliases
No description provided by the author
Code is the error code.
ContextKey is the key type of context value.
FeatureFlagType is the feature flag type.
ReleaseMode is the mode for release, such as dev or release.