Documentation ¶
Index ¶
- Constants
- Variables
- func ElegantExit(h hook.Hook)
- func GetToken(c *gin.Context) (string, error)
- func JWTTokenStringFromContext(ctx context.Context) (string, error)
- func Response(ctx context.Context, resp *http.Response) string
- func SetUser(c *gin.Context, user user.User)
- func UnmarshalTraversalIDS(traversalIDs string) ([]uint, error)
- func UserContextKey() string
- func UserFromContext(ctx context.Context) (user.User, error)
- func WithContext(parent context.Context, user user.User) context.Context
- func WithContextJWTTokenString(ctx context.Context, tokenStr string) context.Context
- type Resource
Constants ¶
View Source
const ( ApplicationQueryName = "filter" ApplicationQueryByUser = "userID" ApplicationQueryByTemplate = "template" ApplicationQueryByRelease = "templateRelease" ApplicationQueryByGroup = "groupID" ApplicationQueryByGroupRecursive = "groupRecursive" ApplicationQueryID = "id" ApplicationQueryWithDeleted = "withDeleted" )
View Source
const ( ClusterQueryEnvironment = "environment" ClusterQueryName = "filter" ClusterQueryByUser = "userID" ClusterQueryByTemplate = "template" ClusterQueryByRelease = "templateRelease" ClusterQueryByRegion = "region" ClusterQueryTagSelector = "tagSelector" ClusterQueryMergePatch = "mergePatch" ClusterQueryTargetBranch = "targetBranch" ClusterQueryTargetCommit = "targetCommit" ClusterQueryTargetTag = "targetTag" ClusterQueryContainerName = "containerName" ClusterQueryPodName = "podName" ClusterQueryTailLines = "tailLines" ClusterQueryExtraOwner = "extraOwner" ClusterQueryHard = "hard" // ClusterQueryIsFavorite is used to query cluster with favorite for current user only. ClusterQueryIsFavorite = "isFavorite" // ClusterQueryWithFavorite is used to query cluster with favorite field inside. ClusterQueryWithFavorite = "withFavorite" ClusterQueryUpdatedAfter = "updatedAfter" ClusterQueryOnlyDeleted = "onlyDeleted" )
View Source
const ( ClusterClusterLabelKey = "cloudnative.music.netease.com/cluster" ClusterRestartTimeKey = "cloudnative.music.netease.com/user-restart-time" )
View Source
const ( ClusterStatusEmpty = "" ClusterStatusFreeing = "Freeing" ClusterStatusFreed = "Freed" ClusterStatusDeleting = "Deleting" ClusterStatusCreating = "Creating" )
status of cluster
View Source
const ( PageNumber = "pageNumber" PageSize = "pageSize" Filter = "filter" Template = "template" TemplateRelease = "templateRelease" TagSelector = "tagSelector" // Offset should be type int Offset = "offset" // Limit should be type int Limit = "limit" StartID = "startID" EndID = "endID" EventType = "eventType" WebhookID = "webhookID" CreatedAt = "createdAt" Enabled = "enabled" Orphaned = "orphaned" OrderBy = "orderBy" ReqID = "reqID" DefaultPageNumber = 1 DefaultPageSize = 20 MaxPageSize = 50 MaxItems = 100000 )
const variables
View Source
const ( MetaVersion2 = "0.0.2" ApplicationRepoDefaultEnv = "default" )
View Source
const ( // InternalError internal server error code InternalError = "InternalError" // InvalidRequestParam invalid request param error code InvalidRequestParam = "InvalidRequestParam" // InvalidRequestBody invalid request body error code InvalidRequestBody = "InvalidRequestBody" // NotImplemented not implemented error code NotImplemented = "NotImplemented" // RequestInfoError error to format the request RequestInfoError = "RequestInfoError" Unauthorized = "Unauthorized" // Forbidden 403 Forbidden error code Forbidden = "Forbidden" // CodeExpired 403 AccessToken and Authorization Token error code CodeExpired = "Expired" // NotFound 404 NotFound error code NotFound = "NotFound" )
View Source
const ( // ResourceApplication represent the application member entry. ResourceApplication = "applications" // ResourceCluster represent the application instance member entry ResourceCluster = "clusters" ResourceRegion = "regions" // ResourceGroup represent the group member entry. ResourceGroup = "groups" // ResourcePipelinerun currently pipelineruns do not have direct member info, will // use the pipeline's cluster's member info ResourcePipelinerun = "pipelineruns" // ResourceCheckrun currently checkruns do not have direct member info, will // use the member info of the clusters that they belong to ResourceCheckrun = "checkruns" // ResourceOauthApps currently oauthapp do not have direct member info, will // use the oauthapp's groups member info ResourceOauthApps = "oauthapps" ResourceTemplate = "templates" ResourceTemplateRelease = "templatereleases" AliasTemplateRelease = "releases" ResourceWebhook = "webhooks" ResourceWebhookLog = "webhooklogs" ResourceMember = "members" )
View Source
const ( ParamApplicationID = "applicationID" ParamGroupID = "groupID" ParamClusterID = "clusterID" ParamClusterName = "cluster" ParamTemplateID = "templateID" ParamReleaseID = "releaseID" ParamResourceType = "resourceType" ParamResourceID = "resourceID" ParamAccessTokenID = "accessTokenID" )
View Source
const ( GitlabGitops = "gitops" GitlabTemplate = "template" )
View Source
const ( CookieKeyAuth = "horizon|session" SessionKeyAuthUser = "user" )
View Source
const ( // fileName GitopsFileChart = "Chart.yaml" GitopsFileApplication = "application.yaml" GitopsFileTags = "tags.yaml" GitopsFileSRE = "sre/sre.yaml" GitopsFileBase = "system/horizon.yaml" GitopsFileEnv = "system/env.yaml" GitopsFileRestart = "system/restart.yaml" GitopsFilePipeline = "pipeline/pipeline.yaml" GitopsFilePipelineOutput = "pipeline/pipeline-output.yaml" GitopsFileManifest = "manifest.yaml" // value namespace GitopsEnvValueNamespace = "env" GitopsBaseValueNamespace = "horizon" GitopsMergeRequestStateOpen = "opened" GitopsGroupClusters = "clusters" GitopsGroupRecyclingClusters = "recycling-clusters" GitopsKeyTags = "tags" )
View Source
const ( PipelineQueryByStatus = "status" MessageQueryBySystem = "system" MessagePipelinerunStopped = "stopped pipelinerun" MessagePipelinerunExecuted = "executed pipelinerun" MessagePipelinerunCancelled = "cancelled pipelinerun" MessagePipelinerunReady = "marked pipelinerun as ready to execute" )
View Source
const ( URLOauthAuthorization = "/login/oauth/authorize" URLLoginCallback = "/apis/core/v1/login/callback" )
View Source
const ( TemplateQueryWithoutCI = "withoutCI" TemplateQueryByUser = "userID" TemplateQueryByGroup = "groupID" TemplateQueryByGroupRecursive = "groupIDRecursive" TemplateQueryByGroups = "templateGroupIDs" TemplateQueryWithRelease = "withRelease" TemplateQueryName = "filter" TemplateQueryType = "type" )
View Source
const ( UserQueryName = "filter" UserQueryType = "userType" UserQueryID = "id" )
View Source
const ( AuthorizationHeaderKey = "Authorization" TokenHeaderValuePrefix = "Bearer" )
View Source
const (
ChartVersionFormat = "%s-%s"
)
View Source
const (
GroupCore = "core"
)
View Source
const (
// IDThan query parameter, used for "id > IDThan"
IDThan = "idThan"
)
View Source
const (
TektonTriggersEventIDKey = triggers.GroupName + triggers.EventIDLabelKey
)
View Source
const (
URLFrontLogin = "/user/login"
)
Variables ¶
View Source
var ContextAuthRecord = "authRecord"
Functions ¶
func ElegantExit ¶
func UnmarshalTraversalIDS ¶
func UserContextKey ¶
func UserContextKey() string
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.