coreutils

package
v0.0.0-...-65e3cab Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 34 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Authorization   = "Authorization"
	ContentType     = "Content-Type"
	ApplicationJSON = "application/json"
	BearerPrefix    = "Bearer "

	CRC16Mask                = uint32(math.MaxUint32 >> 16)
	EmailTemplatePrefix_Text = "text:"

	WSAECONNRESET      syscall.Errno = 10054
	WSAECONNREFUSED    syscall.Errno = 10061
	FileMode_rwxrwxrwx fs.FileMode   = 0777 // default for directory
	FileMode_rw_rw_rw_ fs.FileMode   = 0666 // default for file
)

Variables

View Source
var (
	ErrFieldsMissed         = errors.New("fields are missed")
	ErrFieldTypeMismatch    = errors.New("field type mismatch")
	ErrUnexpectedStatusCode = errors.New("unexpected status code")
)
View Source
var (
	TestNow      = time.Now()
	TestTimeFunc = TimeFunc(func() time.Time { return TestNow })
)

Functions

func AppPartitionID

func AppPartitionID(wsid istructs.WSID, numAppPartitions istructs.NumAppPartitions) istructs.PartitionID

used in BuildAppWorkspaces() only because there are no apps in IAppPartitions on that moment

func CRC16

func CRC16(entity []byte) uint16

func CUDsToMap

func CUDsToMap(event istructs.IDbEvent, appDef appdef.IAppDef, optFuncs ...CUDsOpt) []map[string]interface{}

func CheckValueByKind

func CheckValueByKind(val interface{}, kind appdef.DataKind) error

func CopyDir

func CopyDir(src, dst string, optFuncs ...CopyOpt) error

func CopyDirFS

func CopyDirFS(srcFS IReadFS, src, dst string, optFuncs ...CopyOpt) error

copies the specified dir from the provided FS to disk to path specified by dst use "." src to copy the entire srcFS content

func CopyFile

func CopyFile(src, dst string, optFuncs ...CopyOpt) error

func CopyFileFS

func CopyFileFS(srcFS fs.FS, src, dst string, optFuncs ...CopyOpt) error

copies the specified file from the provided FS to disk to path specified by dst

func EmailVerificationCode

func EmailVerificationCode() (verificationCode string, err error)

generates cryptographically secure random verification code. Len - 6 bytes, each value is 0-9

func Exists

func Exists(filePath string) (exists bool, err error)

func FieldsToMap

func FieldsToMap(obj istructs.IRowReader, appDef appdef.IAppDef, optFuncs ...MapperOpt) (res map[string]interface{})

func GetAppWSID

func GetAppWSID(wsid istructs.WSID, numAppWorkspaces istructs.NumAppWorkspaces) istructs.WSID

func GetCatalogFromTranslations

func GetCatalogFromTranslations(t Translations) catalog.Catalog

func GetPseudoWSID

func GetPseudoWSID(ownerWSID istructs.WSID, entity string, clusterID istructs.ClusterID) istructs.WSID

for Login use NullWSID as ownerWSID

func GetTestBusTimeout

func GetTestBusTimeout() time.Duration

func HashBytes

func HashBytes(b []byte) int64

returns FNV-1 hash as int64

func IsBlank

func IsBlank(str string) bool

func IsCassandraStorage

func IsCassandraStorage() bool

func IsDebug

func IsDebug() bool

func IsDynamoDBStorage

func IsDynamoDBStorage() bool

func IsTest

func IsTest() bool

func IsValidEmailTemplate

func IsValidEmailTemplate(emailTemplate string) bool

func IsWSAEError

func IsWSAEError(err error, errno syscall.Errno) bool

func JSONMapToCUDBody

func JSONMapToCUDBody(data []map[string]interface{}) string

func MapToObject

func MapToObject(data map[string]interface{}, rw istructs.IRowWriter) (err error)

func MatchQName

func MatchQName(qNames ...appdef.QName) func(cud istructs.ICUDRow, wsid istructs.WSID, cmdQName appdef.QName) bool

func NewSysError

func NewSysError(statusCode int) error

func ObjectToMap

func ObjectToMap(obj istructs.IObject, appDef appdef.IAppDef, opts ...MapperOpt) (res map[string]interface{})

