debug

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Inject is used to inject errors.
	Inject = "true"
	// Eject is used to eject errors.
	Eject = "false"
)

Variables

EI is a global object which is used to decide whether the error is injected or not.

Functions

func GetRandomErrorPercentage

func GetRandomErrorPercentage() int

GetRandomErrorPercentage returns an error percentage value. If the returned error percentage is greater then the error percentage threshold then error will not be injected.

func LogBuildDetails

func LogBuildDetails()

LogBuildDetails is no-op production alternative for the same function in present in debug build.

func StartInjectionServer

func StartInjectionServer()

StartInjectionServer is no-op production alternative for the same function in present in debug build.

Types

type CRUDErrorInjection

type CRUDErrorInjection struct {
	InjectDeleteCollectionError string `json:"injectDeleteCollectionError"`
	InjectDeleteError           string `json:"injectDeleteError"`
	InjectListError             string `json:"injectListError"`
	InjectGetError              string `json:"injectGetError"`
	InjectCreateError           string `json:"injectCreateError"`
	InjectUpdateError           string `json:"injectUpdateError"`
	InjectPatchError            string `json:"injectPatchError"`
}

CRUDErrorInjection is used to inject CRUD errors.

type CSPCErrorInjection

type CSPCErrorInjection struct {
	CRUDErrorInjection CRUDErrorInjection       `json:"crudErrorInjection"`
	ErrorPercentage    ErrorPercentageThreshold `json:"errorPercentage"`
}

CSPCErrorInjection is used to inject errors for CSPC related operations.

type CSPIErrorInjection

type CSPIErrorInjection struct {
	CRUDErrorInjection CRUDErrorInjection       `json:"crudErrorInjection"`
	ErrorPercentage    ErrorPercentageThreshold `json:"errorPercentage"`
}

CSPIErrorInjection is used to inject errors for CSPI related operations.

type CVRErrorInjection

type CVRErrorInjection struct {
	CRUDErrorInjection CRUDErrorInjection       `json:"crudErrorInjection"`
	ErrorPercentage    ErrorPercentageThreshold `json:"errorPercentage"`
}

CVRErrorInjection is used to inject errors in API calls for Volume Replica related operations

type Client

type Client struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

Client to connect to injection API server.

func NewClient

func NewClient(host string) *Client

NewClient create a client to connect to the injection server.

func (*Client) GetInject

func (c *Client) GetInject() (*ErrorInjection, error)

GetInject gives the error injection object.

func (*Client) PostInject

func (c *Client) PostInject(EI *ErrorInjection) error

PostInject will post the error injection object.

type DeploymentErrorInjection

type DeploymentErrorInjection struct {
	CRUDErrorInjection CRUDErrorInjection       `json:"crudErrorInjection"`
	ErrorPercentage    ErrorPercentageThreshold `json:"errorPercentage"`
}

DeploymentErrorInjection is used to inject errors for CSPC related operations.

type ErrorInjection

type ErrorInjection struct {
	CSPIError       CSPIErrorInjection       `json:"cspiError"`
	CSPCError       CSPCErrorInjection       `json:"cspcError"`
	DeploymentError DeploymentErrorInjection `json:"deploymentError"`
	ZFSError        ZFSErrorInjection        `json:"zfsError"`
	CVRError        CVRErrorInjection        `json:"cvrError"`
}

ErrorInjection schema to inject errors.

func NewErrorInjection

func NewErrorInjection() *ErrorInjection

NewErrorInjection returns a new ErrorInjection object.

func (*ErrorInjection) IsCSPCCreateErrorInjected

func (ei *ErrorInjection) IsCSPCCreateErrorInjected() bool

IsCSPCCreateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCDeleteCollectionErrorInjected

func (ei *ErrorInjection) IsCSPCDeleteCollectionErrorInjected() bool

IsCSPCDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCDeleteErrorInjected

func (ei *ErrorInjection) IsCSPCDeleteErrorInjected() bool

IsCSPCDeleteErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCGetErrorInjected

func (ei *ErrorInjection) IsCSPCGetErrorInjected() bool

IsCSPCGetErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCListErrorInjected

func (ei *ErrorInjection) IsCSPCListErrorInjected() bool

IsCSPCListErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCPatchErrorInjected

func (ei *ErrorInjection) IsCSPCPatchErrorInjected() bool

IsCSPCPatchErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPCUpdateErrorInjected

func (ei *ErrorInjection) IsCSPCUpdateErrorInjected() bool

IsCSPCUpdateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPICreateErrorInjected

func (ei *ErrorInjection) IsCSPICreateErrorInjected() bool

IsCSPICreateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIDeleteCollectionErrorInjected

func (ei *ErrorInjection) IsCSPIDeleteCollectionErrorInjected() bool

IsCSPIDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIDeleteErrorInjected

func (ei *ErrorInjection) IsCSPIDeleteErrorInjected() bool

IsCSPIDeleteErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIGetErrorInjected

func (ei *ErrorInjection) IsCSPIGetErrorInjected() bool

IsCSPIGetErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIListErrorInjected

func (ei *ErrorInjection) IsCSPIListErrorInjected() bool

IsCSPIListErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIPatchErrorInjected

func (ei *ErrorInjection) IsCSPIPatchErrorInjected() bool

IsCSPIPatchErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCSPIUpdateErrorInjected

func (ei *ErrorInjection) IsCSPIUpdateErrorInjected() bool

IsCSPIUpdateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsCVRCreateErrorInjected

func (ei *ErrorInjection) IsCVRCreateErrorInjected() bool

IsCVRCreateErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsCVRDeleteErrorInjected

func (ei *ErrorInjection) IsCVRDeleteErrorInjected() bool

IsCVRDeleteErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsCVRGetErrorInjected

func (ei *ErrorInjection) IsCVRGetErrorInjected() bool

IsCVRGetErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsCVRUpdateErrorInjected

func (ei *ErrorInjection) IsCVRUpdateErrorInjected() bool

IsCVRUpdateErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsDeploymentCreateErrorInjected

func (ei *ErrorInjection) IsDeploymentCreateErrorInjected() bool

IsDeploymentCreateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentDeleteCollectionErrorInjected

func (ei *ErrorInjection) IsDeploymentDeleteCollectionErrorInjected() bool

IsDeploymentDeleteCollectionErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentDeleteErrorInjected

func (ei *ErrorInjection) IsDeploymentDeleteErrorInjected() bool

IsDeploymentDeleteErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentGetErrorInjected

func (ei *ErrorInjection) IsDeploymentGetErrorInjected() bool

IsDeploymentGetErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentListErrorInjected

func (ei *ErrorInjection) IsDeploymentListErrorInjected() bool

IsDeploymentListErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentPatchErrorInjected

func (ei *ErrorInjection) IsDeploymentPatchErrorInjected() bool

IsDeploymentPatchErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsDeploymentUpdateErrorInjected

func (ei *ErrorInjection) IsDeploymentUpdateErrorInjected() bool

IsDeploymentUpdateErrorInjected is production alternative for the same function in present in debug build.

func (*ErrorInjection) IsZFSCreateErrorInjected

func (ei *ErrorInjection) IsZFSCreateErrorInjected() bool

IsZFSCreateErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsZFSDeleteErrorInjected

func (ei *ErrorInjection) IsZFSDeleteErrorInjected() bool

IsZFSDeleteErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) IsZFSGetErrorInjected

func (ei *ErrorInjection) IsZFSGetErrorInjected() bool

IsZFSGetErrorInjected is production alternative for the same function that exists in debug build

func (*ErrorInjection) WithCSPCCreateError

func (ei *ErrorInjection) WithCSPCCreateError(ejectOrInject string) *ErrorInjection

