Documentation ¶
Index ¶
- Constants
- func Error(c *gin.Context, status int, err error)
- func Log(err error, meta ...ErrorMeta)
- func TaskIDFromContext(c *gin.Context) string
- type Credential
- type ErrorMeta
- type ErrorResponse
- type Permissions
- type ReadPermission
- type Task
- type TaskCreatedArtifact
- type TaskCreatedArtifactMetadata
- type TaskResultObject
- type TaskStatus
- type WritePermission
Constants ¶
View Source
const ( TaskIDKey = `TaskID` TaskTypeCleanup = `cleanup` TaskTypeDelete = `delete` TaskTypeNoOp = `noop` )
Variables ¶
This section is empty.
Functions ¶
func Log ¶
Log logs a given error. It checks if meta was passed in. If no meta was passed in, it defines the meta as the function and line number of what called the Log func.
func TaskIDFromContext ¶
Types ¶
type Credential ¶
type Credential struct { AccountType string `json:"accountType"` CacheThreads int `json:"cacheThreads"` ChallengeDestructiveActions bool `json:"challengeDestructiveActions"` CloudProvider string `json:"cloudProvider"` DockerRegistries []interface{} `json:"dockerRegistries"` Enabled bool `json:"enabled"` Environment string `json:"environment"` Name string `json:"name"` Namespaces []string `json:"namespaces"` Permissions struct { READ []string `json:"READ"` WRITE []string `json:"WRITE"` } `json:"permissions"` PrimaryAccount bool `json:"primaryAccount"` ProviderVersion string `json:"providerVersion"` RequiredGroupMembership []interface{} `json:"requiredGroupMembership"` Skin string `json:"skin"` SpinnakerKindMap map[string]string `json:"spinnakerKindMap"` Type string `json:"type"` }
type ErrorResponse ¶
type ErrorResponse struct { Error string `json:"error"` Message string `json:"message"` Status int `json:"status"` Timestamp int64 `json:"timestamp"` }
This represents a clouddriver error.
func NewError ¶
func NewError(err, message string, status int) ErrorResponse
Example.
{ "error":"Forbidden", "message":"Access denied to account spin-cluster-account - required authorization: READ", "status":403, "timestamp":1597608027851 }
type Permissions ¶
type ReadPermission ¶
type ReadPermission struct { ID string `json:"-" gorm:"primary_key"` AccountName string `json:"accountName"` ReadGroup string `json:"readGroup"` }
func (ReadPermission) TableName ¶
func (ReadPermission) TableName() string
type Task ¶
type Task struct { ID string `json:"id"` // SagaIds []interface{} `json:"sagaIds"` // History []struct { // Phase string `json:"phase"` // Status string `json:"status"` // } `json:"history"` // OwnerIDClouddriverSQL string `json:"ownerId$clouddriver_sql"` // RequestIDClouddriverSQL string `json:"requestId$clouddriver_sql"` // Retryable bool `json:"retryable"` // StartTimeMsClouddriverSQL int64 `json:"startTimeMs$clouddriver_sql"` ResultObjects []TaskResultObject `json:"resultObjects"` Status TaskStatus `json:"status"` }
func NewDefaultTask ¶
type TaskCreatedArtifact ¶
type TaskCreatedArtifactMetadata ¶
type TaskCreatedArtifactMetadata struct {
Account string `json:"account"`
}
type TaskResultObject ¶
type TaskResultObject struct { BoundArtifacts []TaskCreatedArtifact `json:"boundArtifacts"` CreatedArtifacts []TaskCreatedArtifact `json:"createdArtifacts"` DeployedNamesByLocation map[string][]string `json:"deployedNamesByLocation"` ManifestNamesByNamespace map[string][]string `json:"manifestNamesByNamespace"` ManifestNamesByNamespaceToRefresh map[string][]string `json:"manifestNamesByNamespaceToRefresh"` Manifests []map[string]interface{} `json:"manifests"` }
Refactor bound artifact to it's own type or make genric type for both BoundArtifacts and CreatedArtifacts
type TaskStatus ¶
type WritePermission ¶
type WritePermission struct { ID string `json:"-" gorm:"primary_key"` AccountName string `json:"accountName"` WriteGroup string `json:"writeGroup"` }
func (WritePermission) TableName ¶
func (WritePermission) TableName() string
Directories ¶
Path | Synopsis |
---|---|
arcadefakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
artifactfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fiatfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
helmfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
cached/disk/diskfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
kubernetesfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
sqlfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Click to show internal directories.
Click to hide internal directories.