request

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathParamArchiveGitRef       = "*"
	QueryParamArchivePaths       = "path"
	QueryParamArchivePrefix      = "prefix"
	QueryParamArchiveAttributes  = "attributes"
	QueryParamArchiveTime        = "time"
	QueryParamArchiveCompression = "compression"
)
View Source
const (
	QueryArtifactFormat = "format"

	// container params
	ParamDigest    = "digest"
	PathParamName  = "name"
	PathParamUUID  = "uuid"
	PathParamRefer = "reference"

	QueryParamPackage = "package"
	QueryParamGroup   = "group"
	QueryParamVersion = "version"

	QueryParamNodeLevel = "level"
)
View Source
const (
	QueryParamAccessToken   = "access_token"
	QueryParamIncludeCookie = "include_cookie"
)
View Source
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"
)
View Source
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"
)
View Source
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"
)
View Source
const (
	PathParamLabelKey   = "label_key"
	PathParamLabelValue = "label_value"
	PathParamLabelID    = "label_id"
)
View Source
const (
	PathParamPipelineIdentifier = "pipeline_identifier"
	PathParamExecutionNumber    = "execution_number"
	PathParamStageNumber        = "stage_number"
	PathParamStepNumber         = "step_number"
	PathParamTriggerIdentifier  = "trigger_identifier"
	QueryParamLatest            = "latest"
	QueryParamLastExecutions    = "last_executions"
	QueryParamBranch            = "branch"
)
View Source
const (
	PathParamPrincipalUID      = "principal_uid"
	PathParamUserUID           = "user_uid"
	PathParamUserID            = "user_id"
	PathParamServiceAccountUID = "sa_uid"

	PathParamPrincipalID = "principal_id"
)
View Source
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"
)
View Source
const (
	PathParamRepoRef = "repo_ref"
	QueryParamRepoID = "repo_id"
)
View Source
const (
	PathParamRuleIdentifier = "rule_identifier"

	QueryParamBypassRules = "bypass_rules"
	QueryParamDryRunRules = "dry_run_rules"
)
View Source
const (
	PathParamSpaceRef = "space_ref"

	QueryParamIncludeSubspaces = "include_subspaces"
)
View Source
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"
)
View Source
const (
	PathParamTemplateRef  = "template_ref"
	PathParamTemplateType = "template_type"
)
View Source
const (
	PathParamWebhookIdentifier  = "webhook_identifier"
	PathParamWebhookExecutionID = "webhook_execution_id"
)
View Source
const (
	PathParamAIConfigID = "ai_id"
)
View Source
const (
	PathParamConnectorRef = "connector_ref"
)
View Source
const (
	PathParamGitspaceIdentifier = "gitspace_identifier"
)
View Source
const (
	PathParamInfraProviderConfigIdentifier = "infraprovider_identifier"
)
View Source
const (
	PathParamPublicKeyIdentifier = "public_key_identifier"
)
View Source
const (
	PathParamSecretRef = "secret_ref"
)
View Source
const (
	PathParamTokenIdentifier = "token_identifier"
)
View Source
const QueryParamPipelineIdentifier = "pipeline_identifier"

Variables

This section is empty.

Functions

func AuthSessionFrom

func AuthSessionFrom(ctx context.Context) (*auth.Session, bool)

AuthSessionFrom returns the value of the principal key on the context.

func Ext

func Ext(path string) string

func GetAIConfigIDFromPath

func GetAIConfigIDFromPath(r *http.Request) (int64, error)

func GetAccessTokenFromQuery

func GetAccessTokenFromQuery(r *http.Request) (string, bool)

func GetBranchFromQuery

func GetBranchFromQuery(r *http.Request) string

func GetCommitSHAFromPath

func GetCommitSHAFromPath(r *http.Request) (string, error)

func GetCommitSHAFromQueryOrDefault

func GetCommitSHAFromQueryOrDefault(r *http.Request) string

func GetConnectorRefFromPath

func GetConnectorRefFromPath(r *http.Request) (string, error)

func GetContainerRepositoryFromPath

func GetContainerRepositoryFromPath(r *http.Request) (string, string, error)

func GetContentEncodingFromHeadersOrDefault

func GetContentEncodingFromHeadersOrDefault(r *http.Request, dflt string) string

GetContentEncodingFromHeadersOrDefault returns the content encoding from the request headers.

func GetCookie

func GetCookie(r *http.Request, cookieName string) (string, bool)

GetCookie tries to retrieve the cookie from the request or returns false if it doesn't exist.

func GetDeletedAtFromQuery

func GetDeletedAtFromQuery(r *http.Request) (int64, bool, error)

GetDeletedAtFromQuery gets the exact resource deletion timestamp from the query as an optional parameter.

func GetDeletedAtFromQueryOrError

