Documentation ¶
Index ¶
- Constants
- Variables
- type Object
- type Options
- type Tangle
- func (t *Tangle) Add(s *Object) error
- func (t *Tangle) Close()
- func (t *Tangle) Get(h hash.Hash) *Object
- func (t *Tangle) GetSite(h hash.Hash) *site.Site
- func (t *Tangle) HasTip(h hash.Hash) bool
- func (t *Tangle) Hashes() []hash.Hash
- func (t *Tangle) Init(o Options) error
- func (t *Tangle) Inject(s *Object, tip bool) error
- func (t *Tangle) RecommendTips() []*site.Site
- func (t *Tangle) Search(s string) []*Object
- func (t *Tangle) Size() int
- func (t *Tangle) Tips() []*site.Site
- func (t *Tangle) Weight(s *site.Site) int
Constants ¶
View Source
const ( // MinimumWeight for new site.Sites MinimumWeight = 1 // MinimumValidations specifies how many sites must be verified by a new site MinimumValidations = 2 // MaxRecommendations specifies how many sites can be returned by RecommendTips MaxRecommendations = 4 )
Variables ¶
View Source
var ( // ErrWeightTooLow is returned when the weight does not exceed MinimumWeight ErrWeightTooLow = errors.New("Weight too low. Has to be > " + strconv.Itoa(MinimumWeight)) // ErrNotValidating is returned when the site does not validate any current tip ErrNotValidating = errors.New("Site does not validate any current tip") // ErrTooFewValidations is returned when the site does not validate enough sites ErrTooFewValidations = errors.New("Site does not validate enough sites") )
Functions ¶
This section is empty.
Types ¶
type Object ¶
type Object struct { Site *site.Site Data datastore.Serializable }
Object is the exposed site including the content
type Tangle ¶
type Tangle struct {
// contains filtered or unexported fields
}
Tangle stores the relation between different transactions
func (*Tangle) Add ¶
Add Validates the site and adds it to the tangle to be valid, a site has to: * Validate at least one tip * Have a weight of at least MinimumWeight
func (*Tangle) RecommendTips ¶
RecommendTips returns tips to be used
Click to show internal directories.
Click to hide internal directories.