bcode

package
v1.2.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAddonNotExist addon registry not exist
	ErrAddonNotExist = NewBcode(404, 50001, "addon not exist")

	// ErrAddonRegistryExist addon registry already exist
	ErrAddonRegistryExist = NewBcode(400, 50002, "addon registry already exists")

	// ErrAddonRegistryInvalid addon registry is exist
	ErrAddonRegistryInvalid = NewBcode(400, 50003, "addon registry invalid")

	// ErrAddonRegistryRateLimit addon registry is rate limited by Github
	ErrAddonRegistryRateLimit = NewBcode(400, 50004, "Exceed Github rate limit")

	// ErrAddonRegistryNotExist addon registry doesn't exist
	ErrAddonRegistryNotExist = NewBcode(400, 50006, "addon registry doesn't exist")

	// ErrAddonRender fail to render addon application
	ErrAddonRender = NewBcode(500, 50010, "addon render fail")

	// ErrAddonApply fail to apply application to cluster
	ErrAddonApply = NewBcode(500, 50011, "fail to apply addon resources")

	// ErrReadGit fail to get addon application
	ErrReadGit = NewBcode(500, 50012, "fail to read git repo")

	// ErrGetAddonApplication fail to get addon application
	ErrGetAddonApplication = NewBcode(500, 50013, "fail to get addon application")

	// ErrAddonIsEnabled means addon has been enabled
	ErrAddonIsEnabled = NewBcode(500, 50014, "addon has been enabled")

	// ErrAddonSecretApply means fail to apply addon argument secret
	ErrAddonSecretApply = NewBcode(500, 50015, "fail to apply addon argument secret")

	// ErrAddonSecretGet means fail to get addon argument secret
	ErrAddonSecretGet = NewBcode(500, 50016, "fail to get addon argument secret")

	// ErrAddonDependencyNotSatisfy means addon's dependencies is not enabled
	ErrAddonDependencyNotSatisfy = NewBcode(500, 50017, "addon's dependencies is not enabled")
)
View Source
var ErrApplicationComponetExist = NewBcode(400, 10007, "application component is exist")

ErrApplicationComponetExist application component is exist

View Source
var ErrApplicationComponetNotExist = NewBcode(404, 10008, "application component is not exist")

ErrApplicationComponetNotExist application component is not exist

View Source
var ErrApplicationConfig = NewBcode(400, 10000, "application config does not comply with OAM specification")

ErrApplicationConfig application config does not comply with OAM specification

View Source
var ErrApplicationEnvExist = NewBcode(400, 10014, "application env is exist")

ErrApplicationEnvExist application env is exist

View Source
var ErrApplicationEnvRefusedDelete = NewBcode(400, 10020, "The application envbinding cannot be deleted because it has been deployed")

ErrApplicationEnvRefusedDelete The application env cannot be deleted because it has been deployed

View Source
var ErrApplicationExist = NewBcode(400, 10002, "application name is exist")

ErrApplicationExist application is exist

View Source
var ErrApplicationNoReadyRevision = NewBcode(400, 10017, "application not have ready revision")

ErrApplicationNoReadyRevision application not have ready revision

View Source
var ErrApplicationNotEnv = NewBcode(404, 10013, "application not set env binding")

ErrApplicationNotEnv no env binding policy

View Source
var ErrApplicationNotExist = NewBcode(404, 10012, "application name is not exist")

ErrApplicationNotExist application is not exist

View Source
var ErrApplicationPolicyExist = NewBcode(400, 10009, "application policy is exist")

ErrApplicationPolicyExist application policy is exist

View Source
var ErrApplicationPolicyNotExist = NewBcode(404, 10010, "application policy is not exist")

ErrApplicationPolicyNotExist application policy is not exist

View Source
var ErrApplicationRefusedDelete = NewBcode(400, 10019, "The application cannot be deleted because it has been deployed")

ErrApplicationRefusedDelete The application cannot be deleted because it has been deployed

View Source
var ErrApplicationRevisionNotExist = NewBcode(404, 10018, "application revision is not exist")

ErrApplicationRevisionNotExist application revision is not exist

View Source
var ErrBootstrapTerraformConfiguration = NewBcode(500, 40012, "failed to bootstrap terraform configuration")

ErrBootstrapTerraformConfiguration failed to bootstrap terraform configuration

View Source
var ErrCloudClusterAlreadyExists = NewBcode(400, 40009, "cloud cluster already exists")

