data

package
v0.0.0-...-cb3ca1d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateOffer  = "offer"
	TemplateAccess = "access"
)

Templates kinds.

View Source
const (
	ProductUsageIncremental = "incremental"
	ProductUsageTotal       = "total"
)

Product usage reporting types.

View Source
const (
	UnitScalar  = "units"
	UnitSeconds = "seconds"
)

Unit used for billing calculation.

View Source
const (
	BillingPrepaid  = "prepaid"
	BillingPostpaid = "postpaid"
)

Billing types.

View Source
const (
	MsgUnpublished      = "unpublished"           // Saved but not published.
	MsgBChainPublishing = "bchain_publishing"     // To blockchain.
	MsgBChainPublished  = "bchain_published"      // To blockchain.
	MsgChPublished      = "msg_channel_published" // Published in messaging channel.
)

Message statuses.

View Source
const (
	OfferEmpty    = "empty"
	OfferRegister = "register"
	OfferRemove   = "remove"
)

Offering statuses.

View Source
const (
	ChannelPending       = "pending"
	ChannelActive        = "active"
	ChannelWaitCoop      = "wait_coop"
	ChannelClosedCoop    = "closed_coop"
	ChannelWaitChallenge = "wait_challenge"
	ChannelInChallenge   = "in_challenge"
	ChannelWaitUncoop    = "wait_uncoop"
	ChannelClosedUncoop  = "closed_uncoop"
)

State channel statuses.

View Source
const (
	ServicePending    = "pending"
	ServiceActive     = "active"
	ServiceSuspended  = "suspended"
	ServiceTerminated = "terminated"
)

Service operational statuses.

View Source
const (
	ContractPTC = "ptc"
	ContractPSC = "psc"
)

Contract types.

View Source
const (
	JobUser           = "user"
	JobBillingChecker = "billing_checker"
	JobBCMonitor      = "bc_monitor"
	JobTask           = "task"
)

Job creators.

View Source
const (
	JobActive   = "active"
	JobDone     = "done"
	JobFailed   = "failed"
	JobCanceled = "canceled"
)

Job statuses.

View Source
const (
	JobOfferring = "offering"
	JobChannel   = "channel"
	JobEndpoint  = "endpoint"
	JobAccount   = "account"
)

Job related object types.

View Source
const (
	TxUnsent = "unsent"
	TxSent   = "sent"
	TxMined  = "mined"
	TxUncle  = "uncle"
)

Transaction statuses.

View Source
const (
	JobClientPreChannelCreate               = "clientPreChannelCreate"
	JobClientAfterChannelCreate             = "clientAfterChannelCreate"
	JobClientPreChannelTopUp                = "clientPreChannelTopUp"
	JobClientAfterChannelTopUp              = "clientAfterChannelTopUp"
	JobClientPreUncooperativeCloseRequest   = "clientPreUncooperativeCloseRequest"
	JobClientAfterUncooperativeCloseRequest = "clientAfterUncooperativeCloseRequest"
	JobClientPreUncooperativeClose          = "clientPreUncooperativeClose"
	JobClientAfterUncooperativeClose        = "clientAfterUncooperativeClose"
	JobClientAfterCooperativeClose          = "clientAfterCooperativeClose"
	JobClientPreServiceTerminate            = "clientPreServiceTerminate"
	JobClientAfterServiceTerminate          = "clientAfterServiceTerminate"
	JobClientPreEndpointMsgSOMCGet          = "clientPreEndpointMsgSOMCGet"
	JobClientAfterOfferingMsgBCPublish      = "clientAfterOfferingMsgBCPublish"
	JobClientPreOfferingMsgSOMCGet          = "clientPreOfferingMsgSOMCGet"
	JobAgentAfterChannelCreate              = "agentAfterChannelCreate"
	JobAgentAfterChannelTopUp               = "agentAfterChannelTopUp"
	JobAgentAfterUncooperativeCloseRequest  = "agentAfterUncooperativeCloseRequest"
	JobAgentAfterUncooperativeClose         = "agentAfterUncooperativeClose"
	JobAgentPreCooperativeClose             = "agentPreCooperativeClose"
	JobAgentAfterCooperativeClose           = "agentAfterCooperativeClose"
	JobAgentPreServiceSuspend               = "agentPreServiceSuspend"
	JobAgentPreServiceUnsuspend             = "agentPreServiceUnsuspend"
	JobAgentPreServiceTerminate             = "agentPreServiceTerminate"
	JobAgentPreEndpointMsgCreate            = "agentPreEndpointMsgCreate"
	JobAgentPreEndpointMsgSOMCPublish       = "agentPreEndpointMsgSOMCPublish"
	JobAgentAfterEndpointMsgSOMCPublish     = "agentAfterEndpointMsgSOMCPublish"
	JobAgentPreOfferingMsgBCPublish         = "agentPreOfferingMsgBCPublish"
	JobAgentAfterOfferingMsgBCPublish       = "agentAfterOfferingMsgBCPublish"
	JobAgentPreOfferingMsgSOMCPublish       = "agentPreOfferingMsgSOMCPublish"
	JobPreAccountAddBalanceApprove          = "preAccountAddBalanceApprove"
	JobPreAccountAddBalance                 = "preAccountAddBalance"
	JobAfterAccountAddBalance               = "afterAccountAddBalance"
	JobPreAccountReturnBalance              = "preAccountReturnBalance"
	JobAfterAccountReturnBalance            = "afterAccountReturnBalance"
	JobAccountAddCheckBalance               = "addCheckBalance"
)