WithCSPCCreateError injects/ejects CSPC create error.

func (*ErrorInjection) WithCSPCDeleteCollectionError

func (ei *ErrorInjection) WithCSPCDeleteCollectionError(ejectOrInject string) *ErrorInjection

WithCSPCDeleteCollectionError injects/ejects CSPC delete collection error.

func (*ErrorInjection) WithCSPCDeleteError

func (ei *ErrorInjection) WithCSPCDeleteError(ejectOrInject string) *ErrorInjection

WithCSPCDeleteError injects/ejects CSPC delete error.

func (*ErrorInjection) WithCSPCGetError

func (ei *ErrorInjection) WithCSPCGetError(ejectOrInject string) *ErrorInjection

WithCSPCGetError injects/ejects CSPC get error.

func (*ErrorInjection) WithCSPCListError

func (ei *ErrorInjection) WithCSPCListError(ejectOrInject string) *ErrorInjection

WithCSPCListError injects/ejects CSPC list error.

func (*ErrorInjection) WithCSPCPatchError

func (ei *ErrorInjection) WithCSPCPatchError(ejectOrInject string) *ErrorInjection

WithCSPCPatchError injects/ejects CSPC patch error.

func (*ErrorInjection) WithCSPCThreshold

func (ei *ErrorInjection) WithCSPCThreshold(threshold int) *ErrorInjection

WithCSPCThreshold injects CSPC error depending on passed error threshold value.

func (*ErrorInjection) WithCSPCUpdateError

func (ei *ErrorInjection) WithCSPCUpdateError(ejectOrInject string) *ErrorInjection

WithCSPCUpdateError injects/ejects CSPC update error.

func (*ErrorInjection) WithCSPICreateError

func (ei *ErrorInjection) WithCSPICreateError(ejectOrInject string) *ErrorInjection

WithCSPICreateError injects/ejects CSPI create error.

func (*ErrorInjection) WithCSPIDeleteCollectionError

func (ei *ErrorInjection) WithCSPIDeleteCollectionError(ejectOrInject string) *ErrorInjection

WithCSPIDeleteCollectionError injects/ejects CSPI delete collection error.

func (*ErrorInjection) WithCSPIDeleteError

func (ei *ErrorInjection) WithCSPIDeleteError(ejectOrInject string) *ErrorInjection

WithCSPIDeleteError injects/ejects CSPI delete error.

func (*ErrorInjection) WithCSPIGetError

func (ei *ErrorInjection) WithCSPIGetError(ejectOrInject string) *ErrorInjection

WithCSPIGetError injects/ejects CSPI get error.

func (*ErrorInjection) WithCSPIListError

func (ei *ErrorInjection) WithCSPIListError(ejectOrInject string) *ErrorInjection

WithCSPIListError injects/ejects CSPI list error.

func (*ErrorInjection) WithCSPIPatchError

func (ei *ErrorInjection) WithCSPIPatchError(ejectOrInject string) *ErrorInjection

WithCSPIPatchError injects/ejects CSPI patch error.

func (*ErrorInjection) WithCSPIThreshold

func (ei *ErrorInjection) WithCSPIThreshold(threshold int) *ErrorInjection

WithCSPIThreshold injects CSPI error depending on passed error threshold value.

func (*ErrorInjection) WithCSPIUpdateError

func (ei *ErrorInjection) WithCSPIUpdateError(ejectOrInject string) *ErrorInjection

WithCSPIUpdateError injects/ejects CSPI update error.

func (*ErrorInjection) WithCVRCreateError

func (ei *ErrorInjection) WithCVRCreateError(ejectOrInject string) *ErrorInjection

WithCVRCreateError injects/ejects CVR create error.

func (*ErrorInjection) WithCVRDeleteError

func (ei *ErrorInjection) WithCVRDeleteError(ejectOrInject string) *ErrorInjection

WithCVRDeleteError injects/ejects CVR delete error.

func (*ErrorInjection) WithCVRGetError