ErrCloudClusterAlreadyExists cloud cluster already exists

View Source
var ErrClusterAlreadyExistInDataStore = NewBcode(400, 40004, "cluster already exists in data store")

ErrClusterAlreadyExistInDataStore cluster exists in datastore

View Source
var ErrClusterCreateNamespaceNoPermission = NewBcode(401, 40014, "no permission to create namespace in cluster")

ErrClusterCreateNamespaceNoPermission cluster create namespace is forbidden

View Source
var ErrClusterExistsInKubernetes = NewBcode(400, 40006, "cluster already exists in kubernetes")

ErrClusterExistsInKubernetes cluster exists in kubernetes

View Source
var ErrClusterIDNotFoundInTerraformConfiguration = NewBcode(500, 40011, "cannot find cluster_id in terraform configuration")

ErrClusterIDNotFoundInTerraformConfiguration cannot find cluster_id in terraform configuration

View Source
var ErrClusterNotFoundInDataStore = NewBcode(404, 40003, "cluster not found in data store")

ErrClusterNotFoundInDataStore cluster not found in datastore

View Source
var ErrComponentTypeNotSupport = NewBcode(400, 10001, "An unsupported component type was used.")

ErrComponentTypeNotSupport an unsupported component type was used.

View Source
var ErrCreateNamespace = NewBcode(500, 10011, "auto create namespace failure")

ErrCreateNamespace auto create namespace failure before deploy app

View Source
var ErrDefinitionNoSchema = NewBcode(400, 70002, "definition not have schema")

ErrDefinitionNoSchema definition not have schema

View Source
var ErrDefinitionNotFound = NewBcode(404, 70001, "definition is not exist")

ErrDefinitionNotFound definition is not exist

View Source
var ErrDefinitionTypeNotSupport = NewBcode(400, 70003, "definition type not support")

ErrDefinitionTypeNotSupport definition type not support

View Source
var ErrDeliveryTargetExist = NewBcode(400, 80001, "deliveryTarget is exist")

ErrDeliveryTargetExist deliveryTarget is exist

View Source
var ErrDeliveryTargetInUseCantDeleted = NewBcode(404, 80003, "deliveryTarget in use, can't be deleted")

ErrDeliveryTargetInUseCantDeleted deliveryTarget being used

View Source
var ErrDeliveryTargetNotExist = NewBcode(404, 80002, "deliveryTarget is not exist")

ErrDeliveryTargetNotExist deliveryTarget is not exist

View Source
var ErrDeployApplyFail = NewBcode(500, 10005, "application deploy apply failure")

ErrDeployApplyFail Failed to update an application to the control cluster.

View Source
var ErrDeployConflict = NewBcode(400, 10004, "application deploy conflict")

ErrDeployConflict Occurs when a new event is triggered before the last deployment event has completed.

View Source
var ErrEnvBindingExist = NewBcode(400, 90005, "application envbinding is exist")

ErrEnvBindingExist application envbinding is exist

View Source
var ErrEnvBindingNotExist = NewBcode(400, 90003, "application envbinding not exist")

ErrEnvBindingNotExist application envbinding is not exist

View Source
var ErrEnvBindingUpdateWorkflow = NewBcode(400, 90006, "application envbinding update workflow error")

ErrEnvBindingUpdateWorkflow application envbinding update workflow error

View Source
var ErrEnvBindingsNotExist = NewBcode(400, 90004, "application envbinding is not exist")

ErrEnvBindingsNotExist application envbindings is not exist

View Source
var ErrEnvbindingDeliveryTargetNotAllExist = NewBcode(400, 90001, "application envbinding deliveryTarget is not all exist")

ErrEnvbindingDeliveryTargetNotAllExist application envbinding deliveryTarget is not exist

View Source
var ErrFoundEnvbindingDeliveryTarget = NewBcode(400, 90002, "found application envbinding deliveryTarget failure")

ErrFoundEnvbindingDeliveryTarget found application envbinding deliveryTarget failure

View Source
var ErrGetCloudClusterFailure = NewBcode(500, 40005, "get cloud cluster information failed")

ErrGetCloudClusterFailure get cloud cluster failed

View Source
var ErrInvalidAccessKeyOrSecretKey = NewBcode(400, 40013, "access key or secret key is invalid")

ErrInvalidAccessKeyOrSecretKey access key or secret key is invalid

View Source
var ErrInvalidCloudClusterProvider = NewBcode(400, 40000, "provider is not support")

ErrInvalidCloudClusterProvider provider is not support now