Job types.

View Source
const (
	TestPassword     = "secret"
	TestPasswordHash = "JDJhJDEwJHNVbWNtTkVwQk5DMkwuOC5OL1BXU08uYkJMMkxjcmthTW1BZklOTUNjNWZDdWNUOU54Tzlp"
	TestSalt         = 6012867121110302348
)

Test authentication constants.

View Source
const (
	ClientIdentByChannelID = "by_channel_id"
)

Product authentication types.

Variables

This section is empty.

Functions

func BeginTestTX

func BeginTestTX(t *testing.T, db *reform.DB) *reform.TX

BeginTestTX begins a test transaction.

func BytesToUint32

func BytesToUint32(b []byte) (uint32, error)

BytesToUint32 using big endian.

func CleanTestDB

func CleanTestDB(t *testing.T, db *reform.DB)

CleanTestDB deletes all records from all test DB tables.

func CleanTestTable

func CleanTestTable(t *testing.T, db *reform.DB, tbl reform.Table)

CleanTestTable deletes all records from a given DB table.

func CloseDB

func CloseDB(db *reform.DB)

CloseDB closes database connection.

func CommitTestTX

func CommitTestTX(t *testing.T, tx *reform.TX)

CommitTestTX commits a test transaction.

func DeleteFromTestDB

func DeleteFromTestDB(t *testing.T, db *reform.DB, recs ...reform.Record)

DeleteFromTestDB deletes records from test DB.

func EncryptedKey

func EncryptedKey(pkey *ecdsa.PrivateKey, auth string) (string, error)

EncryptedKey returns encrypted keystore.Key in base64.

func FindInTestDB

func FindInTestDB(t *testing.T, db *reform.DB,
	str reform.Struct, column string, arg interface{})

FindInTestDB selects a record from test db

func FromBytes

func FromBytes(src []byte) string

FromBytes returns the base64 encoding of src.

func GetUint64Setting

func GetUint64Setting(db *reform.DB, key string) (uint64, error)

GetUint64Setting finds the key value in table Setting. Checks that the value in the format of uint64

func HashPassword

func HashPassword(password, salt string) (string, error)

HashPassword computes encoded hash of the password.

func InsertToTestDB

func InsertToTestDB(t *testing.T, db *reform.DB, rows ...reform.Struct)

InsertToTestDB inserts rows to test DB.

func NewDB

func NewDB(conf *DBConfig, logger *util.Logger) (*reform.DB, error)

NewDB creates a new data connection handle.

func NewDBFromConnStr

func NewDBFromConnStr(connStr string, logger *util.Logger) (*reform.DB, error)

NewDBFromConnStr creates a new data connection handle from a given connection string.

func NewTestDB

func NewTestDB(conf *DBConfig, logger *util.Logger) *reform.DB

NewTestDB creates a new database connection.

func ReloadFromTestDB

func ReloadFromTestDB(t *testing.T, db *reform.DB, recs ...reform.Record)

ReloadFromTestDB reloads records from test DB.

func RollbackTestTX

func RollbackTestTX(t *testing.T, tx *reform.TX)