func (ei *ErrorInjection) WithCVRGetError(ejectOrInject string) *ErrorInjection

WithCVRGetError injects/ejects CVR get error.

func (*ErrorInjection) WithCVRThreshold

func (ei *ErrorInjection) WithCVRThreshold(threshold int) *ErrorInjection

WithCVRThreshold injects CVR error depending on passed error threshold value

func (*ErrorInjection) WithCVRUpdateError

func (ei *ErrorInjection) WithCVRUpdateError(ejectOrInject string) *ErrorInjection

WithCVRUpdateError injects/ejects CVR update error.

func (*ErrorInjection) WithDeploymentCreateError

func (ei *ErrorInjection) WithDeploymentCreateError(ejectOrInject string) *ErrorInjection

WithDeploymentCreateError injects/ejects Deployment create error.

func (*ErrorInjection) WithDeploymentDeleteCollectionError

func (ei *ErrorInjection) WithDeploymentDeleteCollectionError(ejectOrInject string) *ErrorInjection

WithDeploymentDeleteCollectionError injects/ejects Deployment delete collection error.

func (*ErrorInjection) WithDeploymentDeleteError

func (ei *ErrorInjection) WithDeploymentDeleteError(ejectOrInject string) *ErrorInjection

WithDeploymentDeleteError injects/ejects Deployment delete error.

func (*ErrorInjection) WithDeploymentGetError

func (ei *ErrorInjection) WithDeploymentGetError(ejectOrInject string) *ErrorInjection

WithDeploymentGetError injects/ejects Deployment get error.

func (*ErrorInjection) WithDeploymentListError

func (ei *ErrorInjection) WithDeploymentListError(ejectOrInject string) *ErrorInjection

WithDeploymentListError injects/ejects Deployment delete error.

func (*ErrorInjection) WithDeploymentPatchError

func (ei *ErrorInjection) WithDeploymentPatchError(ejectOrInject string) *ErrorInjection

WithDeploymentPatchError injects/ejects Deployment patch error.

func (*ErrorInjection) WithDeploymentThreshold

func (ei *ErrorInjection) WithDeploymentThreshold(threshold int) *ErrorInjection

WithDeploymentThreshold injects Deployment error depending on passed error threshold value.

func (*ErrorInjection) WithDeploymentUpdateError

func (ei *ErrorInjection) WithDeploymentUpdateError(ejectOrInject string) *ErrorInjection

WithDeploymentUpdateError injects/ejects Deployment update error.

func (*ErrorInjection) WithZFSCreateError

func (ei *ErrorInjection) WithZFSCreateError(ejectOrInject string) *ErrorInjection

WithZFSCreateError injects/ejects ZFS create error.

func (*ErrorInjection) WithZFSDeleteError

func (ei *ErrorInjection) WithZFSDeleteError(ejectOrInject string) *ErrorInjection

WithZFSDeleteError injects/ejects ZFS delete error.

func (*ErrorInjection) WithZFSGetError

func (ei *ErrorInjection) WithZFSGetError(ejectOrInject string) *ErrorInjection

WithZFSGetError injects/ejects ZFS get error.

func (*ErrorInjection) WithZFSThreshold

func (ei *ErrorInjection) WithZFSThreshold(threshold int) *ErrorInjection

WithZFSThreshold injects ZFS errors depending on passed error threshold value

type ErrorPercentageThreshold

type ErrorPercentageThreshold struct {
	Threshold int `json:"threshold"`
}

ErrorPercentageThreshold is the threshold value above which the error will not be injected.

type ZFSErrorInjection

type ZFSErrorInjection struct {
	CRUDErrorInjection CRUDErrorInjection       `json:"crudErrorInjection"`
	ErrorPercentage    ErrorPercentageThreshold `json:"errorPercentage"`
}

ZFSErrorInjection is used to inject errors for Volume Replica related operations.

Jump to

Keyboard shortcuts

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