func PairsToMap

func PairsToMap(pairs []string, m map[string]string) error

converts slice of "k=v" to map[k]v

func ReadByKind

func ReadByKind(name appdef.FieldName, kind appdef.DataKind, rr istructs.IRowReader) interface{}

panics on an unsupported kind guessing that pair <name, kind> could be taken from IDef.Fields() callback only

func ReplyAccessDeniedForbidden

func ReplyAccessDeniedForbidden(sender ibus.ISender, message string)

func ReplyAccessDeniedUnauthorized

func ReplyAccessDeniedUnauthorized(sender ibus.ISender, message string)

func ReplyBadRequest

func ReplyBadRequest(sender ibus.ISender, message string)

func ReplyErr

func ReplyErr(sender ibus.ISender, err error)

func ReplyErrDef

func ReplyErrDef(sender ibus.ISender, err error, defaultStatusCode int)

func ReplyErrf

func ReplyErrf(sender ibus.ISender, status int, args ...interface{})

func ReplyInternalServerError

func ReplyInternalServerError(sender ibus.ISender, message string, err error)

func ReplyJSON

func ReplyJSON(sender ibus.ISender, httpCode int, body string)

func ReplyUnauthorized

func ReplyUnauthorized(sender ibus.ISender, message string)

func ServerAddress

func ServerAddress(port int) string

func SplitErrors

func SplitErrors(joinedError error) (errs []error)

func TruncateEmailTemplate

func TruncateEmailTemplate(emailTemplate string) string

func WrapSysError

func WrapSysError(err error, defaultStatusCode int) error

Types

type CUD

type CUD struct {
	Fields map[string]interface{} `json:"fields"`
}

type CUDs

type CUDs struct {
	Cuds []CUD `json:"cuds"`
}

type CUDsOpt

type CUDsOpt func(*cudsOpts)

func WithFilter

func WithFilter(filterFunc func(appdef.QName) bool) CUDsOpt

func WithMapperOpts

func WithMapperOpts(opts ...MapperOpt) CUDsOpt

type CopyOpt

type CopyOpt func(co *copyOpts)

func WithFileMode

func WithFileMode(fm fs.FileMode) CopyOpt

func WithFilterFilesWithRelativePaths

func WithFilterFilesWithRelativePaths(filesWithRelativePaths []string) CopyOpt

func WithSkipExisting

func WithSkipExisting() CopyOpt

type EmbedFS

type EmbedFS interface {
	Open(name string) (fs.File, error)
	ReadDir(name string) ([]fs.DirEntry, error)
	ReadFile(name string) ([]byte, error)
}

type FuncError

type FuncError struct {
	SysError
	ExpectedHTTPCodes []int
}

func (FuncError) Error

func (fe FuncError) Error() string

func (FuncError) Unwrap

func (fe FuncError) Unwrap() error

type FuncResponse

type FuncResponse struct {
	*HTTPResponse
	Sections []struct {
		Elements [][][][]interface{} `json:"elements"`
	} `json:"sections"`
	NewIDs            map[string]int64
	CurrentWLogOffset int64
	SysError          SysError               `json:"sys.Error"`
	CmdResult         map[string]interface{} `json:"Result"`
}

func (*FuncResponse) IsEmpty

func (resp *FuncResponse) IsEmpty() bool

func (*FuncResponse) NewID

func (resp *FuncResponse) NewID() int64

returns a new ID for raw ID 1

func (*FuncResponse) SectionRow

func (resp *FuncResponse) SectionRow(rowIdx ...int) []interface{}

type HTTPResponse

type HTTPResponse struct {
	Body     string
	HTTPResp *http.Response
	// contains filtered or unexported fields
}

func (*HTTPResponse) Println

func (resp *HTTPResponse) Println()

func (*HTTPResponse) RequireContainsError

func (resp *HTTPResponse) RequireContainsError(t *testing.T, messagePart string)

func (*HTTPResponse) RequireError

func (resp *HTTPResponse) RequireError(t *testing.T, message string)

type IErrUnwrapper

type IErrUnwrapper interface {
	Unwrap() []error
}

type IFederation

