| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package types
- type APIVerb string
- const (
- APIVerbGet APIVerb = "get"
- APIVerbCreate APIVerb = "create"
- APIVerbList APIVerb = "list"
- APIVerbUpdate APIVerb = "update"
- APIVerbDelete APIVerb = "delete"
- )
- type APIVerbGroup []APIVerb
- func ReadVerbGroup() APIVerbGroup {
- return []APIVerb{APIVerbGet, APIVerbList}
- }
- func ReadWriteVerbGroup() APIVerbGroup {
- return []APIVerb{APIVerbGet, APIVerbList, APIVerbCreate, APIVerbUpdate, APIVerbDelete}
- }
- type HTTPVerb string
- const (
- HTTPVerbGet HTTPVerb = "GET"
- HTTPVerbPost HTTPVerb = "POST"
- HTTPVerbPut HTTPVerb = "PUT"
- HTTPVerbPatch HTTPVerb = "PUT"
- HTTPVerbDelete HTTPVerb = "DELETE"
- )
- type URLParam string
- const (
- URLParamProjectID URLParam = "project_id"
- URLParamClusterID URLParam = "cluster_id"
- URLParamRegistryID URLParam = "registry_id"
- URLParamHelmRepoID URLParam = "helm_repo_id"
- URLParamGitInstallationID URLParam = "git_installation_id"
- URLParamInfraID URLParam = "infra_id"
- URLParamOperationID URLParam = "operation_id"
- URLParamInviteID URLParam = "invite_id"
- URLParamNamespace URLParam = "namespace"
- URLParamReleaseName URLParam = "name"
- URLParamReleaseVersion URLParam = "version"
- URLParamWildcard URLParam = "*"
- )
- type Path struct {
- Parent *Path
- RelativePath string
- }
- type APIRequestMetadata struct {
- Verb APIVerb
- Method HTTPVerb
- Path *Path
- Scopes []PermissionScope
- ShouldRedirect bool
- // Whether the endpoint should log
- Quiet bool
- // Whether the endpoint upgrades to a websocket
- IsWebsocket bool
- // Whether the endpoint should check for a usage limit
- CheckUsage bool
- // The usage metric that the request should check for, if CheckUsage
- UsageMetric UsageMetric
- }
- const RequestScopeCtxKey = "requestscopes"
- type RequestAction struct {
- Verb APIVerb
- Resource NameOrUInt
- }
- var RequestCtxWebsocketKey = "websocket"
|