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 Artifact
- type ArtifactMetadata
- type Credentials
- type ErrorMeta
- type ErrorResponse
- type Permissions
- type ReadPermission
- type Task
- 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 ArtifactMetadata ¶ added in v0.18.0
type ArtifactMetadata struct {
Account string `json:"account,omitempty"`
}
type Credentials ¶ added in v0.18.0
type Credentials 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 TaskResultObject ¶
type TaskResultObject struct { BoundArtifacts []Artifact `json:"boundArtifacts"` CreatedArtifacts []Artifact `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"` }
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
Click to show internal directories.
Click to hide internal directories.