type IFederation interface {
	POST(relativeURL string, body string, optFuncs ...ReqOptFunc) (*HTTPResponse, error)
	GET(relativeURL string, body string, optFuncs ...ReqOptFunc) (*HTTPResponse, error)
	Func(relativeURL string, body string, optFuncs ...ReqOptFunc) (*FuncResponse, error)
	URLStr() string
	Port() int
}

func NewIFederation

func NewIFederation(federationURL func() *url.URL) (federation IFederation, cleanup func())

type IHTTPClient

type IHTTPClient interface {
	Req(urlStr string, body string, optFuncs ...ReqOptFunc) (*HTTPResponse, error)
	CloseIdleConnections()
}

func NewIHTTPClient

func NewIHTTPClient() IHTTPClient

type IReadFS

type IReadFS interface {
	fs.ReadDirFS
	fs.ReadFileFS
}

type MapObject

type MapObject map[string]interface{}

func (MapObject) AsBoolean

func (m MapObject) AsBoolean(name string) (val bool, ok bool, err error)

func (MapObject) AsFloat64

func (m MapObject) AsFloat64(name string) (val float64, ok bool, err error)

func (MapObject) AsInt64

func (m MapObject) AsInt64(name string) (val int64, ok bool, err error)

func (MapObject) AsObject

func (m MapObject) AsObject(name string) (val MapObject, ok bool, err error)

func (MapObject) AsObjects

func (m MapObject) AsObjects(name string) (val []interface{}, ok bool, err error)

func (MapObject) AsString

func (m MapObject) AsString(name string) (val string, ok bool, err error)

func (MapObject) AsStringRequired

func (m MapObject) AsStringRequired(name string) (val string, err error)

type MapperOpt

type MapperOpt func(opt *mapperOpts)

func Filter

func Filter(filterFunc func(name string, kind appdef.DataKind) bool) MapperOpt

func WithNonNilsOnly

func WithNonNilsOnly() MapperOpt

type MockCUDRow

type MockCUDRow struct {
	mock.Mock
}

func (*MockCUDRow) AsBool

func (m *MockCUDRow) AsBool(name appdef.FieldName) bool

func (*MockCUDRow) AsBytes

func (m *MockCUDRow) AsBytes(name appdef.FieldName) []byte

func (*MockCUDRow) AsFloat32

func (m *MockCUDRow) AsFloat32(name appdef.FieldName) float32

func (*MockCUDRow) AsFloat64

func (m *MockCUDRow) AsFloat64(name appdef.FieldName) float64

func (*MockCUDRow) AsInt32

func (m *MockCUDRow) AsInt32(name appdef.FieldName) int32

func (*MockCUDRow) AsInt64

func (m *MockCUDRow) AsInt64(name appdef.FieldName) int64

func (*MockCUDRow) AsQName

func (m *MockCUDRow) AsQName(name appdef.FieldName) appdef.QName

func (*MockCUDRow) AsRecordID

func (m *MockCUDRow) AsRecordID(name appdef.FieldName) istructs.RecordID

func (*MockCUDRow) AsString

func (m *MockCUDRow) AsString(name appdef.FieldName) string

func (*MockCUDRow) FieldNames

func (m *MockCUDRow) FieldNames(cb func(appdef.FieldName))

func (*MockCUDRow) ID

func (m *MockCUDRow) ID() istructs.RecordID

func (*MockCUDRow) IsNew

func (m *MockCUDRow) IsNew() bool

func (*MockCUDRow) ModifiedFields

func (m *MockCUDRow) ModifiedFields(cb func(fieldName appdef.FieldName, newValue interface{}))

func (*MockCUDRow) QName

func (m *MockCUDRow) QName() appdef.QName

func (*MockCUDRow) RecordIDs

func (m *MockCUDRow) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID))

type MockIntents

type MockIntents struct {
	mock.Mock
}

func (*MockIntents) FindIntent

func (*MockIntents) NewValue

func (*MockIntents) UpdateValue

type MockKey

type MockKey struct {
	mock.Mock
}

func (*MockKey) AsBool

func (m *MockKey) AsBool(name appdef.FieldName) bool

func (*MockKey) AsBytes

func (m *MockKey) AsBytes(name appdef.FieldName) []byte

func (*MockKey) AsFloat32

