Documentation
¶
Index ¶
- Constants
- Variables
- type Domain
- func (d *Domain) Activate()
- func (d *Domain) CancelSale()
- func (d *Domain) ChangeOwner(addr keys.Address)
- func (d *Domain) Data() serialize.Data
- func (d *Domain) Deactivate()
- func (d *Domain) IsChangeable(currentHeight int64) bool
- func (d *Domain) NewDataInstance() serialize.Data
- func (d *Domain) PutOnSale(price balance.Coin)
- func (d *Domain) SetAccountAddress(addr keys.Address)
- func (d *Domain) SetData(a interface{}) error
- func (d *Domain) SetLastUpdatedHeight(height int64)
- type DomainStore
Constants ¶
View Source
const HEIGHT_INTERVAL = 1
Variables ¶
View Source
var (
ErrDomainNotFound = errors.New("Domain doesn't exist")
)
Functions ¶
This section is empty.
Types ¶
type Domain ¶
type Domain struct {
// addresses of the owner and the account the domain points to
OwnerAddress keys.Address `json:"ownerAddress"`
AccountAddress keys.Address `json:"accountAddress"`
// the domain name; this is als a unique identifier of
// the domain object over the chain
Name string `json:"name"`
// block heights at which the domain was first created and updated
CreationHeight int64 `json:"creationHeight"`
LastUpdateHeight int64 `json:"lastUpdateHeight"`
// flag to denote whether send2Domain is active on this domain
ActiveFlag bool `json:"activeFlag"`
// denotes whether the domain is for sale
OnSaleFlag bool `json:"onSaleFlag"`
// the asking price in OLT set by the owner
SalePrice balance.Coin `json:"salePrice"`
}
func (*Domain) CancelSale ¶
func (d *Domain) CancelSale()
func (*Domain) ChangeOwner ¶
func (*Domain) Deactivate ¶
func (d *Domain) Deactivate()
func (*Domain) IsChangeable ¶
func (*Domain) NewDataInstance ¶
func (*Domain) SetAccountAddress ¶
func (*Domain) SetLastUpdatedHeight ¶
type DomainStore ¶
type DomainStore struct {
*storage.ChainState
// contains filtered or unexported fields
}
DomainStore wraps the persistent storage and the serializer giving handy methods to access Domain objects
func NewDomainStore ¶
func NewDomainStore(name, dbDir, configDB string, typ storage.StorageType) *DomainStore
NewDomainStore creates a new storage object from filepath and other configurations
func (*DomainStore) Exists ¶
func (ds *DomainStore) Exists(name string) bool
func (*DomainStore) Get ¶
func (ds *DomainStore) Get(name string, lastCommit bool) (*Domain, error)
Get is used to retrieve the domain object from the domain name
func (*DomainStore) Set ¶
func (ds *DomainStore) Set(d *Domain) error
Click to show internal directories.
Click to hide internal directories.