RollbackTestTX rollbacks a test transaction.

func SaveToTestDB

func SaveToTestDB(t *testing.T, db *reform.DB, recs ...reform.Record)

SaveToTestDB saves records to test DB.

func TestEncryptedKey

func TestEncryptedKey(pkey *ecdsa.PrivateKey, auth string) (string, error)

TestEncryptedKey is a key encryption simplified for tests performance.

func TestToAddress

func TestToAddress(t *testing.T, addr string) common.Address

TestToAddress decodes to address or fails.

func TestToBytes

func TestToBytes(t *testing.T, s string) []byte

TestToBytes returns binary representation of base64 encoded string or fails.

func TestToHash

func TestToHash(t *testing.T, h string) common.Hash

TestToHash decodes to hash or fails.

func TestToPrivateKey

func TestToPrivateKey(keyB64, auth string) (*ecdsa.PrivateKey, error)

TestToPrivateKey is a key decryption simplified for tests performance.

func ToAddress

func ToAddress(addr string) (common.Address, error)

ToAddress returns ethereum's address from base 64 encoded string.

func ToBytes

func ToBytes(s string) ([]byte, error)

ToBytes returns the bytes represented by the base64 string s.

func ToHash

func ToHash(h string) (common.Hash, error)

ToHash returns the ethereum's hash represented by the base64 string s.

func ToPrivateKey

func ToPrivateKey(keyB64, auth string) (*ecdsa.PrivateKey, error)

ToPrivateKey returns decrypted *ecdsa.PrivateKey from base64 of encrypted keystore.Key.

func Uint32ToBytes

func Uint32ToBytes(x uint32) [4]byte

Uint32ToBytes using big endian.

func ValidatePassword

func ValidatePassword(hash, password, salt string) error

ValidatePassword checks if a given password, hash and salt are matching.

Types

type Account

type Account struct {
	ID               string     `json:"id" reform:"id,pk"`
	EthAddr          string     `json:"ethAddr" reform:"eth_addr"`
	PublicKey        string     `json:"-" reform:"public_key"`
	PrivateKey       string     `json:"-" reform:"private_key"`
	IsDefault        bool       `json:"isDefault" reform:"is_default"`
	InUse            bool       `json:"inUse" reform:"in_use"`
	Name             string     `json:"name" reform:"name"`
	PTCBalance       uint64     `json:"ptcBalance" reform:"ptc_balance"`
	PSCBalance       uint64     `json:"psc_balance" reform:"psc_balance"`
	EthBalance       B64BigInt  `json:"ethBalance" reform:"eth_balance"`
	LastBalanceCheck *time.Time `json:"lastBalanceCheck" reform:"last_balance_check"`
}

Account is an ethereum account.

func NewEthTestAccount

func NewEthTestAccount(auth string, acc *truffle.TestAccount) *Account

NewEthTestAccount returns new account based on truffle.TestAccount.

func NewTestAccount

func NewTestAccount(auth string) *Account

NewTestAccount returns new account.

type B64BigInt

type B64BigInt string

B64BigInt is a base64 of big.Int that implements json.Marshaler.

func (B64BigInt) MarshalJSON

func (i B64BigInt) MarshalJSON() ([]byte, error)

MarshalJSON marshals itself.

type Channel

type Channel struct {
	ID                 string     `json:"id" reform:"id,pk"`
	Agent              string     `json:"agent" reform:"agent"`
	Client             string     `json:"client" reform:"client"`
	Offering           string     `json:"offering" reform:"offering"`
	Block              uint32     `json:"block" reform:"block"`                  // When state channel created.
	ChannelStatus      string     `json:"channelStatus" reform:"channel_status"` // Status related to blockchain.
	ServiceStatus      string     `json:"serviceStatus" reform:"service_status"`
	ServiceChangedTime *time.Time `json:"serviceChangedTime" reform:"service_changed_time"`
	TotalDeposit       uint64     `json:"totalDeposit" reform:"total_deposit"`
	Salt               uint64     `json:"-" reform:"salt"`
	Username           *string    `json:"-" reform:"username"`
	Password           string     `json:"-" reform:"password"`
	ReceiptBalance     uint64     `json:"-" reform:"receipt_balance"`   // Last payment.
	ReceiptSignature   *string    `json:"-" reform:"receipt_signature"` // Last payment's signature.
}

