request

package
v0.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParamAccessToken   = "access_token"
	QueryParamIncludeCookie = "include_cookie"
)
View Source
const (
	PathParamTenantUID      = "tenant_uid"
	PathParamProjectUID     = "project_uid"
	PathParamEnvironmentUID = "environment_uid"
	PathParamSourceUID      = "source_uid"
	PathParamApplicationUID = "application_uid"
	PathParamDeploymentUID  = "deployment_uid"
	PathParamDeploymentStep = "deployment_step"
	PathParamVolumeUID      = "volume_uid"
	PathParamAuthProvider   = "auth_provider"
	PathParamVariableUID    = "variable_uid"
	PathParamTemplateID     = "template_id"
)
View Source
const (
	HeaderAuthorization = "Authorization"
)

Variables

This section is empty.

Functions

func ApplicationFrom

func ApplicationFrom(ctx context.Context) (*types.Application, bool)

ApplicationFrom function  returns the value of the application

func AuthSessionFrom

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

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

func AuthSettingFrom

func AuthSettingFrom(ctx context.Context) (*types.AuthSetting, bool)

AuthSettingFrom returns the value of the authsetting

func CurrentFullUrlFrom

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

CurrentFullUrlFrom function  returns the value of current request url on the context

func DeploymentFrom

func DeploymentFrom(ctx context.Context) (*types.Deployment, bool)

DeploymentFrom function  returns the value of the deployment

func EnvironmentFrom

func EnvironmentFrom(ctx context.Context) (*types.Environment, bool)

EnvironmentFrom function  returns the value of the environment

func GetAccessTokenFromQuery

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

func GetApplicationUIDFromPath

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

func GetAuthProviderFromPath

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

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 GetDeploymentStepFromPath

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

func GetDeploymentUIDFromPath

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

func GetEnvironmentUIDFromPath

func GetEnvironmentUIDFromPath(r *http.Request) (int64, 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 GetIncludeCookieFromQueryOrDefault

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

func GetProjectUIDFromPath

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

func GetSourceUIDFromPath

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

func GetTemplateIDFromPath

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

func GetTenantUIDFromPath

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

func GetTokenFromCookie

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

func GetVariableUIDFromPath

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

func GetVolumeUIDFromPath

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

func GithubAppFrom

func GithubAppFrom(ctx context.Context) (*types.GithubApp, bool)

GithubAppFrom function  returns the value of the github app

func HostDomainUrlFrom

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

HostDomainUrlFrom function  returns the value of host url on the context

func HxCallerUrlFrom

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

HxCallerUrlFrom function  returns the value of hx prev url key on the context

func HxIndicatorFrom

func HxIndicatorFrom(ctx context.Context) bool

HxIndicatorFrom function  returns the value of hx indicator key on the context

func InstanceSettingsFrom

func InstanceSettingsFrom(ctx context.Context) (*types.Instance, bool)

InstanceSettingsFrom function  returns the value of instance

func IsAuthenticated

func IsAuthenticated(ctx context.Context) bool

func IsProjectContributor

func IsProjectContributor(ctx context.Context) bool

func IsProjectOwner

func IsProjectOwner(ctx context.Context) bool

func IsProjectViewer

func IsProjectViewer(ctx context.Context) bool

func IsSuperAdmin

func IsSuperAdmin(ctx context.Context) bool

func IsTeamAdmin

func IsTeamAdmin(ctx context.Context) bool

func PathParam

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

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 ProjectFrom

func ProjectFrom(ctx context.Context) (*types.Project, bool)

ProjectFrom function  returns the value of the project

func ProjectMembershipFrom

func ProjectMembershipFrom(ctx context.Context) (*types.ProjectMembership, bool)

ProjectMembershipFrom function  returns the value of the project membership

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 ReplacePrefix

func ReplacePrefix(r *http.Request, oldPrefix string, newPrefix string) error

ReplacePrefix replaces the path of the request. IMPORTANT:

  • both prefix are unescaped for path, and used as is for RawPath!
  • only called by top level handler!!

func TargetElementFrom

func TargetElementFrom(ctx context.Context) string

TargetElementFrom function  returns the value of target element

func TenantFrom

func TenantFrom(ctx context.Context) (*types.Tenant, bool)

TenantFrom function  returns the value of the tenant

func TenantMembershipFrom

func TenantMembershipFrom(ctx context.Context) (*types.TenantMembership, bool)

TenantMembershipFrom function  returns the value of the tenant membership

func VolumeFrom

func VolumeFrom(ctx context.Context) (*types.Volume, bool)

VolumeFrom function  returns the value of the volume

func WithApplication

func WithApplication(parent context.Context, c *types.Application) context.Context

WithApplication function  returns a copy of parent in which the application

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 WithAuthSetting

func WithAuthSetting(parent context.Context, c *types.AuthSetting) context.Context

WithAuthSetting function returns a copy of parent in which the authsetting

func WithCurrentFullUrl

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

WithCurrentFullUrl function  returns a copy of parent in which the current url value is set

func WithDeployment

func WithDeployment(parent context.Context, d *types.Deployment) context.Context

WithDeployment function  returns a copy of parent in which the deployment

func WithEnvironment

func WithEnvironment(parent context.Context, e *types.Environment) context.Context

WithEnvironment function  returns a copy of parent in which the environment

func WithGithubApp

func WithGithubApp(parent context.Context, ghApp *types.GithubApp) context.Context

WithGithubApp function  returns a copy of parent in which the github app

func WithHostDomainUrl

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

WithHostDomainUrl function  returns a copy of parent in which the host url value is set

func WithHxCallerUrl

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

WithHxCallerUrl function  returns a copy of parent in which the previous url value is set

func WithHxIndicator

func WithHxIndicator(parent context.Context, v bool) context.Context

WithHxIndicator function  returns a copy of parent in which the hx indicator value is set

func WithInstanceSettings

func WithInstanceSettings(parent context.Context, v *types.Instance) context.Context

WithInstanceSettings function  returns a copy of parent in which the instance

func WithProject

func WithProject(parent context.Context, p *types.Project) context.Context

WithProject function  returns a copy of parent in which the project

func WithProjectMembership

func WithProjectMembership(parent context.Context, p *types.ProjectMembership) context.Context

WithProjectMembership function  returns a copy of parent in which the project membership

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 WithTargetElement

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

WithTargetElement function  returns a copy of parent in which the target element

func WithTenant

func WithTenant(parent context.Context, t *types.Tenant) context.Context

WithTenant function  returns a copy of parent in which the tenant

func WithTenantMembership

func WithTenantMembership(parent context.Context, t *types.TenantMembership) context.Context

WithTenantMembership function  returns a copy of parent in which the tenant membership

func WithVolume

func WithVolume(parent context.Context, c *types.Volume) context.Context

WithVolume function  returns a copy of parent in which the volume

Types

This section is empty.

Jump to

Keyboard shortcuts

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