func (m *MockKey) AsFloat32(name appdef.FieldName) float32

func (*MockKey) AsFloat64

func (m *MockKey) AsFloat64(name appdef.FieldName) float64

func (*MockKey) AsInt32

func (m *MockKey) AsInt32(name appdef.FieldName) int32

func (*MockKey) AsInt64

func (m *MockKey) AsInt64(name appdef.FieldName) int64

func (*MockKey) AsQName

func (m *MockKey) AsQName(name appdef.FieldName) appdef.QName

func (*MockKey) AsRecordID

func (m *MockKey) AsRecordID(name appdef.FieldName) istructs.RecordID

func (*MockKey) AsString

func (m *MockKey) AsString(name appdef.FieldName) string

func (*MockKey) FieldNames

func (m *MockKey) FieldNames(cb func(appdef.FieldName))

func (*MockKey) RecordIDs

func (m *MockKey) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID))

type MockObject

type MockObject struct {
	mock.Mock
}

func (*MockObject) AsBool

func (m *MockObject) AsBool(name appdef.FieldName) bool

func (*MockObject) AsBytes

func (m *MockObject) AsBytes(name appdef.FieldName) []byte

func (*MockObject) AsFloat32

func (m *MockObject) AsFloat32(name appdef.FieldName) float32

func (*MockObject) AsFloat64

func (m *MockObject) AsFloat64(name appdef.FieldName) float64

func (*MockObject) AsInt32

func (m *MockObject) AsInt32(name appdef.FieldName) int32

func (*MockObject) AsInt64

func (m *MockObject) AsInt64(name appdef.FieldName) int64

func (*MockObject) AsQName

func (m *MockObject) AsQName(name appdef.FieldName) appdef.QName

func (*MockObject) AsRecord

func (m *MockObject) AsRecord() istructs.IRecord

func (*MockObject) AsRecordID

func (m *MockObject) AsRecordID(name appdef.FieldName) istructs.RecordID

func (*MockObject) AsString

func (m *MockObject) AsString(name appdef.FieldName) string

func (*MockObject) Children

func (m *MockObject) Children(container string, cb func(istructs.IObject))

func (*MockObject) Containers

func (m *MockObject) Containers(cb func(container string))

func (*MockObject) FieldNames

func (m *MockObject) FieldNames(cb func(appdef.FieldName))

func (*MockObject) QName

func (m *MockObject) QName() appdef.QName

func (*MockObject) RecordIDs

func (m *MockObject) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID))

type MockPLogEvent

type MockPLogEvent struct {
	mock.Mock
}

func (*MockPLogEvent) ArgumentObject

func (m *MockPLogEvent) ArgumentObject() istructs.IObject

func (*MockPLogEvent) CUDs

func (m *MockPLogEvent) CUDs(cb func(rec istructs.ICUDRow))

func (*MockPLogEvent) DeviceID

func (*MockPLogEvent) Error

func (m *MockPLogEvent) Error() istructs.IEventError

func (*MockPLogEvent) QName

func (m *MockPLogEvent) QName() appdef.QName

func (*MockPLogEvent) RegisteredAt

func (m *MockPLogEvent) RegisteredAt() istructs.UnixMilli

func (*MockPLogEvent) Release

func (m *MockPLogEvent) Release()

func (*MockPLogEvent) Synced

func (m *MockPLogEvent) Synced() bool

func (*MockPLogEvent) SyncedAt

func (m *MockPLogEvent) SyncedAt() istructs.UnixMilli

func (*MockPLogEvent) WLogOffset

func (m *MockPLogEvent) WLogOffset() istructs.Offset

func (*MockPLogEvent) Workspace

func (m *MockPLogEvent) Workspace() istructs.WSID

type MockRawEvent

type MockRawEvent struct {
	mock.Mock
}

func (*MockRawEvent) ArgumentObject

func (m *MockRawEvent) ArgumentObject() istructs.IObject

func (*MockRawEvent) ArgumentUnloggedObject

func (m *MockRawEvent) ArgumentUnloggedObject() istructs.IObject

func (*MockRawEvent) CUDs

func (m *MockRawEvent) CUDs(cb func(rec istructs.ICUDRow))

func (*MockRawEvent) DeviceID

func (m *MockRawEvent) DeviceID() istructs.ConnectedDeviceID

func (*MockRawEvent) HandlingPartition

func (m *MockRawEvent) HandlingPartition() istructs.PartitionID

func (*MockRawEvent) PLogOffset

func (m *MockRawEvent) PLogOffset() istructs.Offset

func (*MockRawEvent) QName

func (m *MockRawEvent) QName() appdef.QName

func (*MockRawEvent) RegisteredAt

func (m *MockRawEvent) RegisteredAt() istructs.UnixMilli

func (*MockRawEvent) Synced

func (m *MockRawEvent) Synced() bool

func (*MockRawEvent) SyncedAt

func (m *MockRawEvent) SyncedAt() istructs.UnixMilli

func (*MockRawEvent) WLogOffset

func (m *MockRawEvent) WLogOffset() istructs.Offset

func (*MockRawEvent) Workspace

func (m *MockRawEvent) Workspace() istructs.WSID

type MockState

type MockState struct {
	mock.Mock
}

func (*MockState) App

func (m *MockState) App() istructs.AppQName

func (*MockState) CanExist

func (m *MockState) CanExist(key istructs.IStateKeyBuilder) (value istructs.IStateValue, ok bool, err error)

func (*MockState) CanExistAll

func (m *MockState) CanExistAll(keys []istructs.IStateKeyBuilder, callback istructs.StateValueCallback) (err error)

func (*MockState) KeyBuilder

func (m *MockState) KeyBuilder(storage, entity appdef.QName) (builder istructs.IStateKeyBuilder, err error)

func (*MockState) MustExist

func (m *MockState) MustExist(key istructs.IStateKeyBuilder) (value istructs.IStateValue, err error)

func (*MockState) MustExistAll

func (m *MockState) MustExistAll(keys []istructs.IStateKeyBuilder, callback istructs.StateValueCallback) (err error)

func (*MockState) MustNotExist

func (m *MockState) MustNotExist(key istructs.IStateKeyBuilder) (err error)

func (*MockState) MustNotExistAll

func (m *MockState) MustNotExistAll(keys []istructs.IStateKeyBuilder) (err error)

func (*MockState) PLogEvent

func (m *MockState) PLogEvent() istructs.IPLogEvent

func (*MockState) Read

func (m *MockState) Read(key istructs.IStateKeyBuilder, callback istructs.ValueCallback) (err error)

type MockStateKeyBuilder

type MockStateKeyBuilder struct {
	mock.Mock
}

func (*MockStateKeyBuilder) ClusteringColumns

func (m *MockStateKeyBuilder) ClusteringColumns() istructs.IRowWriter

func (*MockStateKeyBuilder) Entity

func (m *MockStateKeyBuilder) Entity() appdef.QName

func (*MockStateKeyBuilder) Equals

func (*MockStateKeyBuilder) PartitionKey

func (m *MockStateKeyBuilder) PartitionKey() istructs.IRowWriter

func (*MockStateKeyBuilder) PutBool

func (m *MockStateKeyBuilder) PutBool(name appdef.FieldName, value bool)

func (*MockStateKeyBuilder) PutBytes

func (m *MockStateKeyBuilder) PutBytes(name appdef.FieldName, value []byte)

func (*MockStateKeyBuilder) PutChars

func (m *MockStateKeyBuilder) PutChars(name appdef.FieldName, value string)

func (*MockStateKeyBuilder) PutFloat32

func (m *MockStateKeyBuilder) PutFloat32(name appdef.FieldName, value float32)

func (*MockStateKeyBuilder) PutFloat64

func (m *MockStateKeyBuilder) PutFloat64(name appdef.FieldName, value float64)

func (*MockStateKeyBuilder) PutFromJSON

func (m *MockStateKeyBuilder) PutFromJSON(map[string]any)

func (*MockStateKeyBuilder) PutInt32

func (m *MockStateKeyBuilder) PutInt32(name appdef.FieldName, value int32)

func (*MockStateKeyBuilder) PutInt64

func (m *MockStateKeyBuilder) PutInt64(name appdef.FieldName, value int64)

func (*MockStateKeyBuilder) PutNumber

func (m *MockStateKeyBuilder) PutNumber(name appdef.FieldName, value float64)

func (*MockStateKeyBuilder) PutQName

func (m *MockStateKeyBuilder) PutQName(name appdef.FieldName, value appdef.QName)

func (*MockStateKeyBuilder) PutRecordID

func (m *MockStateKeyBuilder) PutRecordID(name appdef.FieldName, value istructs.RecordID)

func (*MockStateKeyBuilder) PutString

func (m *MockStateKeyBuilder) PutString(name appdef.FieldName, value string)

func (*MockStateKeyBuilder) Storage

func (m *MockStateKeyBuilder) Storage() appdef.QName

func (*MockStateKeyBuilder) ToBytes

func (m *MockStateKeyBuilder) ToBytes(wsid istructs.WSID) ([]byte, []byte, error)

type MockStateValue

type MockStateValue struct {
	mock.Mock
}

func (*MockStateValue) AsBool

func (m *MockStateValue) AsBool(name appdef.FieldName) bool

func (*MockStateValue) AsBytes

func (m *MockStateValue) AsBytes(name appdef.FieldName) []byte

func (*MockStateValue) AsEvent

func (m *MockStateValue) AsEvent(name appdef.FieldName) istructs.IDbEvent

func (*MockStateValue) AsFloat32

func (m *MockStateValue) AsFloat32(name appdef.FieldName) float32

func (*MockStateValue) AsFloat64

func (m *MockStateValue) AsFloat64(name appdef.FieldName) float64

func (*MockStateValue) AsInt32

func (m *MockStateValue) AsInt32(name appdef.FieldName) int32

func (*MockStateValue) AsInt64

func (m *MockStateValue) AsInt64(name appdef.FieldName) int64

func (*MockStateValue) AsQName

func (m *MockStateValue) AsQName(name appdef.FieldName) appdef.QName

func (*MockStateValue) AsRecord

func (m *MockStateValue) AsRecord(name appdef.FieldName) istructs.IRecord

func (*MockStateValue) AsRecordID

func (m *MockStateValue) AsRecordID(name appdef.FieldName) istructs.RecordID

func (*MockStateValue) AsString

func (m *MockStateValue) AsString(name appdef.FieldName) string

func (*MockStateValue) AsValue

func (m *MockStateValue) AsValue(name string) istructs.IStateValue

func (*MockStateValue) FieldNames

func (m *MockStateValue) FieldNames(cb func(appdef.FieldName))

func (*MockStateValue) GetAsBool

func (m *MockStateValue) GetAsBool(index int) bool

func (*MockStateValue) GetAsBytes

func (m *MockStateValue) GetAsBytes(index int) []byte

func (*MockStateValue) GetAsFloat32

func (m *MockStateValue) GetAsFloat32(index int) float32

func (*MockStateValue) GetAsFloat64

func (m *MockStateValue) GetAsFloat64(index int) float64

func (*MockStateValue) GetAsInt32

func (m *MockStateValue) GetAsInt32(index int) int32

func (*MockStateValue) GetAsInt64

func (m *MockStateValue) GetAsInt64(index int) int64

func (*MockStateValue) GetAsQName

func (m *MockStateValue) GetAsQName(index int) appdef.QName

func (*MockStateValue) GetAsString

func (m *MockStateValue) GetAsString(index int) string

func (*MockStateValue) GetAsValue

func (m *MockStateValue) GetAsValue(index int) istructs.IStateValue

func (*MockStateValue) Length

func (m *MockStateValue) Length() int

func (*MockStateValue) RecordIDs

func (m *MockStateValue) RecordIDs(includeNulls bool, cb func(appdef.FieldName, istructs.RecordID))

type MockStateValueBuilder

type MockStateValueBuilder struct {
	mock.Mock
}

func (*MockStateValueBuilder) Build

func (*MockStateValueBuilder) BuildValue

func (m *MockStateValueBuilder) BuildValue() istructs.IStateValue

func (*MockStateValueBuilder) Equal

func (*MockStateValueBuilder) PutBool

func (m *MockStateValueBuilder) PutBool(name appdef.FieldName, value bool)

func (*MockStateValueBuilder) PutBytes

func (m *MockStateValueBuilder) PutBytes(name appdef.FieldName, value []byte)

func (*MockStateValueBuilder) PutChars

func (m *MockStateValueBuilder) PutChars(name appdef.FieldName, value string)

func (*MockStateValueBuilder) PutEvent

func (m *MockStateValueBuilder) PutEvent(name appdef.FieldName, event istructs.IDbEvent)

func (*MockStateValueBuilder) PutFloat32

func (m *MockStateValueBuilder) PutFloat32(name appdef.FieldName, value float32)

func (*MockStateValueBuilder) PutFloat64

func (m *MockStateValueBuilder) PutFloat64(name appdef.FieldName, value float64)

func (*MockStateValueBuilder) PutFromJSON

func (m *MockStateValueBuilder) PutFromJSON(map[string]any)

func (*MockStateValueBuilder) PutInt32

func (m *MockStateValueBuilder) PutInt32(name appdef.FieldName, value int32)

func (*MockStateValueBuilder) PutInt64

func (m *MockStateValueBuilder) PutInt64(name appdef.FieldName, value int64)

func (*MockStateValueBuilder) PutNumber

func (m *MockStateValueBuilder) PutNumber(name appdef.FieldName, value float64)

func (*MockStateValueBuilder) PutQName

func (m *MockStateValueBuilder) PutQName(name appdef.FieldName, value appdef.QName)

func (*MockStateValueBuilder) PutRecord

func (m *MockStateValueBuilder) PutRecord(name appdef.FieldName, record istructs.IRecord)

func (*MockStateValueBuilder) PutRecordID

func (m *MockStateValueBuilder) PutRecordID(name appdef.FieldName, value istructs.RecordID)

func (*MockStateValueBuilder) PutString

func (m *MockStateValueBuilder) PutString(name appdef.FieldName, value string)

func (*MockStateValueBuilder) ToBytes

func (m *MockStateValueBuilder) ToBytes() ([]byte, error)

type PathReader

type PathReader struct {
	// contains filtered or unexported fields
}

func NewPathReader

func NewPathReader(rootPath string) *PathReader

func (*PathReader) Open

func (r *PathReader) Open(name string) (fs.File, error)

func (*PathReader) ReadDir

func (r *PathReader) ReadDir(name string) ([]os.DirEntry, error)

func (*PathReader) ReadFile

func (r *PathReader) ReadFile(name string) ([]byte, error)

type ReqOptFunc

type ReqOptFunc func(opts *reqOpts)

func Expect400

func Expect400(expectErrorContains ...string) ReqOptFunc

func Expect400RefIntegrity_Existence

func Expect400RefIntegrity_Existence() ReqOptFunc

func Expect400RefIntegrity_QName

func Expect400RefIntegrity_QName() ReqOptFunc

func Expect401

func Expect401() ReqOptFunc

func Expect403

func Expect403(expectedMessages ...string) ReqOptFunc

func Expect404

func Expect404() ReqOptFunc

func Expect409

func Expect409(expected ...string) ReqOptFunc

func Expect410

func Expect410() ReqOptFunc

func Expect429

func Expect429() ReqOptFunc

func Expect500

func Expect500() ReqOptFunc

func Expect503

func Expect503() ReqOptFunc

func ExpectSysError500

func ExpectSysError500() ReqOptFunc

func WithAuthorizeBy

func WithAuthorizeBy(principalToken string) ReqOptFunc

has priority over WithAuthorizeByIfNot

func WithAuthorizeByIfNot

func WithAuthorizeByIfNot(principalToken string) ReqOptFunc

func WithCookies

func WithCookies(cookiesPairs ...string) ReqOptFunc

func WithDiscardResponse

func WithDiscardResponse() ReqOptFunc

WithDiscardResponse, WithResponseHandler and WithLongPolling are mutual exclusive causes FederationReq() to return nil for *HTTPResponse

func WithExpectedCode

func WithExpectedCode(expectedHTTPCode int, expectErrorContains ...string) ReqOptFunc

func WithHeaders

func WithHeaders(headersPairs ...string) ReqOptFunc

func WithLongPolling

func WithLongPolling() ReqOptFunc

WithLongPolling, WithResponseHandler and WithDiscardResponse are mutual exclusive

func WithMethod

func WithMethod(m string) ReqOptFunc

func WithRelativeURL

func WithRelativeURL(relativeURL string) ReqOptFunc

func WithResponseHandler

func WithResponseHandler(responseHandler func(httpResp *http.Response)) ReqOptFunc

WithResponseHandler, WithLongPolling and WithDiscardResponse are mutual exclusive

type SysError

type SysError struct {
	HTTPStatus int
	QName      appdef.QName
	Message    string
	Data       string
}

func NewHTTPError

func NewHTTPError(httpStatus int, err error) SysError

func NewHTTPErrorf

func NewHTTPErrorf(httpStatus int, args ...interface{}) SysError

func (SysError) Error

func (he SysError) Error() string

func (SysError) ToJSON

func (he SysError) ToJSON() string

type TestObject

type TestObject struct {
	istructs.NullObject
	Name        appdef.QName
	Id          istructs.RecordID
	Parent_     istructs.RecordID
	Data        map[string]interface{}
	Containers_ map[string][]*TestObject
	IsNew_      bool
}

ICUDRow, IObject

func (*TestObject) AsBool

func (o *TestObject) AsBool(name string) bool

func (*TestObject) AsBytes

func (o *TestObject) AsBytes(name string) []byte

func (*TestObject) AsFloat32

func (o *TestObject) AsFloat32(name string) float32

func (*TestObject) AsFloat64

func (o *TestObject) AsFloat64(name string) float64

func (*TestObject) AsInt32

func (o *TestObject) AsInt32(name string) int32

func (*TestObject) AsInt64

func (o *TestObject) AsInt64(name string) int64

func (*TestObject) AsQName

func (o *TestObject) AsQName(name string) appdef.QName

func (*TestObject) AsRecord

func (o *TestObject) AsRecord() istructs.IRecord

func (*TestObject) AsRecordID

func (o *TestObject) AsRecordID(name string) istructs.RecordID

func (*TestObject) AsString

func (o *TestObject) AsString(name string) string

func (*TestObject) Children

func (o *TestObject) Children(container string, cb func(istructs.IObject))

func (*TestObject) Containers

func (o *TestObject) Containers(cb func(container string))

func (*TestObject) FieldNames

func (o *TestObject) FieldNames(cb func(name string))

func (*TestObject) ID

func (o *TestObject) ID() istructs.RecordID

func (*TestObject) IsNew

func (o *TestObject) IsNew() bool

func (*TestObject) ModifiedFields

func (o *TestObject) ModifiedFields(cb func(string, interface{}))

func (*TestObject) Parent

func (o *TestObject) Parent() istructs.RecordID

func (*TestObject) PutBool

func (o *TestObject) PutBool(name string, value bool)

func (*TestObject) PutBytes

func (o *TestObject) PutBytes(name string, value []byte)

func (*TestObject) PutChars

func (o *TestObject) PutChars(name string, value string)

func (*TestObject) PutFloat32

func (o *TestObject) PutFloat32(name string, value float32)

func (*TestObject) PutFloat64

func (o *TestObject) PutFloat64(name string, value float64)

func (*TestObject) PutFromJSON

func (o *TestObject) PutFromJSON(value map[string]any)

func (*TestObject) PutInt32

func (o *TestObject) PutInt32(name string, value int32)

func (*TestObject) PutInt64

func (o *TestObject) PutInt64(name string, value int64)

func (*TestObject) PutNumber

func (o *TestObject) PutNumber(name string, value float64)

func (*TestObject) PutQName

func (o *TestObject) PutQName(name string, value appdef.QName)

func (*TestObject) PutRecordID

func (o *TestObject) PutRecordID(name string, value istructs.RecordID)

func (*TestObject) PutString

func (o *TestObject) PutString(name, value string)

func (*TestObject) QName

func (o *TestObject) QName() appdef.QName

type TestValue

type TestValue struct {
	*TestObject
}

func (*TestValue) AsEvent

func (v *TestValue) AsEvent(name string) (event istructs.IDbEvent)

func (*TestValue) AsRecord

func (v *TestValue) AsRecord(name string) (record istructs.IRecord)

type TimeFunc

type TimeFunc func() time.Time

type Translations

type Translations map[string]map[language.Tag]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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