Channel is a state channel.

func NewTestChannel

func NewTestChannel(agent, client, offering string,
	balance, deposit uint64, status string) *Channel

NewTestChannel returns new channel.

type Contract

type Contract struct {
	ID      string `json:"id" reform:"id,pk"`
	Address string `json:"address" reform:"address"` // Ethereum address
	Type    string `json:"type" reform:"type"`
	Version *uint8 `json:"version" reform:"version"`
	Enabled bool   `json:"enabled" reform:"enabled"`
}

Contract is a smart contract.

type DBConfig

type DBConfig struct {
	Conn map[string]string
}

DBConfig is a DB configuration.

func NewDBConfig

func NewDBConfig() *DBConfig

NewDBConfig creates a default DB configuration.

func (DBConfig) ConnStr

func (c DBConfig) ConnStr() string

ConnStr composes a data connection string.

type EncryptedKeyFunc

type EncryptedKeyFunc func(*ecdsa.PrivateKey, string) (string, error)

EncryptedKeyFunc is a func that returns encrypted keystore.Key in base64.

type Endpoint

type Endpoint struct {
	ID                     string  `json:"id" reform:"id,pk"`
	Template               string  `json:"template" reform:"template"`
	Channel                string  `json:"channel" reform:"channel"`
	Hash                   string  `json:"hash" reform:"hash"`
	RawMsg                 string  `reform:"raw_msg"`
	Status                 string  `json:"status" reform:"status"`
	PaymentReceiverAddress *string `json:"paymentReceiverAddress" reform:"payment_receiver_address"`
	ServiceEndpointAddress *string `json:"serviceEndpointAddress" reform:"service_endpoint_address"`
	Username               *string `json:"username" reform:"username"`
	Password               *string `json:"password" reform:"password"`
	AdditionalParams       []byte  `json:"additionalParams" reform:"additional_params"`
}

Endpoint messages is info about service access.

func NewTestEndpoint

func NewTestEndpoint(chanID, tplID string) *Endpoint

NewTestEndpoint returns new endpoint.

type EndpointUI

type EndpointUI struct {
	ID               string `json:"id" reform:"id,pk"`
	AdditionalParams []byte `json:"additionalParams" reform:"additional_params"`
}

EndpointUI contains only certain fields of endpoints table.

type EthLog

type EthLog struct {
	ID          string    `reform:"id,pk"`
	TxHash      string    `reform:"tx_hash"`
	TxStatus    string    `reform:"status"`
	JobID       *string   `reform:"job"`
	BlockNumber uint64    `reform:"block_number"`
	Addr        string    `reform:"addr"`
	Data        string    `reform:"data"`
	Topics      LogTopics `reform:"topics"`
	Failures    uint64    `reform:"failures"`
	Ignore      bool      `reform:"ignore"`
}

EthLog is an ethereum log entry.

func NewTestEthLog

func NewTestEthLog() *EthLog

NewTestEthLog returns a default test eth log.

type EthTx

type EthTx struct {
	ID          string    `reform:"id,pk" json:"id"`
	Hash        string    `reform:"hash" json:"hash"`
	Method      string    `reform:"method" json:"method"`
	Status      string    `reform:"status" json:"status"`
	JobID       *string   `reform:"job" json:"jobID"`
	Issued      time.Time `reform:"issued" json:"issued"`
	AddrFrom    string    `reform:"addr_from" json:"addrFrom"`
	AddrTo      string    `reform:"addr_to" json:"addrTo"`
	Nonce       *string   `reform:"nonce" json:"nonce"`
	GasPrice    uint64    `reform:"gas_price" json:"gasPrice"`
	Gas         uint64    `reform:"gas" json:"gas"`
	TxRaw       []byte    `reform:"tx_raw" json:"txRaw"`
	RelatedType string    `reform:"related_type" json:"relatedType"`
	RelatedID   string    `reform:"related_id" json:"relatedID"`
}

EthTx is an ethereum transaction

type Job

type Job struct {
	ID          string    `reform:"id,pk"`
	Type        string    `reform:"type"`
	Status      string    `reform:"status"`
	RelatedType string    `reform:"related_type"`
	RelatedID   string    `reform:"related_id"`
	CreatedAt   time.Time `reform:"created_at"`
	NotBefore   time.Time `reform:"not_before"`
	CreatedBy   string    `reform:"created_by"`
	TryCount    uint8     `reform:"try_count"`
	Data        []byte    `reform:"data"`
}

