Documentation
¶
Index ¶
- Constants
- type Bootstrapper
- type DNSBootstrapper
- type HTTPBootstrapper
- type KubernetesBootstrapper
- type MemoryRouter
- func (m *MemoryRouter) Add(key string, ap netip.AddrPort)
- func (m *MemoryRouter) Advertise(ctx context.Context, keys []string) error
- func (m *MemoryRouter) Lookup(key string) ([]netip.AddrPort, bool)
- func (m *MemoryRouter) Ready(ctx context.Context) (bool, error)
- func (m *MemoryRouter) Resolve(ctx context.Context, key string, allowSelf bool, count int) (<-chan netip.AddrPort, error)
- type P2PRouter
- func (r *P2PRouter) Advertise(ctx context.Context, keys []string) error
- func (r *P2PRouter) Ready(ctx context.Context) (bool, error)
- func (r *P2PRouter) Resolve(ctx context.Context, key string, allowSelf bool, count int) (<-chan netip.AddrPort, error)
- func (r *P2PRouter) Run(ctx context.Context) error
- type Router
- type StaticBootstrapper
Constants ¶
View Source
const KeyTTL = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrapper ¶
type Bootstrapper interface { // Run starts the bootstrap process. Should be blocking even if not needed. Run(ctx context.Context, id string) error // Get returns a list of peers that should be used as bootstrap nodes. // If the peer ID is empty it will be resolved. // If the address is missing a port the P2P router port will be used. Get(ctx context.Context) ([]peer.AddrInfo, error) }
Bootstrapper resolves peers to bootstrap with for the P2P router.
type DNSBootstrapper ¶ added in v0.0.29
type DNSBootstrapper struct {
// contains filtered or unexported fields
}
func NewDNSBootstrapper ¶ added in v0.0.29
func NewDNSBootstrapper(host string, limit int) *DNSBootstrapper
type HTTPBootstrapper ¶
type HTTPBootstrapper struct {
// contains filtered or unexported fields
}
func NewHTTPBootstrapper ¶
func NewHTTPBootstrapper(addr, peer string) *HTTPBootstrapper
type KubernetesBootstrapper ¶
type KubernetesBootstrapper struct {
// contains filtered or unexported fields
}
func NewKubernetesBootstrapper ¶
func NewKubernetesBootstrapper(cs kubernetes.Interface, namespace, name string) *KubernetesBootstrapper
type MemoryRouter ¶ added in v0.0.23
type MemoryRouter struct {
// contains filtered or unexported fields
}
func NewMemoryRouter ¶ added in v0.0.23
func (*MemoryRouter) Add ¶ added in v0.0.23
func (m *MemoryRouter) Add(key string, ap netip.AddrPort)
func (*MemoryRouter) Advertise ¶ added in v0.0.23
func (m *MemoryRouter) Advertise(ctx context.Context, keys []string) error
func (*MemoryRouter) Lookup ¶ added in v0.0.23
func (m *MemoryRouter) Lookup(key string) ([]netip.AddrPort, bool)
type P2PRouter ¶
type P2PRouter struct {
// contains filtered or unexported fields
}
func NewP2PRouter ¶
type Router ¶
type Router interface { // Ready returns true when the router is ready. Ready(ctx context.Context) (bool, error) // Resolve asynchronously discovers addresses that can serve the content defined by the give key. Resolve(ctx context.Context, key string, allowSelf bool, count int) (<-chan netip.AddrPort, error) // Advertise broadcasts that the current router can serve the content. Advertise(ctx context.Context, keys []string) error }
Router implements the discovery of content.
type StaticBootstrapper ¶ added in v0.0.29
type StaticBootstrapper struct {
// contains filtered or unexported fields
}
func NewStaticBootstrapper ¶ added in v0.0.29
func NewStaticBootstrapper() *StaticBootstrapper
func (*StaticBootstrapper) Run ¶ added in v0.0.29
func (b *StaticBootstrapper) Run(ctx context.Context, id string) error
func (*StaticBootstrapper) SetPeers ¶ added in v0.0.30
func (b *StaticBootstrapper) SetPeers(peers []peer.AddrInfo)
Click to show internal directories.
Click to hide internal directories.