Documentation
¶
Index ¶
- Constants
- func ApplicationFrom(ctx context.Context) (*types.Application, bool)
- func AuthSessionFrom(ctx context.Context) (*auth.Session, bool)
- func AuthSettingFrom(ctx context.Context) (*types.AuthSetting, bool)
- func CurrentFullUrlFrom(ctx context.Context) (string, bool)
- func DeploymentFrom(ctx context.Context) (*types.Deployment, bool)
- func EnvironmentFrom(ctx context.Context) (*types.Environment, bool)
- func GetAccessTokenFromQuery(r *http.Request) (string, bool)
- func GetApplicationUIDFromPath(r *http.Request) (int64, error)
- func GetAuthProviderFromPath(r *http.Request) (string, error)
- func GetCookie(r *http.Request, cookieName string) (string, bool)
- func GetDeploymentStepFromPath(r *http.Request) (string, error)
- func GetDeploymentUIDFromPath(r *http.Request) (int64, error)
- func GetEnvironmentUIDFromPath(r *http.Request) (int64, error)
- func GetHeader(r *http.Request, headerName string) (string, bool)
- func GetHeaderOrDefault(r *http.Request, headerName string, dflt string) string
- func GetIncludeCookieFromQueryOrDefault(r *http.Request, dflt bool) (bool, error)
- func GetProjectUIDFromPath(r *http.Request) (int64, error)
- func GetSourceUIDFromPath(r *http.Request) (int64, error)
- func GetTemplateIDFromPath(r *http.Request) (int64, error)
- func GetTenantUIDFromPath(r *http.Request) (int64, error)
- func GetTokenFromCookie(r *http.Request, cookieName string) (string, bool)
- func GetVariableUIDFromPath(r *http.Request) (int64, error)
- func GetVolumeUIDFromPath(r *http.Request) (int64, error)
- func GithubAppFrom(ctx context.Context) (*types.GithubApp, bool)
- func HostDomainUrlFrom(ctx context.Context) (string, bool)
- func HxCallerUrlFrom(ctx context.Context) (string, bool)
- func HxIndicatorFrom(ctx context.Context) bool
- func InstanceSettingsFrom(ctx context.Context) (*types.Instance, bool)
- func IsAuthenticated(ctx context.Context) bool
- func IsProjectContributor(ctx context.Context) bool
- func IsProjectOwner(ctx context.Context) bool
- func IsProjectViewer(ctx context.Context) bool
- func IsSuperAdmin(ctx context.Context) bool
- func IsTeamAdmin(ctx context.Context) bool
- func PathParam(r *http.Request, paramName string) (string, bool)
- 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 ProjectFrom(ctx context.Context) (*types.Project, bool)
- func ProjectMembershipFrom(ctx context.Context) (*types.ProjectMembership, 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 ReplacePrefix(r *http.Request, oldPrefix string, newPrefix string) error
- func TargetElementFrom(ctx context.Context) string
- func TenantFrom(ctx context.Context) (*types.Tenant, bool)
- func TenantMembershipFrom(ctx context.Context) (*types.TenantMembership, bool)
- func VolumeFrom(ctx context.Context) (*types.Volume, bool)
- func WithApplication(parent context.Context, c *types.Application) context.Context
- func WithAuthSession(parent context.Context, v *auth.Session) context.Context
- func WithAuthSetting(parent context.Context, c *types.AuthSetting) context.Context
- func WithCurrentFullUrl(parent context.Context, v string) context.Context
- func WithDeployment(parent context.Context, d *types.Deployment) context.Context
- func WithEnvironment(parent context.Context, e *types.Environment) context.Context
- func WithGithubApp(parent context.Context, ghApp *types.GithubApp) context.Context
- func WithHostDomainUrl(parent context.Context, v string) context.Context
- func WithHxCallerUrl(parent context.Context, v string) context.Context
- func WithHxIndicator(parent context.Context, v bool) context.Context
- func WithInstanceSettings(parent context.Context, v *types.Instance) context.Context
- func WithProject(parent context.Context, p *types.Project) context.Context
- func WithProjectMembership(parent context.Context, p *types.ProjectMembership) context.Context
- func WithRequestID(parent context.Context, v string) context.Context
- func WithTargetElement(parent context.Context, v string) context.Context
- func WithTenant(parent context.Context, t *types.Tenant) context.Context
- func WithTenantMembership(parent context.Context, t *types.TenantMembership) context.Context
- func WithVolume(parent context.Context, c *types.Volume) context.Context
Constants ¶
const ( QueryParamAccessToken = "access_token" QueryParamIncludeCookie = "include_cookie" )
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" )
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 ¶
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 ¶
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 GetCookie ¶
GetCookie tries to retrieve the cookie from the request or returns false if it doesn't exist.
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 GetTokenFromCookie ¶
func GithubAppFrom ¶
GithubAppFrom function returns the value of the github app
func HostDomainUrlFrom ¶
HostDomainUrlFrom function returns the value of host url on the context
func HxCallerUrlFrom ¶
HxCallerUrlFrom function returns the value of hx prev url key on the context
func HxIndicatorFrom ¶
HxIndicatorFrom function returns the value of hx indicator key on the context
func InstanceSettingsFrom ¶
InstanceSettingsFrom function returns the value of instance
func IsAuthenticated ¶
func IsProjectContributor ¶
func IsProjectOwner ¶
func IsProjectViewer ¶
func IsSuperAdmin ¶
func IsTeamAdmin ¶
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 ProjectFrom ¶
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 ¶
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 ReplacePrefix ¶
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 ¶
TargetElementFrom function returns the value of target element
func TenantFrom ¶
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 ¶
VolumeFrom function returns the value of the volume
func WithApplication ¶
WithApplication function returns a copy of parent in which the application
func WithAuthSession ¶
WithAuthSession returns a copy of parent in which the principal value is set.
func WithAuthSetting ¶
WithAuthSetting function returns a copy of parent in which the authsetting
func WithCurrentFullUrl ¶
WithCurrentFullUrl function returns a copy of parent in which the current url value is set
func WithDeployment ¶
WithDeployment function returns a copy of parent in which the deployment
func WithEnvironment ¶
WithEnvironment function returns a copy of parent in which the environment
func WithGithubApp ¶
WithGithubApp function returns a copy of parent in which the github app
func WithHostDomainUrl ¶
WithHostDomainUrl function returns a copy of parent in which the host url value is set
func WithHxCallerUrl ¶
WithHxCallerUrl function returns a copy of parent in which the previous url value is set
func WithHxIndicator ¶
WithHxIndicator function returns a copy of parent in which the hx indicator value is set
func WithInstanceSettings ¶
WithInstanceSettings function returns a copy of parent in which the instance
func WithProject ¶
WithProject function returns a copy of parent in which the project
func WithProjectMembership ¶
WithProjectMembership function returns a copy of parent in which the project membership
func WithRequestID ¶
WithRequestID returns a copy of parent in which the request id value is set.
func WithTargetElement ¶
WithTargetElement function returns a copy of parent in which the target element
func WithTenant ¶
WithTenant function returns a copy of parent in which the tenant
func WithTenantMembership ¶
WithTenantMembership function returns a copy of parent in which the tenant membership
Types ¶
This section is empty.