Job is a task within persistent queue.

func NewTestJob

func NewTestJob(jobType, createdBy, relType string) *Job

NewTestJob returns a default test job.

type JobBalanceData

type JobBalanceData struct {
	GasPrice uint64
	Amount   uint
}

JobBalanceData is a data required for transfer jobs.

type JobPublishData

type JobPublishData struct {
	GasPrice uint64
}

JobPublishData is a data required for blockchain publish jobs.

type LogTopics

type LogTopics []common.Hash

LogTopics is a database/sql compatible type for ethereum log topics.

func (*LogTopics) Scan

func (t *LogTopics) Scan(src interface{}) error

Scan deserializes the log topics.

func (LogTopics) Value

func (t LogTopics) Value() (driver.Value, error)

Value serializes the log topics.

type Offering

type Offering struct {
	ID                 string  `json:"id" reform:"id,pk"`
	IsLocal            bool    `json:"is_local" reform:"is_local"`
	Template           string  `json:"template" reform:"tpl" validate:"required"`    // Offering's.
	Product            string  `json:"product" reform:"product" validate:"required"` // Specific billing and actions.
	Hash               string  `json:"hash" reform:"hash"`                           // Offering's hash.
	Status             string  `json:"status" reform:"status"`
	OfferStatus        string  `json:"offerStatus" reform:"offer_status"`
	BlockNumberUpdated uint64  `json:"blockNumberUpdated" reform:"block_number_updated"`
	Agent              string  `json:"agent" reform:"agent" validate:"required"`
	RawMsg             string  `json:"rawMsg" reform:"raw_msg"`
	ServiceName        string  `json:"serviceName" reform:"service_name" validate:"required"`
	Description        *string `json:"description" reform:"description"`
	Country            string  `json:"country" reform:"country" validate:"required"` // ISO 3166-1 alpha-2.
	Supply             uint16  `json:"supply" reform:"supply" validate:"required"`
	UnitName           string  `json:"unitName" reform:"unit_name" validate:"required"` // Like megabytes, minutes, etc.
	UnitType           string  `json:"unitType" reform:"unit_type" validate:"required"`
	BillingType        string  `json:"billingType" reform:"billing_type" validate:"required"`
	SetupPrice         uint64  `json:"setupPrice" reform:"setup_price"` // Setup fee.
	UnitPrice          uint64  `json:"unitPrice" reform:"unit_price"`
	MinUnits           uint64  `json:"minUnits" reform:"min_units" validate:"required"`
	MaxUnit            *uint64 `json:"maxUnit" reform:"max_unit"`
	BillingInterval    uint    `json:"billingInterval" reform:"billing_interval" validate:"required"` // Every unit number to be paid.
	MaxBillingUnitLag  uint    `json:"maxBillingUnitLag" reform:"max_billing_unit_lag"`               // Max maximum tolerance for payment lag.
	MaxSuspendTime     uint    `json:"maxSuspendTime" reform:"max_suspended_time"`                    // In seconds.
	MaxInactiveTimeSec *uint64 `json:"maxInactiveTimeSec" reform:"max_inactive_time_sec"`
	FreeUnits          uint8   `json:"freeUnits" reform:"free_units"`
	AdditionalParams   []byte  `json:"additionalParams" reform:"additional_params" validate:"required"`
}

Offering is a service offering.

func NewTestOffering

func NewTestOffering(agent, product, tpl string) *Offering

NewTestOffering returns new offering.

type PWDGetSetter

type PWDGetSetter interface {
	PWDGetter
	PWDSetter
}

PWDGetSetter can get and set password to storage.

type PWDGetter

type PWDGetter interface {
	Get() string
}

PWDGetter can retrieve stored password.

type PWDSetter

type PWDSetter interface {
	Set(string)
}

PWDSetter can set new password.

type PWDStorage

type PWDStorage string

PWDStorage stores password in memory.

func (*PWDStorage) Get

func (p *PWDStorage) Get() string

Get returns stored password.

func (*PWDStorage) Set

func (p *PWDStorage) Set(pwd string)

Set sets stored password.

type Product

