Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDomainExpiry(amount balance.Amount, perBlockFees int64) uint64
- type Domain
- func (d *Domain) Activate()
- func (d *Domain) AddToExpire(h int64)
- func (d *Domain) CancelSale()
- func (d *Domain) ChangeOwner(addr keys.Address)
- func (d *Domain) Data() serialize.Data
- func (d *Domain) Deactivate()
- func (d Domain) IsActive(height int64) bool
- func (d *Domain) IsChangeable(currentHeight int64) bool
- func (d Domain) IsExpired(height int64) bool
- func (d *Domain) NewDataInstance() serialize.Data
- func (d *Domain) PutOnSale(price balance.Amount)
- func (d *Domain) ResetAfterSale(buyer, account keys.Address, nBlocks, currentHeight int64)
- func (d *Domain) SetAccountAddress(addr keys.Address)
- func (d *Domain) SetData(a interface{}) error
- func (d *Domain) SetLastUpdatedHeight(height int64)
- type DomainStore
- func (ds *DomainStore) DeleteASubdomain(subdomainName Name) error
- func (ds *DomainStore) DeleteAllSubdomains(name Name) error
- func (ds *DomainStore) Exists(name Name) bool
- func (ds *DomainStore) Get(name Name) (*Domain, error)
- func (ds *DomainStore) GetOptions() *Options
- func (ds *DomainStore) Iterate(fn func(name Name, domain *Domain) bool) (stopped bool)
- func (ds *DomainStore) IterateSubDomain(parentName Name, fn func(name Name, domain *Domain) bool) (stopped bool)
- func (ds *DomainStore) Set(d *Domain) error
- func (ds *DomainStore) SetOptions(opt *Options)
- func (ds *DomainStore) WithState(state *storage.State) *DomainStore
- type Name
- type Options
Constants ¶
View Source
const HEIGHT_INTERVAL = 1
Variables ¶
View Source
var ( ErrDomainNameNotValid = errors.New("Domain name is invalid") ErrDomainNotFound = errors.New("Domain doesn't exist") )
Functions ¶
Types ¶
type Domain ¶
type Domain struct { // addresses of the owner and the account the domain points to Owner keys.Address `json:"owner"` Beneficiary keys.Address `json:"beneficiary"` // the domain name; this is als a unique identifier of // the domain object over the chain Name Name `json:"name"` // block heights at which the domain was first created and updated CreationHeight int64 `json:"creationHeight"` LastUpdateHeight int64 `json:"lastUpdateHeight"` // expire block height ExpireHeight int64 `json:"expireHeight"` // 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"` URI string `json:"uri"` // the asking price in OLT set by the owner SalePrice *balance.Amount `json:"salePrice"` }
func (*Domain) AddToExpire ¶ added in v0.14.0
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) ResetAfterSale ¶ added in v0.14.0
func (*Domain) SetAccountAddress ¶
func (*Domain) SetLastUpdatedHeight ¶
type DomainStore ¶
DomainStore wraps the persistent storage and the serializer giving handy methods to access Domain objects
func NewDomainStore ¶
func NewDomainStore(prefix string, state *storage.State) *DomainStore
NewDomainStore creates a new storage object from filepath and other configurations
func (*DomainStore) DeleteASubdomain ¶ added in v0.14.0
func (ds *DomainStore) DeleteASubdomain(subdomainName Name) error
func (*DomainStore) DeleteAllSubdomains ¶ added in v0.14.0
func (ds *DomainStore) DeleteAllSubdomains(name Name) error
func (*DomainStore) Exists ¶
func (ds *DomainStore) Exists(name Name) bool
func (*DomainStore) Get ¶
func (ds *DomainStore) Get(name Name) (*Domain, error)
Get is used to retrieve the domain object from the domain name
func (*DomainStore) GetOptions ¶ added in v0.14.0
func (ds *DomainStore) GetOptions() *Options
func (*DomainStore) Iterate ¶ added in v0.12.0
func (ds *DomainStore) Iterate(fn func(name Name, domain *Domain) bool) (stopped bool)
func (*DomainStore) IterateSubDomain ¶ added in v0.14.0
func (*DomainStore) Set ¶
func (ds *DomainStore) Set(d *Domain) error
func (*DomainStore) SetOptions ¶ added in v0.14.0
func (ds *DomainStore) SetOptions(opt *Options)
func (*DomainStore) WithState ¶ added in v0.12.0
func (ds *DomainStore) WithState(state *storage.State) *DomainStore
type Name ¶ added in v0.14.0
type Name string
func GetNameFromString ¶ added in v0.14.0
func (Name) GetParentName ¶ added in v0.14.0
type Options ¶ added in v0.14.0
type Options struct { Currency string `json:"currency"` PerBlockFees balance.Amount `json:"perBlockFees"` BaseDomainPrice balance.Amount `json:"baseDomainPrice"` FirstLevelDomains []string `json:"firstLevelDomains"` // contains filtered or unexported fields }
func (*Options) IsNameAllowed ¶ added in v0.14.0
func (*Options) IsValidURI ¶ added in v0.14.0
Click to show internal directories.
Click to hide internal directories.