Versions in this module Expand all Collapse all v1 v1.202405300917.1 May 30, 2024 Changes in this version + const ApplicationJSON + const ApplicationXBinary + const Authorization + const BearerPrefix + const CRC16Mask + const ContentDisposition + const ContentType + const EmailTemplatePrefix_Text + const FileMode_rw_rw_rw_ + const FileMode_rwxrwxrwx + const WSAECONNREFUSED + const WSAECONNRESET + var ErrFieldTypeMismatch = errors.New("field type mismatch") + var ErrFieldsMissed = errors.New("fields are missed") + var ErrUnexpectedStatusCode = errors.New("unexpected status code") + var TestNow = time.Now() + var TestTimeFunc = TimeFunc(func() time.Time { ... }) + func AppPartitionID(wsid istructs.WSID, numAppPartitions istructs.NumAppPartitions) istructs.PartitionID + func AppWSIDToPseudoWSID(appWSID istructs.WSID) (pseudoWSID istructs.WSID) + func CRC16(entity []byte) uint16 + func CUDsToMap(event istructs.IDbEvent, appDef appdef.IAppDef, optFuncs ...CUDsOpt) []map[string]interface + func CheckValueByKind(val interface{}, kind appdef.DataKind) error + func CopyDir(src, dst string, optFuncs ...CopyOpt) error + func CopyDirFS(srcFS IReadFS, src, dst string, optFuncs ...CopyOpt) error + func CopyFile(src, dstDir string, optFuncs ...CopyOpt) error + func CopyFileFS(srcFS fs.FS, srcFileName, dstDir string, optFuncs ...CopyOpt) error + func EmailVerificationCode() (verificationCode string, err error) + func Exists(filePath string) (exists bool, err error) + func FieldsToMap(obj istructs.IRowReader, appDef appdef.IAppDef, optFuncs ...MapperOpt) (res map[string]interface{}) + func GetAppWSID(wsid istructs.WSID, numAppWorkspaces istructs.NumAppWorkspaces) istructs.WSID + func GetCatalogFromTranslations(t Translations) catalog.Catalog + func GetPseudoWSID(ownerWSID istructs.WSID, entity string, clusterID istructs.ClusterID) istructs.WSID + func GetTestBusTimeout() time.Duration + func HashBytes(b []byte) int64 + func IsBlank(str string) bool + func IsCassandraStorage() bool + func IsDebug() bool + func IsDynamoDBStorage() bool + func IsTest() bool + func IsValidEmailTemplate(emailTemplate string) bool + func IsWSAEError(err error, errno syscall.Errno) bool + func JSONMapToCUDBody(data []map[string]interface{}) string + func MapToObject(data map[string]interface{}, rw istructs.IRowWriter) (err error) + func MatchQName(qNames ...appdef.QName) func(cud istructs.ICUDRow, wsid istructs.WSID, cmdQName appdef.QName) bool + func NewSysError(statusCode int) error + func NilAdminPortGetter() int + func ObjectToMap(obj istructs.IObject, appDef appdef.IAppDef, opts ...MapperOpt) (res map[string]interface{}) + func PairsToMap(pairs []string, m map[string]string) error + func ReadByKind(name appdef.FieldName, kind appdef.DataKind, rr istructs.IRowReader) interface + func ReplyAccessDeniedForbidden(sender ibus.ISender, message string) + func ReplyAccessDeniedUnauthorized(sender ibus.ISender, message string) + func ReplyBadRequest(sender ibus.ISender, message string) + func ReplyErr(sender ibus.ISender, err error) + func ReplyErrDef(sender ibus.ISender, err error, defaultStatusCode int) + func ReplyErrf(sender ibus.ISender, status int, args ...interface{}) + func ReplyInternalServerError(sender ibus.ISender, message string, err error) + func ReplyJSON(sender ibus.ISender, httpCode int, body string) + func ReplyUnauthorized(sender ibus.ISender, message string) + func ResetTimer(t *time.Timer, timeout time.Duration) + func ScanSSE(data []byte, atEOF bool) (advance int, token []byte, err error) + func ServerAddress(port int) string + func SplitErrors(joinedError error) (errs []error) + func TruncateEmailTemplate(emailTemplate string) string + func Unzip(zipFileName, destDir string) error + func WrapSysError(err error, defaultStatusCode int) error + func Zip(zipFilePath string, objectToZip any) error + type BLOB struct + Content []byte + FieldName string + MimeType string + Name string + type CUD struct + Fields map[string]interface{} + type CUDs struct + Cuds []CUD + type CUDsOpt func(*cudsOpts) + func WithFilter(filterFunc func(appdef.QName) bool) CUDsOpt + func WithMapperOpts(opts ...MapperOpt) CUDsOpt + type CopyOpt func(co *copyOpts) + func WithFileMode(fm fs.FileMode) CopyOpt + func WithFilterFilesWithRelativePaths(filesWithRelativePaths []string) CopyOpt + func WithNewName(fileName string) CopyOpt + func WithSkipExisting() CopyOpt + type EmbedFS interface + Open func(name string) (fs.File, error) + ReadDir func(name string) ([]fs.DirEntry, error) + ReadFile func(name string) ([]byte, error) + type FuncError struct + ExpectedHTTPCodes []int + func (fe FuncError) Error() string + func (fe FuncError) Unwrap() error + type FuncResponse struct + CmdResult map[string]interface{} + CurrentWLogOffset istructs.Offset + NewIDs map[string]int64 + Sections []struct{ ... } + SysError SysError + func (resp *FuncResponse) IsEmpty() bool + func (resp *FuncResponse) NewID() int64 + func (resp *FuncResponse) SectionRow(rowIdx ...int) []interface{} + type HTTPResponse struct + Body string + HTTPResp *http.Response + func (resp *HTTPResponse) ExpectedHTTPCodes() []int + func (resp *HTTPResponse) ExpectedSysErrorCode() int + func (resp *HTTPResponse) Println() + func (resp *HTTPResponse) RequireContainsError(t *testing.T, messagePart string) + func (resp *HTTPResponse) RequireError(t *testing.T, message string) + type IErrUnwrapper interface + Unwrap func() []error + type IHTTPClient interface + CloseIdleConnections func() + Req func(urlStr string, body string, optFuncs ...ReqOptFunc) (*HTTPResponse, error) + func NewIHTTPClient() (client IHTTPClient, clenup func()) + type IReadFS interface + type MapObject map[string]interface + func (m MapObject) AsBoolean(name string) (val bool, ok bool, err error) + func (m MapObject) AsFloat64(name string) (val float64, ok bool, err error) + func (m MapObject) AsInt64(name string) (val int64, ok bool, err error) + func (m MapObject) AsObject(name string) (val MapObject, ok bool, err error) + func (m MapObject) AsObjects(name string) (val []interface{}, ok bool, err error) + func (m MapObject) AsString(name string) (val string, ok bool, err error) + func (m MapObject) AsStringRequired(name string) (val string, err error) + type MapperOpt func(opt *mapperOpts) + func Filter(filterFunc func(name string, kind appdef.DataKind) bool) MapperOpt + func WithNonNilsOnly() MapperOpt + type MockCUDRow struct + func (m *MockCUDRow) AsBool(name appdef.FieldName) bool + func (m *MockCUDRow) AsBytes(name appdef.FieldName) []byte + func (m *MockCUDRow) AsFloat32(name appdef.FieldName) float32 + func (m *MockCUDRow) AsFloat64(name appdef.FieldName) float64 + func (m *MockCUDRow) AsInt32(name appdef.FieldName) int32 + func (m *MockCUDRow) AsInt64(name appdef.FieldName) int64 + func (m *MockCUDRow) AsQName(name appdef.FieldName) appdef.QName + func (m *MockCUDRow) AsRecordID(name appdef.FieldName) istructs.RecordID + func (m *MockCUDRow) AsString(name appdef.FieldName) string + func (m *MockCUDRow) FieldNames(cb func(appdef.FieldName)) + func (m *MockCUDRow) ID() istructs.RecordID + func (m *MockCUDRow) IsNew() bool + func (m *MockCUDRow) ModifiedFields(cb func(fieldName appdef.FieldName, newValue interface{})) + func (m *MockCUDRow) QName() appdef.QName + func (m *MockCUDRow) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID)) + type MockIntents struct + func (m *MockIntents) FindIntent(key istructs.IStateKeyBuilder) istructs.IStateValueBuilder + func (m *MockIntents) NewValue(key istructs.IStateKeyBuilder) (istructs.IStateValueBuilder, error) + func (m *MockIntents) UpdateValue(key istructs.IStateKeyBuilder, existingValue istructs.IStateValue) (istructs.IStateValueBuilder, error) + type MockKey struct + func (m *MockKey) AsBool(name appdef.FieldName) bool + func (m *MockKey) AsBytes(name appdef.FieldName) []byte + func (m *MockKey) AsFloat32(name appdef.FieldName) float32 + func (m *MockKey) AsFloat64(name appdef.FieldName) float64 + func (m *MockKey) AsInt32(name appdef.FieldName) int32 + func (m *MockKey) AsInt64(name appdef.FieldName) int64 + func (m *MockKey) AsQName(name appdef.FieldName) appdef.QName + func (m *MockKey) AsRecordID(name appdef.FieldName) istructs.RecordID + func (m *MockKey) AsString(name appdef.FieldName) string + func (m *MockKey) FieldNames(cb func(appdef.FieldName)) + func (m *MockKey) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID)) + type MockObject struct + func (m *MockObject) AsBool(name appdef.FieldName) bool + func (m *MockObject) AsBytes(name appdef.FieldName) []byte + func (m *MockObject) AsFloat32(name appdef.FieldName) float32 + func (m *MockObject) AsFloat64(name appdef.FieldName) float64 + func (m *MockObject) AsInt32(name appdef.FieldName) int32 + func (m *MockObject) AsInt64(name appdef.FieldName) int64 + func (m *MockObject) AsQName(name appdef.FieldName) appdef.QName + func (m *MockObject) AsRecord() istructs.IRecord + func (m *MockObject) AsRecordID(name appdef.FieldName) istructs.RecordID + func (m *MockObject) AsString(name appdef.FieldName) string + func (m *MockObject) Children(container string, cb func(istructs.IObject)) + func (m *MockObject) Containers(cb func(container string)) + func (m *MockObject) FieldNames(cb func(appdef.FieldName)) + func (m *MockObject) QName() appdef.QName + func (m *MockObject) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID)) + type MockPLogEvent struct + func (m *MockPLogEvent) ArgumentObject() istructs.IObject + func (m *MockPLogEvent) CUDs(cb func(rec istructs.ICUDRow)) + func (m *MockPLogEvent) DeviceID() istructs.ConnectedDeviceID + func (m *MockPLogEvent) Error() istructs.IEventError + func (m *MockPLogEvent) QName() appdef.QName + func (m *MockPLogEvent) RegisteredAt() istructs.UnixMilli + func (m *MockPLogEvent) Release() + func (m *MockPLogEvent) Synced() bool + func (m *MockPLogEvent) SyncedAt() istructs.UnixMilli + func (m *MockPLogEvent) WLogOffset() istructs.Offset + func (m *MockPLogEvent) Workspace() istructs.WSID + type MockRawEvent struct + func (m *MockRawEvent) ArgumentObject() istructs.IObject + func (m *MockRawEvent) ArgumentUnloggedObject() istructs.IObject + func (m *MockRawEvent) CUDs(cb func(rec istructs.ICUDRow)) + func (m *MockRawEvent) DeviceID() istructs.ConnectedDeviceID + func (m *MockRawEvent) HandlingPartition() istructs.PartitionID + func (m *MockRawEvent) PLogOffset() istructs.Offset + func (m *MockRawEvent) QName() appdef.QName + func (m *MockRawEvent) RegisteredAt() istructs.UnixMilli + func (m *MockRawEvent) Synced() bool + func (m *MockRawEvent) SyncedAt() istructs.UnixMilli + func (m *MockRawEvent) WLogOffset() istructs.Offset + func (m *MockRawEvent) Workspace() istructs.WSID + type MockState struct + func (m *MockState) App() istructs.AppQName + func (m *MockState) CanExist(key istructs.IStateKeyBuilder) (value istructs.IStateValue, ok bool, err error) + func (m *MockState) CanExistAll(keys []istructs.IStateKeyBuilder, callback istructs.StateValueCallback) (err error) + func (m *MockState) KeyBuilder(storage, entity appdef.QName) (builder istructs.IStateKeyBuilder, err error) + func (m *MockState) MustExist(key istructs.IStateKeyBuilder) (value istructs.IStateValue, err error) + func (m *MockState) MustExistAll(keys []istructs.IStateKeyBuilder, callback istructs.StateValueCallback) (err error) + func (m *MockState) MustNotExist(key istructs.IStateKeyBuilder) (err error) + func (m *MockState) MustNotExistAll(keys []istructs.IStateKeyBuilder) (err error) + func (m *MockState) PLogEvent() istructs.IPLogEvent + func (m *MockState) Read(key istructs.IStateKeyBuilder, callback istructs.ValueCallback) (err error) + type MockStateKeyBuilder struct + func (m *MockStateKeyBuilder) ClusteringColumns() istructs.IRowWriter + func (m *MockStateKeyBuilder) Entity() appdef.QName + func (m *MockStateKeyBuilder) Equals(src istructs.IKeyBuilder) bool + func (m *MockStateKeyBuilder) PartitionKey() istructs.IRowWriter + func (m *MockStateKeyBuilder) PutBool(name appdef.FieldName, value bool) + func (m *MockStateKeyBuilder) PutBytes(name appdef.FieldName, value []byte) + func (m *MockStateKeyBuilder) PutChars(name appdef.FieldName, value string) + func (m *MockStateKeyBuilder) PutFloat32(name appdef.FieldName, value float32) + func (m *MockStateKeyBuilder) PutFloat64(name appdef.FieldName, value float64) + func (m *MockStateKeyBuilder) PutFromJSON(map[string]any) + func (m *MockStateKeyBuilder) PutInt32(name appdef.FieldName, value int32) + func (m *MockStateKeyBuilder) PutInt64(name appdef.FieldName, value int64) + func (m *MockStateKeyBuilder) PutNumber(name appdef.FieldName, value float64) + func (m *MockStateKeyBuilder) PutQName(name appdef.FieldName, value appdef.QName) + func (m *MockStateKeyBuilder) PutRecordID(name appdef.FieldName, value istructs.RecordID) + func (m *MockStateKeyBuilder) PutString(name appdef.FieldName, value string) + func (m *MockStateKeyBuilder) Storage() appdef.QName + func (m *MockStateKeyBuilder) ToBytes(wsid istructs.WSID) ([]byte, []byte, error) + type MockStateValue struct + func (m *MockStateValue) AsBool(name appdef.FieldName) bool + func (m *MockStateValue) AsBytes(name appdef.FieldName) []byte + func (m *MockStateValue) AsEvent(name appdef.FieldName) istructs.IDbEvent + func (m *MockStateValue) AsFloat32(name appdef.FieldName) float32 + func (m *MockStateValue) AsFloat64(name appdef.FieldName) float64 + func (m *MockStateValue) AsInt32(name appdef.FieldName) int32 + func (m *MockStateValue) AsInt64(name appdef.FieldName) int64 + func (m *MockStateValue) AsQName(name appdef.FieldName) appdef.QName + func (m *MockStateValue) AsRecord(name appdef.FieldName) istructs.IRecord + func (m *MockStateValue) AsRecordID(name appdef.FieldName) istructs.RecordID + func (m *MockStateValue) AsString(name appdef.FieldName) string + func (m *MockStateValue) AsValue(name string) istructs.IStateValue + func (m *MockStateValue) FieldNames(cb func(appdef.FieldName)) + func (m *MockStateValue) GetAsBool(index int) bool + func (m *MockStateValue) GetAsBytes(index int) []byte + func (m *MockStateValue) GetAsFloat32(index int) float32 + func (m *MockStateValue) GetAsFloat64(index int) float64 + func (m *MockStateValue) GetAsInt32(index int) int32 + func (m *MockStateValue) GetAsInt64(index int) int64 + func (m *MockStateValue) GetAsQName(index int) appdef.QName + func (m *MockStateValue) GetAsString(index int) string + func (m *MockStateValue) GetAsValue(index int) istructs.IStateValue + func (m *MockStateValue) Length() int + func (m *MockStateValue) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID)) + type MockStateValueBuilder struct + func (m *MockStateValueBuilder) Build() istructs.IValue + func (m *MockStateValueBuilder) BuildValue() istructs.IStateValue + func (m *MockStateValueBuilder) Equal(src istructs.IStateValueBuilder) bool + func (m *MockStateValueBuilder) PutBool(name appdef.FieldName, value bool) + func (m *MockStateValueBuilder) PutBytes(name appdef.FieldName, value []byte) + func (m *MockStateValueBuilder) PutChars(name appdef.FieldName, value string) + func (m *MockStateValueBuilder) PutEvent(name appdef.FieldName, event istructs.IDbEvent) + func (m *MockStateValueBuilder) PutFloat32(name appdef.FieldName, value float32) + func (m *MockStateValueBuilder) PutFloat64(name appdef.FieldName, value float64) + func (m *MockStateValueBuilder) PutFromJSON(map[string]any) + func (m *MockStateValueBuilder) PutInt32(name appdef.FieldName, value int32) + func (m *MockStateValueBuilder) PutInt64(name appdef.FieldName, value int64) + func (m *MockStateValueBuilder) PutNumber(name appdef.FieldName, value float64) + func (m *MockStateValueBuilder) PutQName(name appdef.FieldName, value appdef.QName) + func (m *MockStateValueBuilder) PutRecord(name appdef.FieldName, record istructs.IRecord) + func (m *MockStateValueBuilder) PutRecordID(name appdef.FieldName, value istructs.RecordID) + func (m *MockStateValueBuilder) PutString(name appdef.FieldName, value string) + func (m *MockStateValueBuilder) ToBytes() ([]byte, error) + type PathReader struct + func NewPathReader(rootPath string) *PathReader + func (r *PathReader) Open(name string) (fs.File, error) + func (r *PathReader) ReadDir(name string) ([]os.DirEntry, error) + func (r *PathReader) ReadFile(name string) ([]byte, error) + type ReqOptFunc func(opts *reqOpts) + func Expect400(expectErrorContains ...string) ReqOptFunc + func Expect400RefIntegrity_Existence() ReqOptFunc + func Expect400RefIntegrity_QName() ReqOptFunc + func Expect401() ReqOptFunc + func Expect403(expectedMessages ...string) ReqOptFunc + func Expect404() ReqOptFunc + func Expect409(expected ...string) ReqOptFunc + func Expect410() ReqOptFunc + func Expect429() ReqOptFunc + func Expect500() ReqOptFunc + func Expect503() ReqOptFunc + func ExpectSysError500() ReqOptFunc + func WithAuthorizeBy(principalToken string) ReqOptFunc + func WithAuthorizeByIfNot(principalToken string) ReqOptFunc + func WithCookies(cookiesPairs ...string) ReqOptFunc + func WithDiscardResponse() ReqOptFunc + func WithExpectedCode(expectedHTTPCode int, expectErrorContains ...string) ReqOptFunc + func WithHeaders(headersPairs ...string) ReqOptFunc + func WithLongPolling() ReqOptFunc + func WithMethod(m string) ReqOptFunc + func WithRelativeURL(relativeURL string) ReqOptFunc + func WithResponseHandler(responseHandler func(httpResp *http.Response)) ReqOptFunc + func WithRetryOnAnyError(timeout time.Duration, retryDelay time.Duration) ReqOptFunc + func WithRetryOnCertainError(errMatcher func(err error) bool, timeout time.Duration, ...) ReqOptFunc + type SysError struct + Data string + HTTPStatus int + Message string + QName appdef.QName + func NewHTTPError(httpStatus int, err error) SysError + func NewHTTPErrorf(httpStatus int, args ...interface{}) SysError + func (he SysError) Error() string + func (he SysError) ToJSON() string + type TestObject struct + Containers_ map[string][]*TestObject + Data map[string]interface{} + Id istructs.RecordID + IsNew_ bool + Name appdef.QName + Parent_ istructs.RecordID + func (o *TestObject) AsBool(name string) bool + func (o *TestObject) AsBytes(name string) []byte + func (o *TestObject) AsFloat32(name string) float32 + func (o *TestObject) AsFloat64(name string) float64 + func (o *TestObject) AsInt32(name string) int32 + func (o *TestObject) AsInt64(name string) int64 + func (o *TestObject) AsQName(name string) appdef.QName + func (o *TestObject) AsRecord() istructs.IRecord + func (o *TestObject) AsRecordID(name string) istructs.RecordID + func (o *TestObject) AsString(name string) string + func (o *TestObject) Children(container string, cb func(istructs.IObject)) + func (o *TestObject) Containers(cb func(container string)) + func (o *TestObject) FieldNames(cb func(name string)) + func (o *TestObject) ID() istructs.RecordID + func (o *TestObject) IsNew() bool + func (o *TestObject) ModifiedFields(cb func(string, interface{})) + func (o *TestObject) Parent() istructs.RecordID + func (o *TestObject) PutBool(name string, value bool) + func (o *TestObject) PutBytes(name string, value []byte) + func (o *TestObject) PutChars(name string, value string) + func (o *TestObject) PutFloat32(name string, value float32) + func (o *TestObject) PutFloat64(name string, value float64) + func (o *TestObject) PutFromJSON(value map[string]any) + func (o *TestObject) PutInt32(name string, value int32) + func (o *TestObject) PutInt64(name string, value int64) + func (o *TestObject) PutNumber(name string, value float64) + func (o *TestObject) PutQName(name string, value appdef.QName) + func (o *TestObject) PutRecordID(name string, value istructs.RecordID) + func (o *TestObject) PutString(name, value string) + func (o *TestObject) QName() appdef.QName + type TestValue struct + func (v *TestValue) AsEvent(name string) (event istructs.IDbEvent) + func (v *TestValue) AsRecord(name string) (record istructs.IRecord) + type TimeFunc func() time.Time + type Translations map[string]map[language.Tag]string v1.202405300916.1-rc May 30, 2024