type Product struct {
	ID                     string  `json:"id" reform:"id,pk"`
	Name                   string  `json:"name" reform:"name"`
	OfferTplID             *string `json:"offerTplID" reform:"offer_tpl_id"`
	OfferAccessID          *string `json:"offerAccessID" reform:"offer_access_id"`
	UsageRepType           string  `json:"usageRepType" reform:"usage_rep_type"`
	IsServer               bool    `json:"isServer" reform:"is_server"`
	Salt                   uint64  `json:"-" reform:"salt"`
	Password               string  `json:"-" reform:"password"`
	ClientIdent            string  `json:"clientIdent" reform:"client_ident"`
	Config                 []byte  `json:"config" reform:"config"`
	ServiceEndpointAddress *string `json:"serviceEndpointAddress" reform:"service_endpoint_address"`
}

Product stores billing and action related settings.

func NewTestProduct

func NewTestProduct() *Product

NewTestProduct returns new product.

type Session

type Session struct {
	ID              string     `json:"id" reform:"id,pk"`
	Channel         string     `json:"channel" reform:"channel"`
	Started         time.Time  `json:"started" reform:"started"`
	Stopped         *time.Time `json:"stopped" reform:"stopped"`
	UnitsUsed       uint64     `json:"unitsUsed" reform:"units_used"`
	SecondsConsumed uint64     `json:"secondsConsumed" reform:"seconds_consumed"`
	LastUsageTime   time.Time  `json:"lastUsageTime" reform:"last_usage_time"`
	ClientIP        *string    `json:"clientIP" reform:"client_ip"`
	ClientPort      *uint16    `json:"clientPort" reform:"client_port"`
}

Session is a client session.

func NewTestSession

func NewTestSession(chanID string) *Session

NewTestSession returns new session.

type Setting

type Setting struct {
	Key         string  `json:"key" reform:"key,pk"`
	Value       string  `json:"value" reform:"value"`
	Description *string `json:"description" reform:"description"`
	Name        string  `json:"name" reform:"name"`
}

Setting is a user setting.

type StaticPWDStorage

type StaticPWDStorage string

StaticPWDStorage returns static static password, can't be rewritten.

func (*StaticPWDStorage) Get

func (s *StaticPWDStorage) Get() string

Get returns stored static password.

func (*StaticPWDStorage) Set

func (s *StaticPWDStorage) Set(_ string)

Set does nothing.

type Template

type Template struct {
	ID   string `json:"id" reform:"id,pk"`
	Hash string `json:"hash" reform:"hash"`
	Raw  []byte `json:"raw" reform:"raw"`
	Kind string `json:"kind" reform:"kind"`
}

Template is a user defined structures. It can be an offer or access template.

func NewTestTemplate

func NewTestTemplate(kind string) *Template

NewTestTemplate returns new tempalte.

type TestData

type TestData struct {
	Channel  string
	Password string
}

TestData is a container for testing data items.

type TestFixture

type TestFixture struct {
	T              *testing.T
	DB             *reform.DB
	Product        *Product
	Account        *Account
	User           *User
	TemplateOffer  *Template
	TemplateAccess *Template
	Offering       *Offering
	Channel        *Channel
	Endpoint       *Endpoint
}

TestFixture encapsulates a typical set of DB objects useful for testing.

func NewEthTestFixture

func NewEthTestFixture(t *testing.T, db *reform.DB,
	account *truffle.TestAccount) *TestFixture

func NewTestFixture

func NewTestFixture(t *testing.T, db *reform.DB) *TestFixture

NewTestFixture creates a new test fixture.

func (*TestFixture) Close

func (f *TestFixture) Close()

Close closes a given test fixture.

type ToPrivateKeyFunc

type ToPrivateKeyFunc func(string, string) (*ecdsa.PrivateKey, error)

ToPrivateKeyFunc is a func that returns decrypted *ecdsa.PrivateKey from base64 of encrypted keystore.Key.

type User

type User struct {
	ID        string `json:"id" reform:"id,pk"`
	EthAddr   string `json:"ethAddr" reform:"eth_addr"`
	PublicKey string `json:"publicKey" reform:"public_key"`
}

User is party in distributed trade. It can play an agent role, a client role, or both of them.

func NewTestUser

func NewTestUser() *User

NewTestUser returns new subject.

Jump to

Keyboard shortcuts

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