func GetDeletedAtFromQueryOrError(r *http.Request) (int64, error)

GetDeletedAtFromQueryOrError gets the exact resource deletion timestamp from the query.

func GetDeletedBeforeOrAtFromQuery

func GetDeletedBeforeOrAtFromQuery(r *http.Request) (int64, bool, error)

GetDeletedBeforeOrAtFromQuery gets the resource deletion timestamp from the query as an optional parameter.

func GetDigestFromPath

func GetDigestFromPath(r *http.Request) (string, error)

func GetExecutionIdFromPath

func GetExecutionIdFromPath(r *http.Request) (int64, error)

func GetExecutionNumberFromPath

func GetExecutionNumberFromPath(r *http.Request) (int64, error)

func GetFileDiffFromQuery

func GetFileDiffFromQuery(r *http.Request) (files gittypes.FileDiffRequests)

func GetFlattenDirectoriesFromQueryOrDefault

func GetFlattenDirectoriesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetGitProtocolFromHeadersOrDefault

func GetGitProtocolFromHeadersOrDefault(r *http.Request, deflt string) string

GetGitProtocolFromHeadersOrDefault returns the git protocol from the request headers.

func GetGitRefFromQueryOrDefault

func GetGitRefFromQueryOrDefault(r *http.Request, deflt string) string

func GetGitServiceTypeFromQuery

func GetGitServiceTypeFromQuery(r *http.Request) (enum.GitServiceType, error)

GetGitServiceTypeFromQuery returns the git service type from the request query.

func GetGitspaceRefFromPath

func GetGitspaceRefFromPath(r *http.Request) (string, error)

func GetHeader

func GetHeader(r *http.Request, headerName string) (string, bool)

GetHeader returns the value of the first non-empty header occurrence. If no value is found, `false` is returned.

func GetHeaderOrDefault

func GetHeaderOrDefault(r *http.Request, headerName string, dflt string) string

GetHeaderOrDefault returns the value of the first non-empty header occurrence. If no value is found, the default value is returned.

func GetIfNoneMatchFromHeader

func GetIfNoneMatchFromHeader(r *http.Request) (string, bool)

func GetIncludeChecksFromQueryOrDefault

func GetIncludeChecksFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetIncludeCommitFromQueryOrDefault

func GetIncludeCommitFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetIncludeCookieFromQueryOrDefault

func GetIncludeCookieFromQueryOrDefault(r *http.Request, dflt bool) (bool, error)

func GetIncludeDirectoriesFromQueryOrDefault

func GetIncludeDirectoriesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetIncludePullReqsFromQueryOrDefault

func GetIncludePullReqsFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetIncludeRulesFromQueryOrDefault

func GetIncludeRulesFromQueryOrDefault(r *http.Request, deflt bool) (bool, error)

func GetIncludeSubspacesFromQuery

func GetIncludeSubspacesFromQuery(r *http.Request) (bool, error)

func GetInfraProviderRefFromPath

func GetInfraProviderRefFromPath(r *http.Request) (string, error)

func GetLabelIDFromPath

func GetLabelIDFromPath(r *http.Request) (int64, error)

func GetLabelKeyFromPath

func GetLabelKeyFromPath(r *http.Request) (string, error)

func GetLabelValueFromPath

func GetLabelValueFromPath(r *http.Request) (string, error)

func GetLatestFromPath

func GetLatestFromPath(r *http.Request) bool

func GetMaxDivergenceFromQueryOrDefault

func GetMaxDivergenceFromQueryOrDefault(r *http.Request, deflt int64) (int64, error)

func GetOptionalRemainderFromPath

func GetOptionalRemainderFromPath(r *http.Request) string

GetOptionalRemainderFromPath returns the remainder ("*") from the path or an empty string if it doesn't exist.

func GetPipelineIdentifierFromPath

func GetPipelineIdentifierFromPath(r *http.Request) (string, error)

func GetPrincipalIDFromPath

func GetPrincipalIDFromPath(r *http.Request) (int64, error)

GetPrincipalIDFromPath returns the user id from the request path.

func GetPrincipalUIDFromPath

func GetPrincipalUIDFromPath(r *http.Request) (string, error)

func GetPublicKeyIdentifierFromPath

func GetPublicKeyIdentifierFromPath(r *http.Request) (string, error)

func GetPullReqCommentIDPath

func GetPullReqCommentIDPath(r *http.Request) (int64, error)

func GetPullReqNumberFromPath

func GetPullReqNumberFromPath(r *http.Request) (int64, error)

func GetPullReqSourceBranchFromPath

func GetPullReqSourceBranchFromPath(r *http.Request) (string, error)

func GetPullReqTargetBranchFromPath

func GetPullReqTargetBranchFromPath(r *http.Request) (string, error)

func GetReferenceFromPath

