 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func CalculateAdvertiseAddress(bindAddr, advertiseAddr string) (string, int, error)
- func IsUnroutable(host string) bool
- func New(l log.Logger, reg *prometheus.Registry, bindAddr string, advertiseAddr string, ...) (*peer, error)
- type Peer
- type PeerMetadata
- type PeerState
- type PeerStateFetcher
- type PeerType
Constants ¶
      View Source
      
  
    const ( DefaultRefreshInterval = model.Duration(60 * time.Second) // Peer's network types. These are used as a predefined peer configurations for a specified network type. LocalNetworkPeerType = "local" LanNetworkPeerType = "lan" WanNetworkPeerType = "wan" )
      View Source
      
  const ( // PeerTypeStore is for peers that implements StoreAPI and are used for browsing historical data. PeerTypeStore = "store" // PeerTypeSource is for peers that implements StoreAPI and are used for scraping data. They tend to // have data accessible only for short period. PeerTypeSource = "source" // PeerTypeQuery is for peers that implements QueryAPI and are used for querying the metrics. PeerTypeQuery = "query" )
Constants holding valid PeerType values.
Variables ¶
      View Source
      
  
var ( // NetworkPeerTypes is a list of available peers' network types. NetworkPeerTypes = []string{LocalNetworkPeerType, LanNetworkPeerType, WanNetworkPeerType} )
Functions ¶
func CalculateAdvertiseAddress ¶
CalculateAdvertiseAddress deduce the external, advertise address that should be routable from other components.
func New ¶
func New( l log.Logger, reg *prometheus.Registry, bindAddr string, advertiseAddr string, advertiseStoreAPIAddr string, advertiseQueryAPIAddress string, knownPeers []string, waitIfEmpty bool, pushPullInterval time.Duration, gossipInterval time.Duration, refreshInterval time.Duration, secretKey []byte, networkType string, ) (*peer, error)
New returns "alone" peer that is ready to join.
Types ¶
type Peer ¶
type PeerMetadata ¶
type PeerMetadata struct {
	// Labels represents external labels for the peer. Only relevant for PeerTypeSource. Empty for other types.
	Labels []storepb.Label
	// MinTime indicates the minTime of the oldest block available from this peer.
	MinTime int64
	// MaxTime indicates the maxTime of the youngest block available from this peer.
	MaxTime int64
}
    PeerMetadata are the information that can change in runtime of the peer.
type PeerState ¶
type PeerState struct {
	// Type represents type of the peer holding the state.
	Type PeerType
	// StoreAPIAddr is a host:port address of gRPC StoreAPI of the peer holding the state. Required for PeerTypeSource and PeerTypeStore.
	StoreAPIAddr string
	// QueryAPIAddr is a host:port address of HTTP QueryAPI of the peer holding the state. Required for PeerTypeQuery type only.
	QueryAPIAddr string
	// Metadata holds metadata of the peer holding the state.
	Metadata PeerMetadata
}
    PeerState contains state for the peer.
type PeerStateFetcher ¶ added in v0.2.0
       Source Files
      ¶
      Source Files
      ¶
    
- advertise.go
- cluster.go
- data.go
- delegate.go
 Click to show internal directories. 
   Click to hide internal directories.