github.com/annchain/OG@v0.0.9/og_interface/sync_interface.go (about)

     1  package og_interface
     2  
     3  // sync
     4  
     5  type UnknownManager interface {
     6  }
     7  
     8  type Syncer interface {
     9  }
    10  
    11  const (
    12  	UnknownTypeHeight UnknownType = iota
    13  	UnknownTypeHash
    14  )
    15  
    16  type UnknownType int
    17  
    18  // Unknown represents a resource that needs to be synced from others
    19  type Unknown interface {
    20  	GetType() UnknownType
    21  	GetValue() interface{}
    22  }
    23  
    24  type UnknownHeight struct {
    25  	value int
    26  }
    27  
    28  func (u UnknownHeight) GetType() UnknownType {
    29  	return UnknownTypeHeight
    30  }
    31  
    32  func (u UnknownHeight) GetValue() interface{} {
    33  	return u.value
    34  }
    35  
    36  type UnknownHash struct {
    37  	value Hash
    38  }
    39  
    40  func (u UnknownHash) GetType() UnknownType {
    41  	return UnknownTypeHash
    42  }
    43  
    44  func (u UnknownHash) GetValue() interface{} {
    45  	return u.value
    46  }