func GetReferenceFromPath(r *http.Request) (string, error)

func GetRemainderFromPath

func GetRemainderFromPath(r *http.Request) (string, error)

GetRemainderFromPath returns the remainder ("*") from the path or an error if it doesn't exist.

func GetRepoRefFromPath

func GetRepoRefFromPath(r *http.Request) (string, error)

func GetReviewerIDFromPath

func GetReviewerIDFromPath(r *http.Request) (int64, error)

func GetRuleIdentifierFromPath

func GetRuleIdentifierFromPath(r *http.Request) (string, error)

GetRuleIdentifierFromPath extracts the protection rule identifier from the URL.

func GetSecretRefFromPath

func GetSecretRefFromPath(r *http.Request) (string, error)

func GetServiceAccountUIDFromPath

func GetServiceAccountUIDFromPath(r *http.Request) (string, error)

func GetSourceRepoRefFromQueryOrDefault

func GetSourceRepoRefFromQueryOrDefault(r *http.Request, deflt string) string

func GetSpaceRefFromPath

func GetSpaceRefFromPath(r *http.Request) (string, error)

func GetStageIdFromPath

func GetStageIdFromPath(r *http.Request) (int64, error)

func GetStageNumberFromPath

func GetStageNumberFromPath(r *http.Request) (int64, error)

func GetStepNumberFromPath

func GetStepNumberFromPath(r *http.Request) (int64, error)

func GetTemplateRefFromPath

func GetTemplateRefFromPath(r *http.Request) (string, error)

func GetTemplateTypeFromPath

func GetTemplateTypeFromPath(r *http.Request) (string, error)

func GetTokenFromCookie

func GetTokenFromCookie(r *http.Request, cookieName string) (string, bool)

func GetTokenIdentifierFromPath

func GetTokenIdentifierFromPath(r *http.Request) (string, error)

func GetTriggerIdentifierFromPath

func GetTriggerIdentifierFromPath(r *http.Request) (string, error)

func GetUUIDFromPath

func GetUUIDFromPath(r *http.Request) (string, error)

func GetUserGroupIDFromPath

func GetUserGroupIDFromPath(r *http.Request) (int64, error)

func GetUserIDFromPath

func GetUserIDFromPath(r *http.Request) (int64, error)

GetUserIDFromPath returns the user id from the request path.

func GetUserUIDFromPath

func GetUserUIDFromPath(r *http.Request) (string, error)

func GetWebhookExecutionIDFromPath

func GetWebhookExecutionIDFromPath(r *http.Request) (int64, error)

func GetWebhookIdentifierFromPath

func GetWebhookIdentifierFromPath(r *http.Request) (string, error)

func ParseAdminStatisticsFilter

func ParseAdminStatisticsFilter(r *http.Request) (*types.RepositoryStatisticsFilter, error)

ParseAdminStatisticsFilter extracts the admin statistics filter from the url.

func ParseArchiveParams

func ParseArchiveParams(r *http.Request) (api.ArchiveParams, string, error)

func ParseArtifactFilter

func ParseArtifactFilter(r *http.Request) *types.ArtifactFilter

ParseArtifactFilter extracts the artifact filter from the url.

func ParseArtifactFormat

func ParseArtifactFormat(r *http.Request) string

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

func ParseAssignableFromQuery(r *http.Request) (bool, error)

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

func ParseBypassRulesFromQuery(r *http.Request) (bool, error)

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

func ParseDryRunRulesFromQuery(r *http.Request) (bool, error)

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

func ParseInheritedFromQuery(r *http.Request) (bool, error)

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

func ParseLimit(r *http.Request) int

ParseLimit extracts the limit parameter from the url.

func ParseLimit1000

func ParseLimit1000(r *http.Request) int

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

func ParseOrder(r *http.Request) enum.Order

ParseOrder extracts the order parameter from the url.

func ParsePage

func ParsePage(r *http.Request) int

ParsePage extracts the page 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

func ParseQuery(r *http.Request) string

ParseQuery extracts the query parameter from the url.

func ParseQueryAfterFromRequest

func ParseQueryAfterFromRequest(r *http.Request) int64

ParseQueryAfterFromRequest parses the query parameter "after" from the request.

func ParseRecursiveFromQuery

func ParseRecursiveFromQuery(r *http.Request) (bool, error)

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 ParseSort

func ParseSort(r *http.Request) string

ParseSort extracts the sort parameter 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

func ParseSortRepo(r *http.Request) enum.RepoAttr

ParseSortRepo extracts the repo sort parameter from the url.

func ParseSortSpace

func ParseSortSpace(r *http.Request) enum.SpaceAttr

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

func ParseSortUser(r *http.Request) enum.UserAttr

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 ParseStatisticsBeginTimeFromQuery

