Documentation
¶
Index ¶
- Constants
- func AuthSessionFrom(ctx context.Context) (*auth.Session, bool)
- func Ext(path string) string
- func GetAIConfigIDFromPath(r *http.Request) (int64, error)
- func GetAccessTokenFromQuery(r *http.Request) (string, bool)
- func GetBranchFromQuery(r *http.Request) string
- func GetCommitSHAFromPath(r *http.Request) (string, error)
- func GetCommitSHAFromQueryOrDefault(r *http.Request) string
- func GetConnectorRefFromPath(r *http.Request) (string, error)
- func GetContainerRepositoryFromPath(r *http.Request) (string, string, error)
- func GetContentEncodingFromHeadersOrDefault(r *http.Request, dflt string) string
- func GetCookie(r *http.Request, cookieName string) (string, bool)
- func GetDeletedAtFromQuery(r *http.Request) (int64, bool, error)
- func GetDeletedAtFromQueryOrError(r *http.Request) (int64, error)
- func GetDeletedBeforeOrAtFromQuery(r *http.Request) (int64, bool, error)
- func GetDigestFromPath(r *http.Request) (string, error)
- func GetExecutionIdFromPath(r *http.Request) (int64, error)
- func GetExecutionNumberFromPath(r *http.Request) (int64, error)
- func GetFileDiffFromQuery(r *http.Request) (files gittypes.FileDiffRequests)
- func GetFlattenDirectoriesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetGitProtocolFromHeadersOrDefault(r *http.Request, deflt string) string
- func GetGitRefFromQueryOrDefault(r *http.Request, deflt string) string
- func GetGitServiceTypeFromQuery(r *http.Request) (enum.GitServiceType, error)
- func GetGitspaceRefFromPath(r *http.Request) (string, error)
- func GetHeader(r *http.Request, headerName string) (string, bool)
- func GetHeaderOrDefault(r *http.Request, headerName string, dflt string) string
- func GetIfNoneMatchFromHeader(r *http.Request) (string, bool)
- func GetIncludeChecksFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetIncludeCommitFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetIncludeCookieFromQueryOrDefault(r *http.Request, dflt bool) (bool, error)
- func GetIncludeDirectoriesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetIncludePullReqsFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetIncludeRulesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)
- func GetIncludeSubspacesFromQuery(r *http.Request) (bool, error)
- func GetInfraProviderRefFromPath(r *http.Request) (string, error)
- func GetLabelIDFromPath(r *http.Request) (int64, error)
- func GetLabelKeyFromPath(r *http.Request) (string, error)
- func GetLabelValueFromPath(r *http.Request) (string, error)
- func GetLatestFromPath(r *http.Request) bool
- func GetMaxDivergenceFromQueryOrDefault(r *http.Request, deflt int64) (int64, error)
- func GetOptionalRemainderFromPath(r *http.Request) string
- func GetPipelineIdentifierFromPath(r *http.Request) (string, error)
- func GetPrincipalIDFromPath(r *http.Request) (int64, error)
- func GetPrincipalUIDFromPath(r *http.Request) (string, error)
- func GetPublicKeyIdentifierFromPath(r *http.Request) (string, error)
- func GetPullReqCommentIDPath(r *http.Request) (int64, error)
- func GetPullReqNumberFromPath(r *http.Request) (int64, error)
- func GetPullReqSourceBranchFromPath(r *http.Request) (string, error)
- func GetPullReqTargetBranchFromPath(r *http.Request) (string, error)
- func GetReferenceFromPath(r *http.Request) (string, error)
- func GetRemainderFromPath(r *http.Request) (string, error)
- func GetRepoRefFromPath(r *http.Request) (string, error)
- func GetReviewerIDFromPath(r *http.Request) (int64, error)
- func GetRuleIdentifierFromPath(r *http.Request) (string, error)
- func GetSecretRefFromPath(r *http.Request) (string, error)
- func GetServiceAccountUIDFromPath(r *http.Request) (string, error)
- func GetSourceRepoRefFromQueryOrDefault(r *http.Request, deflt string) string
- func GetSpaceRefFromPath(r *http.Request) (string, error)
- func GetStageIdFromPath(r *http.Request) (int64, error)
- func GetStageNumberFromPath(r *http.Request) (int64, error)
- func GetStepNumberFromPath(r *http.Request) (int64, error)
- func GetTemplateRefFromPath(r *http.Request) (string, error)
- func GetTemplateTypeFromPath(r *http.Request) (string, error)
- func GetTokenFromCookie(r *http.Request, cookieName string) (string, bool)
- func GetTokenIdentifierFromPath(r *http.Request) (string, error)
- func GetTriggerIdentifierFromPath(r *http.Request) (string, error)
- func GetUUIDFromPath(r *http.Request) (string, error)
- func GetUserGroupIDFromPath(r *http.Request) (int64, error)
- func GetUserIDFromPath(r *http.Request) (int64, error)
- func GetUserUIDFromPath(r *http.Request) (string, error)
- func GetWebhookExecutionIDFromPath(r *http.Request) (int64, error)
- func GetWebhookIdentifierFromPath(r *http.Request) (string, error)
- func ParseAdminStatisticsFilter(r *http.Request) (*types.RepositoryStatisticsFilter, error)
- func ParseArchiveParams(r *http.Request) (api.ArchiveParams, string, error)
- func ParseArtifactFilter(r *http.Request) *types.ArtifactFilter
- func ParseArtifactFormat(r *http.Request) string
- func ParseArtifactTreeFilter(r *http.Request) *types.ArtifactTreeFilter
- func ParseArtifactVersionFilter(r *http.Request) (*types.ArtifactVersionFilter, error)
- func ParseAssignableFromQuery(r *http.Request) (bool, error)
- func ParseAssignableLabelFilter(r *http.Request) (*types.AssignableLabelFilter, error)
- func ParseBranchFilter(r *http.Request) (*types.BranchFilter, error)
- func ParseBranchMetadataOptions(r *http.Request) (types.BranchMetadataOptions, error)
- func ParseBypassRulesFromQuery(r *http.Request) (bool, error)
- func ParseCheckListOptions(r *http.Request) types.CheckListOptions
- func ParseCheckRecentOptions(r *http.Request) (types.CheckRecentOptions, error)
- func ParseCommitFilter(r *http.Request) (*types.CommitFilter, error)
- func ParseCreated(r *http.Request) (types.CreatedFilter, error)
- func ParseDryRunRulesFromQuery(r *http.Request) (bool, error)
- func ParseEdited(r *http.Request) (types.EditedFilter, error)
- func ParseInheritedFromQuery(r *http.Request) (bool, error)
- func ParseLabelFilter(r *http.Request) (*types.LabelFilter, error)
- func ParseLimit(r *http.Request) int
- func ParseLimit1000(r *http.Request) int
- func ParseListExecutionsFilterFromRequest(r *http.Request) (types.ListExecutionsFilter, error)
- func ParseListPipelinesFilterFromRequest(r *http.Request) (types.ListPipelinesFilter, error)
- func ParseListPublicKeyQueryFilterFromRequest(r *http.Request) (types.PublicKeyFilter, error)
- func ParseListQueryFilterFromRequest(r *http.Request) types.ListQueryFilter
- func ParseMembershipSpaceFilter(r *http.Request) types.MembershipSpaceFilter
- func ParseMembershipSpaceSort(r *http.Request) enum.MembershipSpaceSort
- func ParseMembershipUserFilter(r *http.Request) types.MembershipUserFilter
- func ParseMembershipUserSort(r *http.Request) enum.MembershipUserSort
- func ParseOrder(r *http.Request) enum.Order
- func ParsePage(r *http.Request) int
- func ParsePaginationFromRequest(r *http.Request) types.Pagination
- func ParsePrincipalFilter(r *http.Request) *types.PrincipalFilter
- func ParsePrincipalTypes(r *http.Request) []enum.PrincipalType
- func ParsePullReqActivityFilter(r *http.Request) (*types.PullReqActivityFilter, error)
- func ParsePullReqFilter(r *http.Request) (*types.PullReqFilter, error)
- func ParsePullReqMetadataOptions(r *http.Request) (types.PullReqMetadataOptions, error)
- func ParseQuery(r *http.Request) string
- func ParseQueryAfterFromRequest(r *http.Request) int64
- func ParseRecursiveFromQuery(r *http.Request) (bool, error)
- func ParseRepoFilter(r *http.Request) (*types.RepoFilter, error)
- func ParseRepositoryStatisticsFilter(r *http.Request) (*types.RepositoryStatisticsFilter, error)
- func ParseRuleFilter(r *http.Request) *types.RuleFilter
- func ParseSort(r *http.Request) string
- func ParseSortBranch(r *http.Request) enum.BranchSortOption
- func ParseSortExecution(r *http.Request) enum.ExecutionSort
- func ParseSortPullReq(r *http.Request) enum.PullReqSort
- func ParseSortRepo(r *http.Request) enum.RepoAttr
- func ParseSortSpace(r *http.Request) enum.SpaceAttr
- func ParseSortTag(r *http.Request) enum.TagSortOption
- func ParseSortUser(r *http.Request) enum.UserAttr
- func ParseSortWebhook(r *http.Request) enum.WebhookAttr
- func ParseSpaceFilter(r *http.Request) (*types.SpaceFilter, error)
- func ParseStatisticsBeginTimeFromQuery(r *http.Request) string
- func ParseStatisticsBranchFromQuery(r *http.Request) string
- func ParseStatisticsEndTimeFromQuery(r *http.Request) string
- func ParseStatisticsIncludeCodeFromQuery(r *http.Request) (bool, error)
- func ParseStatisticsIncludeMergeRequestFromQuery(r *http.Request) (bool, error)
- func ParseStatisticsIncludePushRequestFromQuery(r *http.Request) (bool, error)
- func ParseStatisticsIncludeReviewFromQuery(r *http.Request) (bool, error)
- func ParseStatisticsPeriodFromQuery(r *http.Request) string
- func ParseStatisticsTopFromQuery(r *http.Request) (int64, error)
- func ParseStatisticsUserFromQuery(r *http.Request) string
- func ParseTagFilter(r *http.Request) *types.TagFilter
- func ParseUpdated(r *http.Request) (types.UpdatedFilter, error)
- func ParseUserFilter(r *http.Request) *types.UserFilter
- func ParseWebhookExecutionFilter(r *http.Request) *types.WebhookExecutionFilter
- func ParseWebhookFilter(r *http.Request) *types.WebhookFilter
- func PathParam(r *http.Request, paramName string) (string, error)
- func PathParamAsPositiveInt64(r *http.Request, paramName string) (int64, error)
- func PathParamOrEmpty(r *http.Request, paramName string) string
- func PathParamOrError(r *http.Request, paramName string) (string, error)
- func PrincipalFrom(ctx context.Context) (*types.Principal, bool)
- func QueryParam(r *http.Request, paramName string) (string, bool)
- func QueryParamAsBoolOrDefault(r *http.Request, paramName string, deflt bool) (bool, error)
- func QueryParamAsPositiveInt64(r *http.Request, paramName string) (int64, bool, error)
- func QueryParamAsPositiveInt64OrDefault(r *http.Request, paramName string, deflt int64) (int64, error)
- func QueryParamAsPositiveInt64OrError(r *http.Request, paramName string) (int64, error)
- func QueryParamList(r *http.Request, paramName string) ([]string, bool)
- func QueryParamListAsPositiveInt64(r *http.Request, paramName string) ([]int64, error)
- func QueryParamOrDefault(r *http.Request, paramName string, deflt string) string
- func QueryParamOrError(r *http.Request, paramName string) (string, error)
- func RepoFrom(ctx context.Context) (*types.Repository, bool)
- func RequestIDFrom(ctx context.Context) (string, bool)
- func ServiceAccountFrom(ctx context.Context) (*types.ServiceAccount, bool)
- func SpaceFrom(ctx context.Context) (*types.Space, bool)
- func UserFrom(ctx context.Context) (*types.User, bool)
- func WithAuthSession(parent context.Context, v *auth.Session) context.Context
- func WithRepo(parent context.Context, v *types.Repository) context.Context
- func WithRequestID(parent context.Context, v string) context.Context
- func WithServiceAccount(parent context.Context, v *types.ServiceAccount) context.Context
- func WithSpace(parent context.Context, v *types.Space) context.Context
- func WithUser(parent context.Context, v *types.User) context.Context
Constants ¶
const ( PathParamArchiveGitRef = "*" QueryParamArchivePaths = "path" QueryParamArchivePrefix = "prefix" QueryParamArchiveAttributes = "attributes" QueryParamArchiveTime = "time" QueryParamArchiveCompression = "compression" )
const ( QueryArtifactFormat = "format" // container params ParamDigest = "digest" PathParamName = "name" PathParamUUID = "uuid" PathParamRefer = "reference" QueryParamPackage = "package" QueryParamGroup = "group" QueryParamVersion = "version" QueryParamNodeLevel = "level" )
const ( QueryParamAccessToken = "access_token" QueryParamIncludeCookie = "include_cookie" )
const ( PathParamRemainder = "*" QueryParamCreatedBy = "created_by" QueryParamSort = "sort" QueryParamOrder = "order" QueryParamQuery = "query" QueryParamRecursive = "recursive" QueryParamLabelID = "label_id" QueryParamValueID = "value_id" QueryParamState = "state" QueryParamKind = "kind" QueryParamType = "type" QueryParamAfter = "after" QueryParamBefore = "before" QueryParamDeletedBeforeOrAt = "deleted_before_or_at" QueryParamDeletedAt = "deleted_at" QueryParamCreatedLt = "created_lt" QueryParamCreatedGt = "created_gt" QueryParamUpdatedLt = "updated_lt" QueryParamUpdatedGt = "updated_gt" QueryParamEditedLt = "edited_lt" QueryParamEditedGt = "edited_gt" QueryParamPage = "page" QueryParamLimit = "limit" PerPageDefault = 30 PerPageMax = 100 QueryParamSudo = "sudo" QueryParamInherited = "inherited" QueryParamAssignable = "assignable" // TODO: have shared constants across all services? HeaderRequestID = "X-Request-Id" HeaderUserAgent = "User-Agent" HeaderAuthorization = "Authorization" HeaderContentEncoding = "Content-Encoding" HeaderSudo = "Sudo" HeaderIfNoneMatch = "If-None-Match" HeaderETag = "ETag" )
const ( HeaderParamGitProtocol = "Git-Protocol" PathParamCommitSHA = "commit_sha" QueryParamGitRef = "git_ref" QueryParamIncludeCommit = "include_commit" QueryParamIncludeDirectories = "include_directories" QueryParamFlattenDirectories = "flatten_directories" QueryParamLineFrom = "line_from" QueryParamLineTo = "line_to" QueryParamPath = "path" QueryParamSince = "since" QueryParamUntil = "until" QueryParamCommitter = "committer" QueryParamCommitterID = "committer_id" QueryParamAuthor = "author" QueryParamAuthorID = "author_id" QueryParamIncludeStats = "include_stats" QueryParamInternal = "internal" QueryParamService = "service" QueryParamCommitSHA = "commit_sha" QueryParamIncludeChecks = "include_checks" QueryParamIncludeRules = "include_rules" QueryParamIncludePullReqs = "include_pullreqs" QueryParamMaxDivergence = "max_divergence" )
const ( // QueryParamGitArchiveFormat was provided for git archive QueryParamGitArchiveFormat = "format" // PathParamExecutionId was provided for read execution primary key PathParamExecutionId = "execution_id" // PathParamStageId was provided for read stage primary key PathParamStageId = "stage_id" )
const ( PathParamLabelKey = "label_key" PathParamLabelValue = "label_value" PathParamLabelID = "label_id" )
const ( PathParamPipelineIdentifier = "pipeline_identifier" PathParamExecutionNumber = "execution_number" PathParamStageNumber = "stage_number" PathParamStepNumber = "step_number" PathParamTriggerIdentifier = "trigger_identifier" QueryParamLatest = "latest" QueryParamLastExecutions = "last_executions" QueryParamBranch = "branch" )
const ( PathParamPrincipalUID = "principal_uid" PathParamUserUID = "user_uid" PathParamUserID = "user_id" PathParamServiceAccountUID = "sa_uid" PathParamPrincipalID = "principal_id" )
const ( PathParamPullReqNumber = "pullreq_number" PathParamPullReqCommentID = "pullreq_comment_id" PathParamReviewerID = "pullreq_reviewer_id" PathParamUserGroupID = "user_group_id" PathParamSourceBranch = "source_branch" PathParamTargetBranch = "target_branch" QueryParamCommenterID = "commenter_id" QueryParamReviewerID = "reviewer_id" QueryParamReviewDecision = "review_decision" QueryParamMentionedID = "mentioned_id" QueryParamExcludeDescription = "exclude_description" QueryParamSourceRepoRef = "source_repo_ref" QueryParamSourceBranch = "source_branch" QueryParamTargetBranch = "target_branch" )
const ( PathParamRepoRef = "repo_ref" QueryParamRepoID = "repo_id" )
const ( PathParamRuleIdentifier = "rule_identifier" QueryParamBypassRules = "bypass_rules" QueryParamDryRunRules = "dry_run_rules" )
const ( PathParamSpaceRef = "space_ref" QueryParamIncludeSubspaces = "include_subspaces" )
const ( QueryParamStatisticsIncludeMergeRequest = "include_merge_request" QueryParamStatisticsIncludePushRequest = "include_push_request" QueryParamStatisticsIncludeReview = "include_review" QueryParamStatisticsIncludeCode = "include_code" QueryParamStatisticsBranch = "branch" QueryParamStatisticsPeriod = "period" QueryParamStatisticsBeginTime = "begin" QueryParamStatisticsEndTime = "end" QueryParamStatisticsTop = "top" QueryParamStatisticsUser = "user" )
const ( PathParamTemplateRef = "template_ref" PathParamTemplateType = "template_type" )
const ( PathParamWebhookIdentifier = "webhook_identifier" PathParamWebhookExecutionID = "webhook_execution_id" )
const (
PathParamAIConfigID = "ai_id"
)
const (
PathParamConnectorRef = "connector_ref"
)
const (
PathParamGitspaceIdentifier = "gitspace_identifier"
)
const (
PathParamInfraProviderConfigIdentifier = "infraprovider_identifier"
)
const (
PathParamPublicKeyIdentifier = "public_key_identifier"
)
const (
PathParamSecretRef = "secret_ref"
)
const (
PathParamTokenIdentifier = "token_identifier"
)
const QueryParamPipelineIdentifier = "pipeline_identifier"
Variables ¶
This section is empty.
Functions ¶
func AuthSessionFrom ¶
AuthSessionFrom returns the value of the principal key on the context.
func GetBranchFromQuery ¶
func GetContentEncodingFromHeadersOrDefault ¶
GetContentEncodingFromHeadersOrDefault returns the content encoding from the request headers.
func GetCookie ¶
GetCookie tries to retrieve the cookie from the request or returns false if it doesn't exist.
func GetDeletedAtFromQuery ¶
GetDeletedAtFromQuery gets the exact resource deletion timestamp from the query as an optional parameter.
func GetDeletedAtFromQueryOrError ¶
GetDeletedAtFromQueryOrError gets the exact resource deletion timestamp from the query.
func GetDeletedBeforeOrAtFromQuery ¶
GetDeletedBeforeOrAtFromQuery gets the resource deletion timestamp from the query as an optional parameter.
func GetFileDiffFromQuery ¶
func GetFileDiffFromQuery(r *http.Request) (files gittypes.FileDiffRequests)
func GetGitProtocolFromHeadersOrDefault ¶
GetGitProtocolFromHeadersOrDefault returns the git protocol from the request headers.
func GetGitServiceTypeFromQuery ¶
func GetGitServiceTypeFromQuery(r *http.Request) (enum.GitServiceType, error)
GetGitServiceTypeFromQuery returns the git service type from the request query.
func GetHeader ¶
GetHeader returns the value of the first non-empty header occurrence. If no value is found, `false` is returned.
func GetHeaderOrDefault ¶
GetHeaderOrDefault returns the value of the first non-empty header occurrence. If no value is found, the default value is returned.
func GetLatestFromPath ¶
func GetOptionalRemainderFromPath ¶
GetOptionalRemainderFromPath returns the remainder ("*") from the path or an empty string if it doesn't exist.
func GetPrincipalIDFromPath ¶
GetPrincipalIDFromPath returns the user id from the request path.
func GetRemainderFromPath ¶
GetRemainderFromPath returns the remainder ("*") from the path or an error if it doesn't exist.
func GetRuleIdentifierFromPath ¶
GetRuleIdentifierFromPath extracts the protection rule identifier from the URL.
func GetTokenFromCookie ¶
func GetUserIDFromPath ¶
GetUserIDFromPath returns the user id from the request path.
func ParseAdminStatisticsFilter ¶
func ParseAdminStatisticsFilter(r *http.Request) (*types.RepositoryStatisticsFilter, error)
ParseAdminStatisticsFilter extracts the admin statistics filter from the url.
func ParseArchiveParams ¶
func ParseArtifactFilter ¶
func ParseArtifactFilter(r *http.Request) *types.ArtifactFilter
ParseArtifactFilter extracts the artifact filter from the url.
func ParseArtifactFormat ¶
func ParseArtifactTreeFilter ¶
func ParseArtifactTreeFilter(r *http.Request) *types.ArtifactTreeFilter
ParseArtifactTreeFilter extracts the tree filter from the url.
func ParseArtifactVersionFilter ¶
func ParseArtifactVersionFilter(r *http.Request) (*types.ArtifactVersionFilter, error)
func ParseAssignableFromQuery ¶
ParseAssignableFromQuery extracts the assignable option from the URL query.
func ParseAssignableLabelFilter ¶
func ParseAssignableLabelFilter(r *http.Request) (*types.AssignableLabelFilter, error)
ParseAssignableLabelFilter extracts the assignable label filter from the url.
func ParseBranchFilter ¶
func ParseBranchFilter(r *http.Request) (*types.BranchFilter, error)
ParseBranchFilter extracts the branch filter from the url.
func ParseBranchMetadataOptions ¶
func ParseBranchMetadataOptions(r *http.Request) (types.BranchMetadataOptions, error)
func ParseBypassRulesFromQuery ¶
ParseBypassRulesFromQuery extracts the bypass rules parameter from the URL query.
func ParseCheckListOptions ¶
func ParseCheckListOptions(r *http.Request) types.CheckListOptions
ParseCheckListOptions extracts the status check list API options from the url.
func ParseCheckRecentOptions ¶
func ParseCheckRecentOptions(r *http.Request) (types.CheckRecentOptions, error)
ParseCheckRecentOptions extracts the list recent status checks API options from the url.
func ParseCommitFilter ¶
func ParseCommitFilter(r *http.Request) (*types.CommitFilter, error)
ParseCommitFilter extracts the commit filter from the url.
func ParseCreated ¶
func ParseCreated(r *http.Request) (types.CreatedFilter, error)
ParseCreated extracts the created filter from the url query param.
func ParseDryRunRulesFromQuery ¶
ParseDryRunRulesFromQuery extracts the dry run rules parameter from the URL query.
func ParseEdited ¶
func ParseEdited(r *http.Request) (types.EditedFilter, error)
ParseEdited extracts the edited filter from the url query param.
func ParseInheritedFromQuery ¶
ParseInheritedFromQuery extracts the inherited option from the URL query.
func ParseLabelFilter ¶
func ParseLabelFilter(r *http.Request) (*types.LabelFilter, error)
ParseLabelFilter extracts the label filter from the url.
func ParseLimit ¶
ParseLimit extracts the limit parameter from the url.
func ParseLimit1000 ¶
ParseLimit1000 extracts the limit parameter from the url. TODO: remove this ASAP, quick fix for issue: CODE-2875
func ParseListExecutionsFilterFromRequest ¶
func ParseListExecutionsFilterFromRequest(r *http.Request) (types.ListExecutionsFilter, error)
func ParseListPipelinesFilterFromRequest ¶
func ParseListPipelinesFilterFromRequest(r *http.Request) (types.ListPipelinesFilter, error)
func ParseListPublicKeyQueryFilterFromRequest ¶
func ParseListPublicKeyQueryFilterFromRequest(r *http.Request) (types.PublicKeyFilter, error)
ParseListPublicKeyQueryFilterFromRequest parses query filter for public keys from the url.
func ParseListQueryFilterFromRequest ¶
func ParseListQueryFilterFromRequest(r *http.Request) types.ListQueryFilter
ParseListQueryFilterFromRequest parses pagination and query related info from the url.
func ParseMembershipSpaceFilter ¶
func ParseMembershipSpaceFilter(r *http.Request) types.MembershipSpaceFilter
ParseMembershipSpaceFilter extracts the membership space filter from the url.
func ParseMembershipSpaceSort ¶
func ParseMembershipSpaceSort(r *http.Request) enum.MembershipSpaceSort
ParseMembershipSpaceSort extracts the membership space sort parameter from the url.
func ParseMembershipUserFilter ¶
func ParseMembershipUserFilter(r *http.Request) types.MembershipUserFilter
ParseMembershipUserFilter extracts the membership filter from the url.
func ParseMembershipUserSort ¶
func ParseMembershipUserSort(r *http.Request) enum.MembershipUserSort
ParseMembershipUserSort extracts the membership sort parameter from the url.
func ParseOrder ¶
ParseOrder extracts the order parameter from the url.
func ParsePaginationFromRequest ¶
func ParsePaginationFromRequest(r *http.Request) types.Pagination
ParsePaginationFromRequest parses pagination related info from the url.
func ParsePrincipalFilter ¶
func ParsePrincipalFilter(r *http.Request) *types.PrincipalFilter
ParsePrincipalFilter extracts the principal filter from the url.
func ParsePrincipalTypes ¶
func ParsePrincipalTypes(r *http.Request) []enum.PrincipalType
ParsePrincipalTypes extracts the principal types from the url.
func ParsePullReqActivityFilter ¶
func ParsePullReqActivityFilter(r *http.Request) (*types.PullReqActivityFilter, error)
ParsePullReqActivityFilter extracts the pull request activity query parameter from the url.
func ParsePullReqFilter ¶
func ParsePullReqFilter(r *http.Request) (*types.PullReqFilter, error)
ParsePullReqFilter extracts the pull request query parameter from the url.
func ParsePullReqMetadataOptions ¶
func ParsePullReqMetadataOptions(r *http.Request) (types.PullReqMetadataOptions, error)
func ParseQuery ¶
ParseQuery extracts the query parameter from the url.
func ParseQueryAfterFromRequest ¶
ParseQueryAfterFromRequest parses the query parameter "after" from the request.
func ParseRecursiveFromQuery ¶
ParseRecursiveFromQuery extracts the recursive option from the URL query.
func ParseRepoFilter ¶
func ParseRepoFilter(r *http.Request) (*types.RepoFilter, error)
ParseRepoFilter extracts the repository filter from the url.
func ParseRepositoryStatisticsFilter ¶
func ParseRepositoryStatisticsFilter(r *http.Request) (*types.RepositoryStatisticsFilter, error)
ParseRepositoryStatisticsFilter extracts the repository statistics filter from the url.
func ParseRuleFilter ¶
func ParseRuleFilter(r *http.Request) *types.RuleFilter
ParseRuleFilter extracts the protection rule query parameters from the url.
func ParseSortBranch ¶
func ParseSortBranch(r *http.Request) enum.BranchSortOption
ParseSortBranch extracts the branch sort parameter from the url.
func ParseSortExecution ¶
func ParseSortExecution(r *http.Request) enum.ExecutionSort
ParseSortExecution extracts the execution sort parameter from the url.
func ParseSortPullReq ¶
func ParseSortPullReq(r *http.Request) enum.PullReqSort
ParseSortPullReq extracts the pull request sort parameter from the url.
func ParseSortRepo ¶
ParseSortRepo extracts the repo sort parameter from the url.
func ParseSortSpace ¶
ParseSortSpace extracts the space sort parameter from the url.
func ParseSortTag ¶
func ParseSortTag(r *http.Request) enum.TagSortOption
ParseSortTag extracts the tag sort parameter from the url.
func ParseSortUser ¶
ParseSortUser extracts the user sort parameter from the url.
func ParseSortWebhook ¶
func ParseSortWebhook(r *http.Request) enum.WebhookAttr
ParseSortWebhook extracts the webhook sort parameter from the url.
func ParseSpaceFilter ¶
func ParseSpaceFilter(r *http.Request) (*types.SpaceFilter, error)
ParseSpaceFilter extracts the space filter from the url.
func ParseTagFilter ¶
ParseTagFilter extracts the tag filter from the url.
func ParseUpdated ¶
func ParseUpdated(r *http.Request) (types.UpdatedFilter, error)
ParseUpdated extracts the updated filter from the url query param.
func ParseUserFilter ¶
func ParseUserFilter(r *http.Request) *types.UserFilter
ParseUserFilter extracts the user filter from the url.
func ParseWebhookExecutionFilter ¶
func ParseWebhookExecutionFilter(r *http.Request) *types.WebhookExecutionFilter
ParseWebhookExecutionFilter extracts the WebhookExecution query parameters for listing from the url.
func ParseWebhookFilter ¶
func ParseWebhookFilter(r *http.Request) *types.WebhookFilter
ParseWebhookFilter extracts the Webhook query parameters for listing from the url.
func PathParamAsPositiveInt64 ¶
PathParamAsPositiveInt64 extracts an integer parameter from the request path.
func PathParamOrEmpty ¶
PathParamOrEmpty retrieves the path parameter or returns an empty string otherwise.
func PathParamOrError ¶
PathParamOrError tries to retrieve the parameter from the request and returns the parameter if it exists and is not empty, otherwise returns an error.
func PrincipalFrom ¶
PrincipalFrom returns the principal of the authsession.
func QueryParam ¶
QueryParam returns the parameter if it exists.
func QueryParamAsBoolOrDefault ¶
QueryParamAsBoolOrDefault tries to retrieve the parameter from the query and parse it to bool.
func QueryParamAsPositiveInt64 ¶
QueryParamAsPositiveInt64 extracts an integer parameter from the request query if it exists.
func QueryParamAsPositiveInt64OrDefault ¶
func QueryParamAsPositiveInt64OrDefault(r *http.Request, paramName string, deflt int64) (int64, error)
QueryParamAsPositiveInt64 extracts an integer parameter from the request query. If the parameter doesn't exist the provided default value is returned.
func QueryParamAsPositiveInt64OrError ¶
QueryParamAsPositiveInt64OrError extracts an integer parameter from the request query. If the parameter doesn't exist an error is returned.
func QueryParamList ¶
QueryParamList returns list of the parameter values if they exist.
func QueryParamListAsPositiveInt64 ¶
QueryParamListAsPositiveInt64 extracts integer parameter slice from the request query.
func QueryParamOrDefault ¶
QueryParamOrDefault retrieves the parameter from the query and returns the parameter if it exists, otherwise returns the provided default value.
func QueryParamOrError ¶
QueryParamOrError tries to retrieve the parameter from the query and returns the parameter if it exists, otherwise returns an error.
func RepoFrom ¶
func RepoFrom(ctx context.Context) (*types.Repository, bool)
RepoFrom returns the value of the repo key on the context - ok is true iff a non-nile value existed.
func RequestIDFrom ¶
RequestIDFrom returns the value of the request ID key on the context - ok is true iff a non-empty value existed.
func ServiceAccountFrom ¶
func ServiceAccountFrom(ctx context.Context) (*types.ServiceAccount, bool)
ServiceAccountFrom returns the value of the service account key on the context - ok is true iff a non-nile value existed.
func SpaceFrom ¶
SpaceFrom returns the value of the space key on the context - ok is true iff a non-nile value existed.
func UserFrom ¶
UserFrom returns the value of the user key on the context - ok is true iff a non-nile value existed.
func WithAuthSession ¶
WithAuthSession returns a copy of parent in which the principal value is set.
func WithRequestID ¶
WithRequestID returns a copy of parent in which the request id value is set.
func WithServiceAccount ¶
WithServiceAccount returns a copy of parent in which the service account value is set.
Types ¶
This section is empty.