View Source
var ErrInvalidDefinitionUISchema = NewBcode(400, 70004, "invalid custom defnition ui schema")

ErrInvalidDefinitionUISchema invalid custom definition ui schema

View Source
var ErrInvalidProperties = NewBcode(400, 10003, "properties is invalid")

ErrInvalidProperties properties(trait or component or others) is invalid

View Source
var ErrKubeConfigAndSecretIsNotSet = NewBcode(400, 40002, "kubeConfig or kubeConfig secret must be provided")

ErrKubeConfigAndSecretIsNotSet kubeConfig and kubeConfigSecret are not set

View Source
var ErrKubeConfigSecretNotSupport = NewBcode(400, 40001, "kubeConfig secret is not supported now")

ErrKubeConfigSecretNotSupport kubeConfig secret is not support

View Source
var ErrLocalClusterImmutable = NewBcode(400, 40008, "local cluster is immutable")

ErrLocalClusterImmutable local cluster kubeConfig is immutable

View Source
var ErrLocalClusterReserved = NewBcode(400, 40007, "local cluster is reserved")

ErrLocalClusterReserved cluster name reserved for local

View Source
var ErrMustQueryByApp = NewBcode(404, 20005, "you can only query the Workflow list based on applications.")

ErrMustQueryByApp you can only query the Workflow list based on applications.

View Source
var ErrNamespaceIsExist = NewBcode(400, 30002, "namespace name is exist")

ErrNamespaceIsExist namespace name is exist

View Source
var ErrNamespaceQuery = NewBcode(500, 30001, "query namespace list from cluster failure")

ErrNamespaceQuery query namespace failure from k8s api

View Source
var ErrNoComponent = NewBcode(200, 10006, "application not have components, can not deploy")

ErrNoComponent no component

View Source
var ErrParseQuery2Json = NewBcode(400, 60003, "fail to parse query result to json format")

ErrParseQuery2Json failed to parse query result to response

View Source
var ErrParseVelaQL = NewBcode(400, 60001, "fail to parse the velaQL")

ErrParseVelaQL failed to parse velaQL

View Source
var ErrServer = NewBcode(500, 500, "The service has lapsed.")

ErrServer an unexpected mistake.

View Source
var ErrTerraformConfigurationNotFound = NewBcode(404, 40010, "cannot find terraform configuration")

ErrTerraformConfigurationNotFound cannot find terraform configuration

View Source
var ErrTraitAlreadyExist = NewBcode(400, 10016, "trait is already exist")

ErrTraitAlreadyExist trait is already exist

View Source
var ErrTraitNotExist = NewBcode(400, 10015, "trait is not exist")

ErrTraitNotExist trait is not exist

View Source
var ErrViewQuery = NewBcode(400, 60002, "view query failed")

ErrViewQuery failed to query view

View Source
var ErrWorkflowExist = NewBcode(404, 20003, "application workflow is exist")

ErrWorkflowExist application workflow is exist

View Source
var ErrWorkflowNoDefault = NewBcode(404, 20004, "application default workflow is not exist")

ErrWorkflowNoDefault application default workflow is not exist

View Source
var ErrWorkflowNoEnv = NewBcode(400, 20006, "workflow must set env name")

ErrWorkflowNoEnv workflow have not env

View Source
var ErrWorkflowNotExist = NewBcode(404, 20002, "application workflow is not exist")

ErrWorkflowNotExist application workflow is not exist

View Source
var ErrWorkflowRecordNotExist = NewBcode(404, 20007, "workflow record is not exist")

ErrWorkflowRecordNotExist workflow record is not exist

Functions

func NewBcodeWrapErr added in v1.2.0

func NewBcodeWrapErr(httpCode, businessCode int32, err error, message string) error

NewBcodeWrapErr new bcode error

func ReturnError

func ReturnError(req *restful.Request, res *restful.Response, err error)

ReturnError Unified handling of all types of errors, generating a standard return structure.

func WrapGithubRateLimitErr added in v1.2.0

func WrapGithubRateLimitErr(err error) error

WrapGithubRateLimitErr wraps error if it is github rate limit

Types

type Bcode

type Bcode struct {
	HTTPCode     int32 `json:"-"`
	BusinessCode int32
	Message      string
}

Bcode business error code

func NewBcode added in v1.2.0

func NewBcode(httpCode, businessCode int32, message string) *Bcode

NewBcode new business code

func (*Bcode) Error

func (b *Bcode) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL