Versions in this module Expand all Collapse all v0 v0.21.1 Apr 1, 2019 Changes in this version + const AccessDenied + const BillingPostpaid + const BillingPrepaid + const ChannelActive + const ChannelClosedCoop + const ChannelClosedUncoop + const ChannelInChallenge + const ChannelPending + const ChannelWaitChallenge + const ChannelWaitCoop + const ChannelWaitUncoop + const ClientIdentByChannelID + const ContractPSC + const ContractPTC + const CountryStatusInvalid + const CountryStatusUnknown + const CountryStatusValid + const JobAccount + const JobAccountUpdateBalances + const JobActive + const JobAfterAccountAddBalance + const JobAfterAccountReturnBalance + const JobAgentAfterChannelCreate + const JobAgentAfterChannelTopUp + const JobAgentAfterCooperativeClose + const JobAgentAfterOfferingDelete + const JobAgentAfterOfferingMsgBCPublish + const JobAgentAfterOfferingPopUp + const JobAgentAfterUncooperativeClose + const JobAgentAfterUncooperativeCloseRequest + const JobAgentPreEndpointMsgCreate + const JobAgentPreOfferingDelete + const JobAgentPreOfferingMsgBCPublish + const JobAgentPreOfferingPopUp + const JobAgentPreServiceSuspend + const JobAgentPreServiceTerminate + const JobAgentPreServiceUnsuspend + const JobBCMonitor + const JobBillingChecker + const JobCanceled + const JobChannel + const JobClientAfterChannelCreate + const JobClientAfterChannelTopUp + const JobClientAfterCooperativeClose + const JobClientAfterOfferingDelete + const JobClientAfterOfferingMsgBCPublish + const JobClientAfterOfferingPopUp + const JobClientAfterUncooperativeClose + const JobClientAfterUncooperativeCloseRequest + const JobClientCompleteServiceTransition + const JobClientEndpointRestore + const JobClientPreChannelCreate + const JobClientPreChannelTopUp + const JobClientPreServiceSuspend + const JobClientPreServiceTerminate + const JobClientPreServiceUnsuspend + const JobClientPreUncooperativeClose + const JobClientPreUncooperativeCloseRequest + const JobDecrementCurrentSupply + const JobDone + const JobEndpoint + const JobFailed + const JobIncrementCurrentSupply + const JobOffering + const JobPreAccountAddBalance + const JobPreAccountAddBalanceApprove + const JobPreAccountReturnBalance + const JobServiceAdapter + const JobSessionServer + const JobTask + const JobUser + const OfferEmpty + const OfferPoppedUp + const OfferPoppingUp + const OfferRegistered + const OfferRegistering + const OfferRemoved + const OfferRemoving + const OfferingSOMCTor + const ProductUsageIncremental + const ProductUsageTotal + const ReadOnly + const ReadWrite + const RoleAgent + const RoleClient + const ServiceActivating + const ServiceActive + const ServicePending + const ServiceSuspended + const ServiceSuspending + const ServiceTerminated + const ServiceTerminating + const SettingAppVersion + const SettingBlockLimit + const SettingDefaultGasPrice + const SettingFreshBlocks + const SettingGUI + const SettingLastProcessedBlock + const SettingMinConfirmations + const SettingOfferingAutoPopUp + const SettingPasswordHash + const SettingPasswordSalt + const SettingsPeriodChallange + const SettingsPeriodPopUp + const SettingsPeriodRemove + const TemplateAccess + const TemplateOffer + const TestPassword + const TestPasswordHash + const TestSalt + const TestServiceEndpointAddress + const TxMined + const TxSent + const TxUncle + const TxUnsent + const UnitScalar + const UnitSeconds + func BeginTestTX(t *testing.T, db *reform.DB) *reform.TX + func BytesToUint32(b []byte) (uint32, error) + func ChannelKey(client, agent HexString, block uint32, offeringHash HexString) ([]byte, error) + func CleanTestDB(t *testing.T, db *reform.DB) + func CleanTestTable(t *testing.T, db *reform.DB, tbl reform.View) + func CloseDB(db *reform.DB) + func CommitTestTX(t *testing.T, tx *reform.TX) + func DeleteFromTestDB(t *testing.T, db *reform.DB, recs ...reform.Record) + func ExecuteCommand(args []string) error + func FindByPrimaryKeyTo(db *reform.Querier, rec reform.Record, key interface{}) error + func FindInTestDB(t *testing.T, db *reform.DB, str reform.Struct, column string, arg interface{}) + func FindOneTo(db *reform.Querier, str reform.Struct, column string, arg interface{}) error + func FromBase64ToHex(s Base64String) (string, error) + func GetUint64Setting(db *reform.DB, key string) (uint64, error) + func HexToAddress(addr HexString) (common.Address, error) + func HexToBytes(s HexString) ([]byte, error) + func HexToHash(h HexString) (common.Hash, error) + func Insert(db *reform.Querier, str reform.Struct) error + func InsertToTestDB(t *testing.T, db *reform.DB, rows ...reform.Struct) + func MinDeposit(offering *Offering) uint64 + func NewDB(conf *DBConfig) (*reform.DB, error) + func NewDBFromConnStr(connStr string) (*reform.DB, error) + func NewTestDB(conf *DBConfig) *reform.DB + func ReadBoolSetting(db *reform.Querier, key string) (bool, error) + func ReadSetting(db *reform.Querier, key string) (string, error) + func ReadUintSetting(db *reform.Querier, key string) (uint, error) + func Recover(db *reform.DB) error + func ReloadFromTestDB(t *testing.T, db *reform.DB, recs ...reform.Record) + func RollbackTestTX(t *testing.T, tx *reform.TX) + func Save(db *reform.Querier, rec reform.Record) error + func SaveToTestDB(t *testing.T, db *reform.DB, recs ...reform.Record) + func SelectOneFromTestDBTo(t *testing.T, db *reform.DB, str reform.Struct, tail string, ...) + func TestToAddress(t *testing.T, addr HexString) common.Address + func TestToBytes(t *testing.T, s Base64String) []byte + func TestToHash(t *testing.T, h HexString) common.Hash + func TestToPrivateKey(keyB64 Base64String, _ string) (*ecdsa.PrivateKey, error) + func ToBytes(s Base64String) ([]byte, error) + func ToHash(h Base64String) (common.Hash, error) + func ToPrivateKey(keyB64 Base64String, auth string) (*ecdsa.PrivateKey, error) + func Uint192ToBytes(x *big.Int) [24]byte + func Uint32ToBytes(x uint32) [4]byte + func Uint64ToBytes(x uint64) [8]byte + func ValidatePassword(hash Base64String, password, salt string) error + type Account struct + EthAddr HexString + EthBalance Base64BigInt + ID string + InUse bool + IsDefault bool + LastBalanceCheck *time.Time + Name string + PSCBalance uint64 + PTCBalance uint64 + PrivateKey Base64String + PublicKey Base64String + func NewEthTestAccount(auth string, acc *truffle.TestAccount) *Account + func NewTestAccount(auth string) *Account + type Base64BigInt string + func (n Base64BigInt) MarshalJSON() ([]byte, error) + type Base64String string + func EncryptedKey(pkey *ecdsa.PrivateKey, auth string) (Base64String, error) + func FromBytes(src []byte) Base64String + func HashPassword(password, salt string) (Base64String, error) + func TestEncryptedKey(pkey *ecdsa.PrivateKey, _ string) (Base64String, error) + type Channel struct + Agent HexString + Block uint32 + ChannelStatus string + Client HexString + ID string + Offering string + Password Base64String + PreparedAt time.Time + ReceiptBalance uint64 + ReceiptSignature *Base64String + Salt uint64 + ServiceChangedTime *time.Time + ServiceStatus string + TotalDeposit uint64 + Username *string + func NewTestChannel(agent, client HexString, offering string, balance, deposit uint64, ...) *Channel + type Contract struct + Address HexString + Enabled bool + ID string + Type string + Version *uint8 + type DBConfig struct + Conn map[string]string + MaxIddle int + MaxOpen int + func NewDBConfig() *DBConfig + func (c DBConfig) ConnStr() string + type EncryptedKeyFunc func(*ecdsa.PrivateKey, string) (Base64String, error) + type Endpoint struct + AdditionalParams []byte + Channel string + CountryStatus *string + Hash HexString + ID string + Password *string + PaymentReceiverAddress *string + RawMsg Base64String + ServiceEndpointAddress *string + Template string + Username *string + func NewTestEndpoint(chanID, tplID string) *Endpoint + type EndpointUI struct + CountryStatus *string + ID string + PaymentReceiverAddress *string + ServiceEndpointAddress *string + type EthTx struct + AddrFrom HexString + AddrTo HexString + Gas uint64 + GasPrice uint64 + Hash HexString + ID string + Issued time.Time + JobID *string + Method string + Nonce *string + RelatedID string + RelatedType string + Status string + TxRaw []byte + type HexString string + func HexFromBytes(src []byte) HexString + type Job struct + CreatedAt time.Time + CreatedBy string + Data []byte + ID string + NotBefore time.Time + RelatedID string + RelatedType string + Status string + TryCount uint8 + Type string + func NewTestJob(jobType, createdBy, relType string) *Job + type JobBalanceData struct + Amount uint64 + GasPrice uint64 + type JobCreateChannelData struct + Deposit uint + GasPrice uint64 + type JobData struct + EthLog *JobEthLog + type JobEndpointCreateData struct + EndpointSealed []byte + type JobEthLog struct + Block uint64 + Data []byte + Topics LogTopics + TxHash HexString + type JobPublishData struct + GasPrice uint64 + type JobTopUpChannelData struct + Deposit uint64 + GasPrice uint64 + type LogEvent struct + Context json.RawMessage + Level log.Level + Message string + Stack *string + Time time.Time + type LogTopics []common.Hash + func (t *LogTopics) Scan(src interface{}) error + func (t LogTopics) Value() (driver.Value, error) + type Offering struct + AdditionalParams json.RawMessage + Agent HexString + AutoPopUp *bool + BillingInterval uint + BillingType string + BlockNumberUpdated uint64 + Country string + CurrentSupply uint16 + Description *string + FreeUnits uint8 + Hash HexString + ID string + IsLocal bool + MaxBillingUnitLag uint + MaxInactiveTimeSec uint64 + MaxSuspendTime uint + MaxUnit *uint64 + MinUnits uint64 + Product string + RawMsg Base64String + SOMCData Base64String + SOMCSuccessPing *time.Time + SOMCType uint8 + ServiceName string + SetupPrice uint64 + Status string + Supply uint16 + Template string + UnitName string + UnitPrice uint64 + UnitType string + func NewTestOffering(agent HexString, product, tpl string) *Offering + type PWDGetSetter interface + type PWDGetter interface + Get func() string + type PWDSetter interface + Set func(string) + type PWDStorage string + func (p *PWDStorage) Get() string + func (p *PWDStorage) Set(pwd string) + type Product struct + ClientIdent string + Config json.RawMessage + Country *string + ID string + IsServer bool + Name string + OfferAccessID *string + OfferTplID *string + Password Base64String + Salt uint64 + ServiceEndpointAddress *string + UsageRepType string + func NewTestProduct() *Product + type Session struct + Channel string + ClientIP *string + ClientPort *uint16 + ID string + LastUsageTime time.Time + SecondsConsumed uint64 + Started time.Time + Stopped *time.Time + UnitsUsed uint64 + func NewTestSession(chanID string) *Session + type Setting struct + Description *string + Key string + Name string + Permissions int + Value string + type StaticPWDStorage string + func (s *StaticPWDStorage) Get() string + func (s *StaticPWDStorage) Set(_ string) + type Template struct + Hash HexString + ID string + Kind string + Raw json.RawMessage + func NewTestTemplate(kind string) *Template + type TestData struct + Channel string + Password string + type TestFixture struct + Account *Account + Channel *Channel + DB *reform.DB + Endpoint *Endpoint + Offering *Offering + Product *Product + T *testing.T + TemplateAccess *Template + TemplateOffer *Template + User *User + UserAcc *Account + func NewEthTestFixture(t *testing.T, db *reform.DB, account *truffle.TestAccount) *TestFixture + func NewTestFixture(t *testing.T, db *reform.DB) *TestFixture + func (f *TestFixture) Close() + type ToPrivateKeyFunc func(Base64String, string) (*ecdsa.PrivateKey, error) + type User struct + EthAddr HexString + ID string + PublicKey Base64String + func NewTestUser() *User