Documentation ¶
Index ¶
Constants ¶
View Source
const ( Ok = errCode(0) ErrDelAppPs = errCode(1) ErrDelAppTs = errCode(2) ErrSaveAppPs = errCode(5) ErrSaveAppTs = errCode(6) ErrSetSettingsPs = errCode(7) ErrDelAppSettingsPs = errCode(11) ErrAppNotDeployed = errCode(12) ErrAppNotFoundTs = errCode(13) ErrMarshalResp = errCode(14) ErrReadReq = errCode(15) ErrUnmarshalPld = errCode(16) ErrSrcMbSame = errCode(17) ErrAppDeployed = errCode(20) ErrAppNotInit = errCode(21) ErrAppNotUndeployed = errCode(22) ErrStatusesNotFound = errCode(23) ErrBucketTypeCheck = errCode(25) ErrMemcachedBucket = errCode(26) ErrHandlerCompile = errCode(27) ErrAppNameMismatch = errCode(29) ErrSaveConfig = errCode(33) ErrGetConfig = errCode(34) ErrGetRebStatus = errCode(35) ErrRebOrFailoverOngoing = errCode(36) ErrInvalidConfig = errCode(38) ErrAppCodeSize = errCode(39) ErrBucketMissing = errCode(41) ErrClusterVersion = errCode(42) ErrDebuggerDisabled = errCode(45) ErrMixedMode = errCode(46) ErrBucketAccess = errCode(49) ErrInterFunctionRecursion = errCode(50) ErrInterBucketRecursion = errCode(51) ErrUnsupportedSGW = errCode(52) ErrAppNotFound = errCode(53) ErrMetakvWriteFailed = errCode(54) ErrRequestedOpFailed = errCode(55) ErrCollectionMissing = errCode(56) ErrMagmaStorage = errCode(58) ErrInternalServer = errCode(59) ErrForbidden = errCode(60) ErrUnauthenticated = errCode(61) ErrMethodNotAllowed = errCode(62) ErrInvalidRequest = errCode(63) ErrAppPaused = errCode(64) ErrCursorLimitReached = errCode(65) ErrSGWDetection = errCode(66) )
View Source
const ( // System events done through rest EventStartTracing eventCode = iota EventStopTracing EventStartDebugger EventStopDebugger EventCleanupEventing EventDie EventTriggerGC EventFreeOSMemory EventGetUUID EventGetVersion EventGetErrCodes EventGetCpuCount EventGetWorkerCount EventGetLogFileLocation EventSaveConfig EventGetConfig // Eventing function crud operation EventCreateFunction EventDeployFunction EventPauseFunction EventResumeFunction EventUndeployFunction EventDeleteFunction // Includes settings change and function change EventUpdateFunction EventSetFunctionConfig // Function stat event EventClearStats EventFetchStats EventFetchProcessingStats EventFetchLatencyStats EventFetchExecutionStats EventFetchFailureStats // Function retrieve EventImportFunctions EventExportFunctions EventGetDeployedApps EventGetRunningApps EventGetBootstrappingApps EventGetPausingApps EventGetFunctionStatus EventBackupFunctions EventRestoreFunctions EventGetFunctionDraft EventGetInsight EventGetAppLog EventGetFunctionConfig EventListAllfunction EventGetAnnotations EventGetDebuggerUrl EventWriteDebuggerUrl // Miscellaneous functions EventResdistributeWorkload EventGetRebalanceProgress EventGetRebalanceStatus EventGetBootstrapStatus EventGetSeqProcessed EventGetDcpEventsRemaining EventGetConsumerPids EventGetUserInfo EventGetRuntimeProfiling EventGetAppStats )
View Source
const ( AuditLog log = 0b_00000001 SystemLog log = 0b_00000010 )
Variables ¶
This section is empty.
Functions ¶
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter, r *http.Request, event eventCode) *responseWriter
Types ¶
type ErrorInfo ¶
type ErrorInfo struct { Name string `json:"name"` Code int `json:"code"` Attributes []string `json:"attributes,omitempty"` Description interface{} `json:"description"` // contains filtered or unexported fields }
func (*ErrorInfo) GetDescription ¶
func (e *ErrorInfo) GetDescription() interface{}
func (*ErrorInfo) GetStatusCode ¶
type ErrorPayloadList ¶
type ErrorPayloadList struct { HeaderKey string `json:"header_key"` Version int `json:"version"` Revision int `json:"revision"` Errors []ErrorInfo `json:"errors"` }
func GetErrCodes ¶
func GetErrCodes() ErrorPayloadList
type Response ¶
type Response interface { // Adds request made by the user AddRequestData(key string, value interface{}) // Add the requested event SetRequestEvent(event eventCode) // Logs if the context is to be logged // currently logging to audit and system logs // Error will be logged by errCode LogAndSend(runtimeInfo *RuntimeInfo) Log(runtimeInfo *RuntimeInfo) }
type RuntimeInfo ¶
type RuntimeInfo struct { ErrCode errCode `json:"code"` Description interface{} `json:"info,omitempty"` WarningInfo interface{} `json:"warning_info,omitempty"` // For system event ExtraAttributes interface{} `json:"-"` // Some response don't need to be json marshalled // If set it to true then sender won't marshal the response and // send the description as given by the caller SendRawDescription bool `json:"-"` // If true then sender will only send the description OnlyDescription bool `json:"-"` // Defaults to "application/json" ContentType string `json:"-"` }
func (*RuntimeInfo) Convert ¶
func (r *RuntimeInfo) Convert(errInfo *ErrorInfo)
type WarningsInfo ¶
Click to show internal directories.
Click to hide internal directories.