func ParseStatisticsBeginTimeFromQuery(r *http.Request) string

func ParseStatisticsBranchFromQuery

func ParseStatisticsBranchFromQuery(r *http.Request) string

func ParseStatisticsEndTimeFromQuery

func ParseStatisticsEndTimeFromQuery(r *http.Request) string

func ParseStatisticsIncludeCodeFromQuery

func ParseStatisticsIncludeCodeFromQuery(r *http.Request) (bool, error)

func ParseStatisticsIncludeMergeRequestFromQuery

func ParseStatisticsIncludeMergeRequestFromQuery(r *http.Request) (bool, error)

func ParseStatisticsIncludePushRequestFromQuery

func ParseStatisticsIncludePushRequestFromQuery(r *http.Request) (bool, error)

func ParseStatisticsIncludeReviewFromQuery

func ParseStatisticsIncludeReviewFromQuery(r *http.Request) (bool, error)

func ParseStatisticsPeriodFromQuery

func ParseStatisticsPeriodFromQuery(r *http.Request) string

func ParseStatisticsTopFromQuery

func ParseStatisticsTopFromQuery(r *http.Request) (int64, error)

func ParseStatisticsUserFromQuery

func ParseStatisticsUserFromQuery(r *http.Request) string

func ParseTagFilter

func ParseTagFilter(r *http.Request) *types.TagFilter

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 PathParam

func PathParam(r *http.Request, paramName string) (string, error)

PathParam retrieves the path parameter or returns false if it exists.

func PathParamAsPositiveInt64

func PathParamAsPositiveInt64(r *http.Request, paramName string) (int64, error)

PathParamAsPositiveInt64 extracts an integer parameter from the request path.

func PathParamOrEmpty

func PathParamOrEmpty(r *http.Request, paramName string) string

PathParamOrEmpty retrieves the path parameter or returns an empty string otherwise.

func PathParamOrError

func PathParamOrError(r *http.Request, paramName string) (string, error)

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

func PrincipalFrom(ctx context.Context) (*types.Principal, bool)

PrincipalFrom returns the principal of the authsession.

func QueryParam

func QueryParam(r *http.Request, paramName string) (string, bool)

QueryParam returns the parameter if it exists.

func QueryParamAsBoolOrDefault

func QueryParamAsBoolOrDefault(r *http.Request, paramName string, deflt bool) (bool, error)

QueryParamAsBoolOrDefault tries to retrieve the parameter from the query and parse it to bool.

func QueryParamAsPositiveInt64

func QueryParamAsPositiveInt64(r *http.Request, paramName string) (int64, bool, error)

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

func QueryParamAsPositiveInt64OrError(r *http.Request, paramName string) (int64, error)

QueryParamAsPositiveInt64OrError extracts an integer parameter from the request query. If the parameter doesn't exist an error is returned.

func QueryParamList

func QueryParamList(r *http.Request, paramName string) ([]string, bool)

QueryParamList returns list of the parameter values if they exist.

func QueryParamListAsPositiveInt64

func QueryParamListAsPositiveInt64(r *http.Request, paramName string) ([]int64, error)

QueryParamListAsPositiveInt64 extracts integer parameter slice from the request query.

func QueryParamOrDefault

func QueryParamOrDefault(r *http.Request, paramName string, deflt string) string

QueryParamOrDefault retrieves the parameter from the query and returns the parameter if it exists, otherwise returns the provided default value.

func QueryParamOrError

func QueryParamOrError(r *http.Request, paramName string) (string, error)

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

func RequestIDFrom(ctx context.Context) (string, bool)

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

func SpaceFrom(ctx context.Context) (*types.Space, bool)

SpaceFrom returns the value of the space key on the context - ok is true iff a non-nile value existed.

func UserFrom

func UserFrom(ctx context.Context) (*types.User, bool)

UserFrom returns the value of the user key on the context - ok is true iff a non-nile value existed.

func WithAuthSession

func WithAuthSession(parent context.Context, v *auth.Session) context.Context

WithAuthSession returns a copy of parent in which the principal value is set.

func WithRepo

func WithRepo(parent context.Context, v *types.Repository) context.Context

WithRepo returns a copy of parent in which the repo value is set.

func WithRequestID

func WithRequestID(parent context.Context, v string) context.Context

WithRequestID returns a copy of parent in which the request id value is set.

func WithServiceAccount

func WithServiceAccount(parent context.Context, v *types.ServiceAccount) context.Context

WithServiceAccount returns a copy of parent in which the service account value is set.

func WithSpace

func WithSpace(parent context.Context, v *types.Space) context.Context

WithSpace returns a copy of parent in which the space value is set.

func WithUser

func WithUser(parent context.Context, v *types.User) context.Context

WithUser returns a copy of parent in which the user value is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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